From c842d90bbc5ab8f4fb88fb89ebb02c0c12051396 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 27 Jul 2016 22:51:11 -0700 Subject: 3158 --- html/050scenario.cc.html | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'html/050scenario.cc.html') diff --git a/html/050scenario.cc.html b/html/050scenario.cc.html index 213874ff..d6805cfd 100644 --- a/html/050scenario.cc.html +++ b/html/050scenario.cc.html @@ -156,6 +156,7 @@ Num_core_mu_tests = SIZE(Scenariosfalse; time_t mu_time; time(&mu_time); cerr << "\nMu tests: " << ctime(&mu_time); +run_mu_scenarios: for (int i = 0; i < SIZE(Scenarios); ++i) { //? cerr << i << ": " << Scenarios.at(i).name << '\n'; if (i == Num_core_mu_tests) { @@ -166,6 +167,14 @@ cerr << "\nif (Passed) cerr << "."; } +:(after "End Test Run Initialization") +if (Test_only_app && Num_core_mu_tests < SIZE(Scenarios)) { + // we have app tests; skip core mu tests + Scenarios.erase(Scenarios.begin(), Scenarios.begin()+Num_core_mu_tests); + // skip C tests + goto run_mu_scenarios; +} + //: Convenience: run a single named scenario. :(after "Test Runs") for (int i = 0; i < SIZE(Scenarios); ++i) { @@ -192,10 +201,10 @@ cerr << "\n(tmp.at(0)); transform_all(); run(tmp.front()); - if (Passed && !Hide_errors && trace_count("error") > 0) { + if (!Hide_errors && trace_count("error") > 0) Passed = false; + if (!Passed) ++Num_failures; - } // End Mu Test Teardown if (not_already_inside_test && Trace_stream) { teardown(); @@ -380,10 +389,7 @@ put(Recipe_ordinal,else // just testing scenario support raise << "location '" << address << "' can't contain non-number " << rhs << '\n' << end(); - if (!Scenario_testing_scenario) { - Passed = false; - ++Num_failures; - } + if (!Scenario_testing_scenario) Passed = false; return; } double value = to_double(rhs); @@ -399,10 +405,7 @@ put(Recipe_ordinal,// just testing scenario support raise << "expected location '" << address << "' to contain " << no_scientific(value) << " but saw " << no_scientific(get_or_insert(Memory, address)) << '\n' << end(); } - if (!Scenario_testing_scenario) { - Passed = false; - ++Num_failures; - } + if (!Scenario_testing_scenario) Passed = false; return; } locations_checked.insert(address); @@ -438,10 +441,7 @@ put(Recipe_ordinal,"\nF - " << Current_scenario->name << ": expected location '" << address << "' to contain length " << SIZE(literal) << " of string [" << literal << "] but saw " << no_scientific(get_or_insert(Memory, address)) << " (" << read_mu_string(address) << ")\n" << end(); else raise << "expected location '" << address << "' to contain length " << SIZE(literal) << " of string [" << literal << "] but saw " << no_scientific(get_or_insert(Memory, address)) << '\n' << end(); - if (!Scenario_testing_scenario) { - Passed = false; - ++Num_failures; - } + if (!Scenario_testing_scenario) Passed = false; return; } ++address; // now skip length @@ -456,10 +456,7 @@ put(Recipe_ordinal,// just testing scenario support raise << "expected location " << (address+i) << " to contain " << literal.at(i) << " but saw " << no_scientific(get_or_insert(Memory, address+i)) << '\n' << end(); } - if (!Scenario_testing_scenario) { - Passed = false; - ++Num_failures; - } + if (!Scenario_testing_scenario) Passed = false; return; } } @@ -712,7 +709,7 @@ put(Recipe_ordinal,:(before "End Primitive Recipe Checks") case CHECK_TRACE_COUNT_FOR_LABEL: { if (SIZE(inst.ingredients) != 2) { - raise << maybe(get(Recipe, r).name) << "'check-trace-count-for-label' requires exactly two ingredients, but got '" << to_original_string(inst) << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'check-trace-count-for-label' requires exactly two ingredients, but got '" << inst.original_string << "'\n" << end(); break; } if (!is_mu_number(inst.ingredients.at(0))) { @@ -741,10 +738,7 @@ put(Recipe_ordinal,// just testing scenario support raise << maybe(current_recipe_name()) << "expected " << expected_count << " lines in trace with label '" << label << "' in trace\n" << end(); } - if (!Scenario_testing_scenario) { - Passed = false; - ++Num_failures; - } + if (!Scenario_testing_scenario) Passed = false; } break; } -- cgit 1.4.1-2-gfad0