about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-20 20:19:29 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-20 20:19:29 -0700
commitdddc384c5124febdf111730fa760dcb6a06e7155 (patch)
tree239f1a3efbf773adabd3951439c84660b93ecfd2
parent2ada05dc69e930d096d8d6773d3191d2befe253a (diff)
downloadmu-dddc384c5124febdf111730fa760dcb6a06e7155.tar.gz
3531
Be consistent in checking for Scenario_testing_scenario when signalling
that a Mu scenario failed.
-rw-r--r--050scenario.cc6
-rw-r--r--082scenario_screen.cc4
2 files changed, 5 insertions, 5 deletions
diff --git a/050scenario.cc b/050scenario.cc
index 7f3178c9..4cc284e8 100644
--- a/050scenario.cc
+++ b/050scenario.cc
@@ -179,7 +179,7 @@ void run_mu_scenario(const scenario& s) {
   transform_all();
   run(tmp.front());
   // End Mu Test Teardown
-  if (!Hide_errors && trace_count("error") > 0)
+  if (!Hide_errors && trace_count("error") > 0 && !Scenario_testing_scenario)
     Passed = false;
   if (!Passed)
     ++Num_failures;
@@ -533,7 +533,7 @@ void check_trace(const string& expected) {
           << "in trace with label '" << expected_lines.at(curr_expected_line).label << "'\n" << end();
   if (!Hide_errors)
     DUMP(expected_lines.at(curr_expected_line).label);
-  Passed = false;
+  if (!Scenario_testing_scenario) Passed = false;
 }
 
 vector<trace_line> parse_trace(const string& expected) {
@@ -621,7 +621,7 @@ bool check_trace_missing(const string& in) {
   for (int i = 0;  i < SIZE(lines);  ++i) {
     if (trace_count(lines.at(i).label, lines.at(i).contents) != 0) {
       raise << "unexpected [" << lines.at(i).contents << "] in trace with label '" << lines.at(i).label << "'\n" << end();
-      Passed = false;
+      if (!Scenario_testing_scenario) Passed = false;
       return false;
     }
   }
diff --git a/082scenario_screen.cc b/082scenario_screen.cc
index c6862f9b..73660fb5 100644
--- a/082scenario_screen.cc
+++ b/082scenario_screen.cc
@@ -267,7 +267,7 @@ void check_screen(const string& expected_contents, const int color) {
     if (cursor.at_end()) break;
     if (cursor.get() != '.') {
       raise << Current_scenario->name << ": each row of the expected screen should start with a '.'\n" << end();
-      Passed = false;
+      if (!Scenario_testing_scenario) Passed = false;
       return;
     }
     for (int column = 0;  column < screen_width;  ++column, addr+= /*size of screen-cell*/2) {
@@ -323,7 +323,7 @@ void check_screen(const string& expected_contents, const int color) {
     }
     if (cursor.get() != '.') {
       raise << Current_scenario->name << ": row " << row << " of the expected screen is too long\n" << end();
-      Passed = false;
+      if (!Scenario_testing_scenario) Passed = false;
       return;
     }
   }