about summary refs log tree commit diff stats
path: root/055shape_shifting_container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-05 09:30:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-05 09:30:56 -0700
commit4ea9905f00b473ea58a8acd7b4240ea35cd5f330 (patch)
tree05a43a630da8acc0f839723865aa8e2ab4ef257c /055shape_shifting_container.cc
parentdb7d6e063a4729ce06269013f839892d7169e396 (diff)
downloadmu-4ea9905f00b473ea58a8acd7b4240ea35cd5f330.tar.gz
3297 - run unit tests before scenarios
I've been putting up for some time with the tension between wanting to
show scenarios at the top of the layer even if I want to *run* any unit
tests of sub-components introduced within the layer before them. Turned
out to be an easy fix.

We don't have very many of these, and the unit tests in the early layers
don't compete with any scenarios, so I don't need to mess with them. But
this is a key tool in my toolkit, to be able to decouple presentation
order from run order for tests.

Though now the separate compilation units are again unbalanced; sigh.
Diffstat (limited to '055shape_shifting_container.cc')
-rw-r--r--055shape_shifting_container.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/055shape_shifting_container.cc b/055shape_shifting_container.cc
index 60774926..4db3efaa 100644
--- a/055shape_shifting_container.cc
+++ b/055shape_shifting_container.cc
@@ -1,6 +1,7 @@
 //:: Container definitions can contain 'type ingredients'
 
 :(scenario size_of_shape_shifting_container)
+% cerr << "S1\n";
 container foo:_t [
   x:_t
   y:number
@@ -16,6 +17,7 @@ def main [
 +mem: storing 16 in location 5
 
 :(scenario size_of_shape_shifting_container_2)
+% cerr << "S2\n";
 # multiple type ingredients
 container foo:_a:_b [
   x:_a
@@ -27,6 +29,7 @@ def main [
 $error: 0
 
 :(scenario size_of_shape_shifting_container_3)
+% cerr << "S3\n";
 container foo:_a:_b [
   x:_a
   y:_b
@@ -39,6 +42,7 @@ def main [
 $error: 0
 
 :(scenario size_of_shape_shifting_container_4)
+% cerr << "S4\n";
 container foo:_a:_b [
   x:_a
   y:_b
@@ -54,6 +58,7 @@ def main [
 $error: 0
 
 :(scenario shape_shifting_container_extend)
+% cerr << "S5\n";
 container foo:_a [
   x:_a
 ]
@@ -63,6 +68,7 @@ container foo:_a [
 $error: 0
 
 :(scenario shape_shifting_container_extend_error)
+% cerr << "S6\n";
 % Hide_errors = true;
 container foo:_a [
   x:_a
@@ -73,6 +79,7 @@ container foo:_b [
 +error: headers of container 'foo' must use identical type ingredients
 
 :(scenario type_ingredient_must_start_with_underscore)
+% cerr << "S7\n";
 % Hide_errors = true;
 container foo:t [
   x:number
@@ -364,7 +371,9 @@ bool final_type_ingredient(int type_ingredient_index, const type_info& container
   return true;
 }
 
+:(before "End Unit Tests")
 void test_replace_type_ingredients_entire() {
+  cerr << "U1\n";
   run("container foo:_elem [\n"
       "  x:_elem\n"
       "  y:number\n"
@@ -377,6 +386,7 @@ void test_replace_type_ingredients_entire() {
 }
 
 void test_replace_type_ingredients_tail() {
+  cerr << "U2\n";
   run("container foo:_elem [\n"
       "  x:_elem\n"
       "]\n"
@@ -392,6 +402,7 @@ void test_replace_type_ingredients_tail() {
 }
 
 void test_replace_type_ingredients_head_tail_multiple() {
+  cerr << "U3\n";
   run("container foo:_elem [\n"
       "  x:_elem\n"
       "]\n"
@@ -409,6 +420,7 @@ void test_replace_type_ingredients_head_tail_multiple() {
 }
 
 void test_replace_type_ingredients_head_middle() {
+  cerr << "U4\n";
   run("container foo:_elem [\n"
       "  x:_elem\n"
       "]\n"
@@ -428,6 +440,7 @@ void test_replace_type_ingredients_head_middle() {
 }
 
 void test_replace_last_type_ingredient_with_multiple() {
+  cerr << "U5\n";
   run("container foo:_a:_b [\n"
       "  x:_a\n"
       "  y:_b\n"
@@ -446,6 +459,7 @@ void test_replace_last_type_ingredient_with_multiple() {
 }
 
 void test_replace_middle_type_ingredient_with_multiple() {
+  cerr << "U6\n";
   run("container foo:_a:_b:_c [\n"
       "  x:_a\n"
       "  y:_b\n"
@@ -469,6 +483,7 @@ void test_replace_middle_type_ingredient_with_multiple() {
 }
 
 void test_replace_middle_type_ingredient_with_multiple2() {
+  cerr << "U7\n";
   run("container foo:_key:_value [\n"
       "  key:_key\n"
       "  value:_value\n"
@@ -483,6 +498,7 @@ void test_replace_middle_type_ingredient_with_multiple2() {
 }
 
 void test_replace_middle_type_ingredient_with_multiple3() {
+  cerr << "U8\n";
   run("container foo_table:_key:_value [\n"
       "  data:address:array:foo_table_row:_key:_value\n"
       "]\n"
@@ -505,6 +521,7 @@ void test_replace_middle_type_ingredient_with_multiple3() {
   CHECK(!element.type->right->right->right->right->right);
 }
 
+:(code)
 bool has_nth_type(const type_tree* base, int n) {
   assert(n >= 0);
   if (!base) return false;