From e07cbe5edfef74005a56205586202e9a224f0500 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 12 Aug 2016 18:00:47 -0700 Subject: 3174 --- html/050scenario.cc.html | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'html/050scenario.cc.html') diff --git a/html/050scenario.cc.html b/html/050scenario.cc.html index d6805cfd..0727ae0e 100644 --- a/html/050scenario.cc.html +++ b/html/050scenario.cc.html @@ -99,7 +99,6 @@ scenario foo [ :(before "End Globals") vector<scenario> Scenarios; -set<string> Scenario_names; //:: Parse the 'scenario' form. //: Simply store the text of the scenario. @@ -113,9 +112,6 @@ set<string> Scenario_names; scenario parse_scenario(istream& in) { scenario result; result.name = next_word(in); - if (contains_key(Scenario_names, result.name)) - raise << "duplicate scenario name: '" << result.name << "'\n" << end(); - Scenario_names.insert(result.name); skip_whitespace_and_comments(in); if (in.peek() != '[') { raise << "Expected '[' after scenario '" << result.name << "'\n" << end(); @@ -149,30 +145,41 @@ scenario foo [ //: Treat the text of the scenario as a regular series of instructions. :(before "End Globals") -int Num_core_mu_tests = 0; +int Num_core_mu_scenarios = 0; :(after "Check For .mu Files") -Num_core_mu_tests = SIZE(Scenarios); +Num_core_mu_scenarios = SIZE(Scenarios); :(before "End Tests") Hide_missing_default_space_errors = false; -time_t mu_time; time(&mu_time); -cerr << "\nMu tests: " << ctime(&mu_time); -run_mu_scenarios: -for (int i = 0; i < SIZE(Scenarios); ++i) { +time(&t); +cerr << "\nMu tests: " << ctime(&t); +for (int i = 0; i < Num_core_mu_scenarios; ++i) { //? cerr << i << ": " << Scenarios.at(i).name << '\n'; - if (i == Num_core_mu_tests) { - time(&t); - cerr << "\nApp tests: " << ctime(&t); - } run_mu_scenario(Scenarios.at(i)); if (Passed) cerr << "."; } +cerr << "\n"; +run_app_scenarios: +if (Num_core_mu_scenarios != SIZE(Scenarios)) { + time(&t); + cerr << "App tests: " << ctime(&t); + for (int i = Num_core_mu_scenarios; i < SIZE(Scenarios); ++i) { +//? cerr << i << ": " << Scenarios.at(i).name << '\n'; + run_mu_scenario(Scenarios.at(i)); + if (Passed) cerr << "."; + } +} +//: For faster debugging, support running tests for just the Mu app(s) we are +//: loading. +:(before "End Globals") +bool Test_only_app = false; +:(before "End Commandline Options(*arg)") +else if (is_equal(*arg, "--test-only-app")) { + Test_only_app = true; +} :(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; +if (Test_only_app && Num_core_mu_scenarios < SIZE(Scenarios)) { + goto run_app_scenarios; } //: Convenience: run a single named scenario. @@ -789,7 +796,6 @@ is_autogenerated = false;< :(code) // just for the scenarios running scenarios in C++ layers void run_mu_scenario(const string& form) { - Scenario_names.clear(); istringstream in(form); in >> std::noskipws; skip_whitespace_and_comments(in); @@ -798,10 +804,6 @@ is_autogenerated = false;< scenario s = parse_scenario(in); run_mu_scenario(s); } - -bool starts_with(const string& s, const string& pat) { - return s.substr(0, pat.size()) == pat; -} -- cgit 1.4.1-2-gfad0