diff options
author | 2018-05-10 10:26:06 -0700 | |
---|---|---|
committer | 2018-05-10 10:29:04 -0700 | |
commit | 2d8b1a448446f809ef2ae682b966cb090e227f6c (patch) | |
tree | 079a2d3b616eda3e25a2d341347f2fd8448ae234 /tensorflow/contrib/lite/testing/generated_examples_zip_test.cc | |
parent | f59f87131867d2a5782740101a8ab4e6536fe72e (diff) |
Removing expected softmax test failure and improving logging.
PiperOrigin-RevId: 196134704
Diffstat (limited to 'tensorflow/contrib/lite/testing/generated_examples_zip_test.cc')
-rw-r--r-- | tensorflow/contrib/lite/testing/generated_examples_zip_test.cc | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/tensorflow/contrib/lite/testing/generated_examples_zip_test.cc b/tensorflow/contrib/lite/testing/generated_examples_zip_test.cc index 860696ecdc..a8714afd83 100644 --- a/tensorflow/contrib/lite/testing/generated_examples_zip_test.cc +++ b/tensorflow/contrib/lite/testing/generated_examples_zip_test.cc @@ -67,9 +67,6 @@ std::map<string, string> kBrokenTests = { // non-const tensors as crops. {R"(^\/batch_to_space_nd.*crops=\[\[1,1\],\[1,1\]\])", "70594634"}, - // Softmax graphs are too complex. - {R"(^\/softmax.*input_shape=\[1,3,4,3\])", "67749831"}, - // SpaceToBatchND only supports 4D tensors. {R"(^\/space_to_batch_nd.*input_shape=\[1,4,4,4,1,1\])", "70848787"}, @@ -207,7 +204,7 @@ std::vector<string> UnarchiveZipAndFindTestNames(const string& zip_file_name) { class OpsTest : public ::testing::TestWithParam<string> {}; -TEST_P(OpsTest, RunStuff) { +TEST_P(OpsTest, RunZipTests) { string test_path = GetParam(); string tflite_test_case = test_path + "_tests.txt"; string tflite_dir = test_path.substr(0, test_path.find_last_of("/")); @@ -230,7 +227,9 @@ TEST_P(OpsTest, RunStuff) { EXPECT_TRUE(result) << test_driver.GetErrorMessage(); } else { if (FLAGS_ignore_known_bugs) { - EXPECT_FALSE(result); + EXPECT_FALSE(result) << "Test was expected to fail but is now passing; " + "you can mark http://b/" + << bug_number << " as fixed! Yay!"; } else { EXPECT_TRUE(result) << test_driver.GetErrorMessage() << ": Possibly due to http://b/" << bug_number; @@ -238,12 +237,29 @@ TEST_P(OpsTest, RunStuff) { } } +struct ZipPathParamName { + template <class ParamType> + string operator()(const ::testing::TestParamInfo<ParamType>& info) const { + string param_name = info.param; + size_t last_slash = param_name.find_last_of("\\/"); + if (last_slash != string::npos) { + param_name = param_name.substr(last_slash); + } + for (size_t index = 0; index < param_name.size(); ++index) { + if (!isalnum(param_name[index]) && param_name[index] != '_') + param_name[index] = '_'; + } + return param_name; + } +}; + // Instantiate a test. This assumes `zip_base`.zip is a declared data file // of this test. -#define INSTANTIATE_TESTS(zip_base) \ - INSTANTIATE_TEST_CASE_P( \ - zip_base, OpsTest, \ - ::testing::ValuesIn(UnarchiveZipAndFindTestNames(#zip_base ".zip"))); +#define INSTANTIATE_TESTS(zip_base) \ + INSTANTIATE_TEST_CASE_P( \ + zip_base, OpsTest, \ + ::testing::ValuesIn(UnarchiveZipAndFindTestNames(#zip_base ".zip")), \ + ZipPathParamName()); INSTANTIATE_TESTS(add) INSTANTIATE_TESTS(arg_max) |