about summary refs log tree commit diff stats
path: root/050scenario.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-07-09 14:25:48 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-07-09 14:25:48 -0700
commit6573fe1f1aa6d87c027d10429ded7e0162e52902 (patch)
treeddd110af3e987e49bb60ba05c16833c92d6d8901 /050scenario.cc
parent6ff9413c5dc624df6a33d7680a6667c27cd9352e (diff)
downloadmu-6573fe1f1aa6d87c027d10429ded7e0162e52902.tar.gz
3965 - get rid of the teardown() function
Instead of setup() and teardown() we'll just use a reset() function from
now on, which will bring the machine back to a good state before each
test or run, and also before exit (to avoid memory leaks).
Diffstat (limited to '050scenario.cc')
-rw-r--r--050scenario.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/050scenario.cc b/050scenario.cc
index 375da6cb..fb0a0114 100644
--- a/050scenario.cc
+++ b/050scenario.cc
@@ -217,7 +217,7 @@ void run_mu_scenario(const scenario& s) {
 //?   cerr << s.name << '\n';
   if (not_already_inside_test) {
     Trace_stream = new trace_stream;
-    setup();
+    reset();
   }
   vector<recipe_ordinal> tmp = load("recipe scenario_"+s.name+" [ "+s.to_run+" ]");
   mark_autogenerated(tmp.at(0));
@@ -229,7 +229,6 @@ void run_mu_scenario(const scenario& s) {
   if (!Hide_errors && trace_contains_errors() && !Scenario_testing_scenario)
     Passed = false;
   if (not_already_inside_test && Trace_stream) {
-    teardown();
     if (Save_trace) {
       ofstream fout("last_trace");
       fout << Trace_stream->readable_contents("");
@@ -330,7 +329,7 @@ def main [
 //: when we eventually build a compiler.
 
 //: 'run' is a purely lexical convenience to separate the code actually being
-//: tested from any setup or teardown
+//: tested from any setup
 
 :(scenario run)
 def main [