about summary refs log tree commit diff stats
path: root/cpp/013run
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-08 01:02:42 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-08 01:02:42 -0700
commit96f19e1e57c9d8508c7003aa4de4a87d0c7239c3 (patch)
treef4030c20c24202fd814b9a1ee04d507cd7b07c9c /cpp/013run
parente38c85a1eb6a0107ed43d7d7dbc9f4080a917c59 (diff)
downloadmu-96f19e1e57c9d8508c7003aa4de4a87d0c7239c3.tar.gz
1038 - clean up layer organization a little
Things are quite intricate to avoid reloading all recipes before every
test. But mu wasn't really intended to sidestep intrinsic intricacy.
Diffstat (limited to 'cpp/013run')
-rw-r--r--cpp/013run21
1 files changed, 6 insertions, 15 deletions
diff --git a/cpp/013run b/cpp/013run
index 1ccbb3b3..134df75a 100644
--- a/cpp/013run
+++ b/cpp/013run
@@ -108,28 +108,19 @@ void load(string filename) {
   fin.close();
 }
 
-//: helper for tests
+//: On startup, load everything in core.mu
+:(before "End Load Recipes")
+load("core.mu");
+recently_added_recipes.clear();  // Freeze everything so it doesn't get cleared by tests.
 
-:(before "End Globals")
-// track recipes added so that we can cleanup after each test
-vector<recipe_number> recipes_added_by_test;
+//: helper for tests
 
 :(code)
 void run(string form) {
   vector<recipe_number> tmp = add_recipes(form);
-  recipes_added_by_test.insert(recipes_added_by_test.end(), tmp.begin(), tmp.end());
   transform_all();
-  run(recipes_added_by_test.front());
-}
-
-:(before "End Setup")
-for (size_t i = 0; i < recipes_added_by_test.size(); ++i) {
-//?   cout << "AAA clearing " << Recipe[recipes_added_by_test[i]].name << '\n'; //? 2
-  Recipe_number.erase(Recipe[recipes_added_by_test[i]].name);
-  Recipe.erase(recipes_added_by_test[i]);
+  run(tmp.front());
 }
-// Clear state for recipes_added_by_test
-recipes_added_by_test.clear();
 
 :(code)
 vector<int> read_memory(reagent x) {