about summary refs log tree commit diff stats
path: root/html/050scenario.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-06-09 15:54:26 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-06-09 15:54:26 -0700
commitbd5d3936ec77e0ec42d6f9d99d377d807e9892f8 (patch)
tree1ed27754e58d345070ef5cb5ee7404592bf31d7a /html/050scenario.cc.html
parent6d12a8c4ebe25527c92a934702e2628ce8c4bd4c (diff)
downloadmu-bd5d3936ec77e0ec42d6f9d99d377d807e9892f8.tar.gz
3903 - minimal render when pressing 'tab'
Turns out all I had to do was reset `go-render?` to false.
Diffstat (limited to 'html/050scenario.cc.html')
-rw-r--r--html/050scenario.cc.html200
1 files changed, 141 insertions, 59 deletions
diff --git a/html/050scenario.cc.html b/html/050scenario.cc.html
index db055536..bf33177f 100644
--- a/html/050scenario.cc.html
+++ b/html/050scenario.cc.html
@@ -858,66 +858,148 @@ if ('onhashchange' in window) {
 <span id="L791" class="LineNr">791 </span>  <span class="Identifier">break</span><span class="Delimiter">;</span>
 <span id="L792" class="LineNr">792 </span><span class="Delimiter">}</span>
 <span id="L793" class="LineNr">793 </span>
-<span id="L794" class="LineNr">794 </span><span class="Delimiter">:(scenario trace_count_check_2)</span>
-<span id="L795" class="LineNr">795 </span><span class="Special">% Scenario_testing_scenario = true;</span>
-<span id="L796" class="LineNr">796 </span><span class="Special">% Hide_errors = true;</span>
-<span id="L797" class="LineNr">797 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [
-<span id="L798" class="LineNr">798 </span>  run [
-<span id="L799" class="LineNr">799 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo]
-<span id="L800" class="LineNr">800 </span>  ]
-<span id="L801" class="LineNr">801 </span>  check-trace-count-<span class="Normal">for</span>-label <span class="Constant">2</span><span class="Delimiter">,</span> [a]
-<span id="L802" class="LineNr">802 </span>]
-<span id="L803" class="LineNr">803 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: expected 2 lines in <a href='003trace.cc.html#L161'>trace</a> with label 'a' in <a href='003trace.cc.html#L161'>trace</a></span>
-<span id="L804" class="LineNr">804 </span>
-<span id="L805" class="LineNr">805 </span><span class="Comment">//: Minor detail: ignore 'system' calls in scenarios, since anything we do</span>
-<span id="L806" class="LineNr">806 </span><span class="Comment">//: with them is by definition impossible to test through Mu.</span>
-<span id="L807" class="LineNr">807 </span><span class="Delimiter">:(after &quot;case _SYSTEM:&quot;)</span>
-<span id="L808" class="LineNr">808 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
-<span id="L809" class="LineNr">809 </span>
-<span id="L810" class="LineNr">810 </span><span class="SalientComment">//:: Warn if people use '_' manually in function names. They're reserved for internal use.</span>
-<span id="L811" class="LineNr">811 </span>
-<span id="L812" class="LineNr">812 </span><span class="Delimiter">:(scenario recipe_name_with_underscore)</span>
-<span id="L813" class="LineNr">813 </span><span class="Special">% Hide_errors = true;</span>
-<span id="L814" class="LineNr">814 </span><span class="muRecipe">def</span> foo_bar [
-<span id="L815" class="LineNr">815 </span>]
-<span id="L816" class="LineNr">816 </span><span class="traceContains">+error: foo_bar: don't create recipes with '_' in the name</span>
-<span id="L817" class="LineNr">817 </span>
-<span id="L818" class="LineNr">818 </span><span class="Delimiter">:(before &quot;End <a href='010vm.cc.html#L19'>recipe</a> Fields&quot;)</span>
-<span id="L819" class="LineNr">819 </span><span class="Normal">bool</span> is_autogenerated<span class="Delimiter">;</span>
-<span id="L820" class="LineNr">820 </span><span class="Delimiter">:(before &quot;End <a href='010vm.cc.html#L19'>recipe</a> Constructor&quot;)</span>
-<span id="L821" class="LineNr">821 </span>is_autogenerated = <span class="Constant">false</span><span class="Delimiter">;</span>
-<span id="L822" class="LineNr">822 </span><span class="Delimiter">:(code)</span>
-<span id="L823" class="LineNr">823 </span><span class="Normal">void</span> mark_autogenerated<span class="Delimiter">(</span><a href='010vm.cc.html#L14'>recipe_ordinal</a> r<span class="Delimiter">)</span> <span class="Delimiter">{</span>
-<span id="L824" class="LineNr">824 </span>  get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>is_autogenerated = <span class="Constant">true</span><span class="Delimiter">;</span>
-<span id="L825" class="LineNr">825 </span><span class="Delimiter">}</span>
-<span id="L826" class="LineNr">826 </span>
-<span id="L827" class="LineNr">827 </span><span class="Delimiter">:(after &quot;void transform_all()&quot;)</span>
-<span id="L828" class="LineNr">828 </span>  <span class="Normal">for</span> <span class="Delimiter">(</span>map&lt;recipe_ordinal<span class="Delimiter">,</span> recipe&gt;::iterator p = Recipe<span class="Delimiter">.</span>begin<span class="Delimiter">();</span>  p != Recipe<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>  ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span>
-<span id="L829" class="LineNr">829 </span>  <span class="Conceal">¦</span> <span class="Normal">const</span> recipe&amp; r = p<span class="Delimiter">-&gt;</span>second<span class="Delimiter">;</span>
-<span id="L830" class="LineNr">830 </span>  <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>name<span class="Delimiter">.</span>find<span class="Delimiter">(</span><span class="Constant">'_'</span><span class="Delimiter">)</span> == string::npos<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>
-<span id="L831" class="LineNr">831 </span>  <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>is_autogenerated<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>  <span class="Comment">// created by previous call to transform_all()</span>
-<span id="L832" class="LineNr">832 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; r<span class="Delimiter">.</span>name &lt;&lt; <span class="Constant">&quot;: don't create recipes with '_' in the name</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
-<span id="L833" class="LineNr">833 </span>  <span class="Delimiter">}</span>
+<span id="L794" class="LineNr">794 </span><span class="Delimiter">:(before &quot;End Primitive Recipe Declarations&quot;)</span>
+<span id="L795" class="LineNr">795 </span>CHECK_TRACE_COUNT_FOR_LABEL_GREATER_THAN<span class="Delimiter">,</span>
+<span id="L796" class="LineNr">796 </span><span class="Delimiter">:(before &quot;End Primitive Recipe Numbers&quot;)</span>
+<span id="L797" class="LineNr">797 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">&quot;check-trace-count-for-label-greater-than&quot;</span><span class="Delimiter">,</span> CHECK_TRACE_COUNT_FOR_LABEL_GREATER_THAN<span class="Delimiter">);</span>
+<span id="L798" class="LineNr">798 </span><span class="Delimiter">:(before &quot;End Primitive Recipe Checks&quot;)</span>
+<span id="L799" class="LineNr">799 </span><span class="Normal">case</span> CHECK_TRACE_COUNT_FOR_LABEL_GREATER_THAN: <span class="Delimiter">{</span>
+<span id="L800" class="LineNr">800 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L801" class="LineNr">801 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;'check-trace-count-for-label' requires exactly two ingredients, but got '&quot;</span> &lt;&lt; to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L802" class="LineNr">802 </span>  <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L803" class="LineNr">803 </span>  <span class="Delimiter">}</span>
+<span id="L804" class="LineNr">804 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_number<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span>
+<span id="L805" class="LineNr">805 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;first ingredient of 'check-trace-count-for-label' should be a number (count), but got '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L806" class="LineNr">806 </span>  <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L807" class="LineNr">807 </span>  <span class="Delimiter">}</span>
+<span id="L808" class="LineNr">808 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>!is_literal_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span>
+<span id="L809" class="LineNr">809 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;second ingredient of 'check-trace-count-for-label' should be a literal string (label), but got '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L810" class="LineNr">810 </span>  <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L811" class="LineNr">811 </span>  <span class="Delimiter">}</span>
+<span id="L812" class="LineNr">812 </span>  <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L813" class="LineNr">813 </span><span class="Delimiter">}</span>
+<span id="L814" class="LineNr">814 </span><span class="Delimiter">:(before &quot;End Primitive Recipe Implementations&quot;)</span>
+<span id="L815" class="LineNr">815 </span><span class="Normal">case</span> CHECK_TRACE_COUNT_FOR_LABEL_GREATER_THAN: <span class="Delimiter">{</span>
+<span id="L816" class="LineNr">816 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>!Passed<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L817" class="LineNr">817 </span>  <span class="Normal">int</span> expected_count = ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span>
+<span id="L818" class="LineNr">818 </span>  string label = <a href='026call.cc.html#L85'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name<span class="Delimiter">;</span>
+<span id="L819" class="LineNr">819 </span>  <span class="Normal">int</span> count = trace_count<span class="Delimiter">(</span>label<span class="Delimiter">);</span>
+<span id="L820" class="LineNr">820 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>count &lt;= expected_count<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L821" class="LineNr">821 </span>  <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario &amp;&amp; !Scenario_testing_scenario<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L822" class="LineNr">822 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// genuine test in a .mu file</span>
+<span id="L823" class="LineNr">823 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <span class="Constant">&quot;</span><span class="cSpecial">\n</span><span class="Constant">F - &quot;</span> &lt;&lt; Current_scenario<span class="Delimiter">-&gt;</span>name &lt;&lt; <span class="Constant">&quot;: &quot;</span> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_recipe_name</a><span class="Delimiter">())</span> &lt;&lt; <span class="Constant">&quot;expected more than &quot;</span> &lt;&lt; expected_count &lt;&lt; <span class="Constant">&quot; lines in <a href='003trace.cc.html#L161'>trace</a> with label '&quot;</span> &lt;&lt; label &lt;&lt; <span class="Constant">&quot;' in <a href='003trace.cc.html#L161'>trace</a>: &quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L824" class="LineNr">824 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L165'>DUMP</a><span class="Delimiter">(</span>label<span class="Delimiter">);</span>
+<span id="L825" class="LineNr">825 </span>  <span class="Conceal">¦</span> <span class="Delimiter">}</span>
+<span id="L826" class="LineNr">826 </span>  <span class="Conceal">¦</span> <span class="Normal">else</span> <span class="Delimiter">{</span>
+<span id="L827" class="LineNr">827 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// just testing scenario support</span>
+<span id="L828" class="LineNr">828 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_recipe_name</a><span class="Delimiter">())</span> &lt;&lt; <span class="Constant">&quot;expected more than &quot;</span> &lt;&lt; expected_count &lt;&lt; <span class="Constant">&quot; lines in <a href='003trace.cc.html#L161'>trace</a> with label '&quot;</span> &lt;&lt; label &lt;&lt; <span class="Constant">&quot;' in <a href='003trace.cc.html#L161'>trace</a></span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L829" class="LineNr">829 </span>  <span class="Conceal">¦</span> <span class="Delimiter">}</span>
+<span id="L830" class="LineNr">830 </span>  <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span>
+<span id="L831" class="LineNr">831 </span>  <span class="Delimiter">}</span>
+<span id="L832" class="LineNr">832 </span>  <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L833" class="LineNr">833 </span><span class="Delimiter">}</span>
 <span id="L834" class="LineNr">834 </span>
-<span id="L835" class="LineNr">835 </span><span class="SalientComment">//:: Helpers</span>
-<span id="L836" class="LineNr">836 </span>
-<span id="L837" class="LineNr">837 </span><span class="Delimiter">:(code)</span>
-<span id="L838" class="LineNr">838 </span><span class="Comment">// just for the scenarios running scenarios in C++ layers</span>
-<span id="L839" class="LineNr">839 </span><span class="Normal">void</span> run_mu_scenario<span class="Delimiter">(</span><span class="Normal">const</span> string&amp; form<span class="Delimiter">)</span> <span class="Delimiter">{</span>
-<span id="L840" class="LineNr">840 </span>  Scenario_names<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span>
-<span id="L841" class="LineNr">841 </span>  istringstream in<span class="Delimiter">(</span>form<span class="Delimiter">);</span>
-<span id="L842" class="LineNr">842 </span>  in &gt;&gt; std::noskipws<span class="Delimiter">;</span>
-<span id="L843" class="LineNr">843 </span>  <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span>
-<span id="L844" class="LineNr">844 </span>  string _scenario = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span>
-<span id="L845" class="LineNr">845 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>_scenario<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span>
-<span id="L846" class="LineNr">846 </span>  <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span>
-<span id="L847" class="LineNr">847 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <span class="Constant">&quot;no <a href='050scenario.cc.html#L57'>scenario</a> in string passed into run_mu_scenario()</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
-<span id="L848" class="LineNr">848 </span>  <span class="Conceal">¦</span> <span class="Identifier">return</span><span class="Delimiter">;</span>
-<span id="L849" class="LineNr">849 </span>  <span class="Delimiter">}</span>
-<span id="L850" class="LineNr">850 </span>  assert<span class="Delimiter">(</span>_scenario == <span class="Constant">&quot;scenario&quot;</span><span class="Delimiter">);</span>
-<span id="L851" class="LineNr">851 </span>  <a href='050scenario.cc.html#L57'>scenario</a> s = <a href='050scenario.cc.html#L91'>parse_scenario</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span>
-<span id="L852" class="LineNr">852 </span>  run_mu_scenario<span class="Delimiter">(</span>s<span class="Delimiter">);</span>
-<span id="L853" class="LineNr">853 </span><span class="Delimiter">}</span>
+<span id="L835" class="LineNr">835 </span><span class="Delimiter">:(before &quot;End Primitive Recipe Declarations&quot;)</span>
+<span id="L836" class="LineNr">836 </span>CHECK_TRACE_COUNT_FOR_LABEL_LESSER_THAN<span class="Delimiter">,</span>
+<span id="L837" class="LineNr">837 </span><span class="Delimiter">:(before &quot;End Primitive Recipe Numbers&quot;)</span>
+<span id="L838" class="LineNr">838 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">&quot;check-trace-count-for-label-lesser-than&quot;</span><span class="Delimiter">,</span> CHECK_TRACE_COUNT_FOR_LABEL_LESSER_THAN<span class="Delimiter">);</span>
+<span id="L839" class="LineNr">839 </span><span class="Delimiter">:(before &quot;End Primitive Recipe Checks&quot;)</span>
+<span id="L840" class="LineNr">840 </span><span class="Normal">case</span> CHECK_TRACE_COUNT_FOR_LABEL_LESSER_THAN: <span class="Delimiter">{</span>
+<span id="L841" class="LineNr">841 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L842" class="LineNr">842 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;'check-trace-count-for-label' requires exactly two ingredients, but got '&quot;</span> &lt;&lt; to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L843" class="LineNr">843 </span>  <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L844" class="LineNr">844 </span>  <span class="Delimiter">}</span>
+<span id="L845" class="LineNr">845 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_number<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span>
+<span id="L846" class="LineNr">846 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;first ingredient of 'check-trace-count-for-label' should be a number (count), but got '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L847" class="LineNr">847 </span>  <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L848" class="LineNr">848 </span>  <span class="Delimiter">}</span>
+<span id="L849" class="LineNr">849 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>!is_literal_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span>
+<span id="L850" class="LineNr">850 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;second ingredient of 'check-trace-count-for-label' should be a literal string (label), but got '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L851" class="LineNr">851 </span>  <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L852" class="LineNr">852 </span>  <span class="Delimiter">}</span>
+<span id="L853" class="LineNr">853 </span>  <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L854" class="LineNr">854 </span><span class="Delimiter">}</span>
+<span id="L855" class="LineNr">855 </span><span class="Delimiter">:(before &quot;End Primitive Recipe Implementations&quot;)</span>
+<span id="L856" class="LineNr">856 </span><span class="Normal">case</span> CHECK_TRACE_COUNT_FOR_LABEL_LESSER_THAN: <span class="Delimiter">{</span>
+<span id="L857" class="LineNr">857 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>!Passed<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L858" class="LineNr">858 </span>  <span class="Normal">int</span> expected_count = ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span>
+<span id="L859" class="LineNr">859 </span>  string label = <a href='026call.cc.html#L85'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name<span class="Delimiter">;</span>
+<span id="L860" class="LineNr">860 </span>  <span class="Normal">int</span> count = trace_count<span class="Delimiter">(</span>label<span class="Delimiter">);</span>
+<span id="L861" class="LineNr">861 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>count &gt;= expected_count<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L862" class="LineNr">862 </span>  <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario &amp;&amp; !Scenario_testing_scenario<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L863" class="LineNr">863 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// genuine test in a .mu file</span>
+<span id="L864" class="LineNr">864 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <span class="Constant">&quot;</span><span class="cSpecial">\n</span><span class="Constant">F - &quot;</span> &lt;&lt; Current_scenario<span class="Delimiter">-&gt;</span>name &lt;&lt; <span class="Constant">&quot;: &quot;</span> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_recipe_name</a><span class="Delimiter">())</span> &lt;&lt; <span class="Constant">&quot;expected less than&quot;</span> &lt;&lt; expected_count &lt;&lt; <span class="Constant">&quot; lines in <a href='003trace.cc.html#L161'>trace</a> with label '&quot;</span> &lt;&lt; label &lt;&lt; <span class="Constant">&quot;' in <a href='003trace.cc.html#L161'>trace</a>: &quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L865" class="LineNr">865 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L165'>DUMP</a><span class="Delimiter">(</span>label<span class="Delimiter">);</span>
+<span id="L866" class="LineNr">866 </span>  <span class="Conceal">¦</span> <span class="Delimiter">}</span>
+<span id="L867" class="LineNr">867 </span>  <span class="Conceal">¦</span> <span class="Normal">else</span> <span class="Delimiter">{</span>
+<span id="L868" class="LineNr">868 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// just testing scenario support</span>
+<span id="L869" class="LineNr">869 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_recipe_name</a><span class="Delimiter">())</span> &lt;&lt; <span class="Constant">&quot;expected less than &quot;</span> &lt;&lt; expected_count &lt;&lt; <span class="Constant">&quot; lines in <a href='003trace.cc.html#L161'>trace</a> with label '&quot;</span> &lt;&lt; label &lt;&lt; <span class="Constant">&quot;' in <a href='003trace.cc.html#L161'>trace</a></span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L870" class="LineNr">870 </span>  <span class="Conceal">¦</span> <span class="Delimiter">}</span>
+<span id="L871" class="LineNr">871 </span>  <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span>
+<span id="L872" class="LineNr">872 </span>  <span class="Delimiter">}</span>
+<span id="L873" class="LineNr">873 </span>  <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L874" class="LineNr">874 </span><span class="Delimiter">}</span>
+<span id="L875" class="LineNr">875 </span>
+<span id="L876" class="LineNr">876 </span><span class="Delimiter">:(scenario trace_count_check_2)</span>
+<span id="L877" class="LineNr">877 </span><span class="Special">% Scenario_testing_scenario = true;</span>
+<span id="L878" class="LineNr">878 </span><span class="Special">% Hide_errors = true;</span>
+<span id="L879" class="LineNr">879 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [
+<span id="L880" class="LineNr">880 </span>  run [
+<span id="L881" class="LineNr">881 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo]
+<span id="L882" class="LineNr">882 </span>  ]
+<span id="L883" class="LineNr">883 </span>  check-trace-count-<span class="Normal">for</span>-label <span class="Constant">2</span><span class="Delimiter">,</span> [a]
+<span id="L884" class="LineNr">884 </span>]
+<span id="L885" class="LineNr">885 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: expected 2 lines in <a href='003trace.cc.html#L161'>trace</a> with label 'a' in <a href='003trace.cc.html#L161'>trace</a></span>
+<span id="L886" class="LineNr">886 </span>
+<span id="L887" class="LineNr">887 </span><span class="Comment">//: Minor detail: ignore 'system' calls in scenarios, since anything we do</span>
+<span id="L888" class="LineNr">888 </span><span class="Comment">//: with them is by definition impossible to test through Mu.</span>
+<span id="L889" class="LineNr">889 </span><span class="Delimiter">:(after &quot;case _SYSTEM:&quot;)</span>
+<span id="L890" class="LineNr">890 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+<span id="L891" class="LineNr">891 </span>
+<span id="L892" class="LineNr">892 </span><span class="SalientComment">//:: Warn if people use '_' manually in function names. They're reserved for internal use.</span>
+<span id="L893" class="LineNr">893 </span>
+<span id="L894" class="LineNr">894 </span><span class="Delimiter">:(scenario recipe_name_with_underscore)</span>
+<span id="L895" class="LineNr">895 </span><span class="Special">% Hide_errors = true;</span>
+<span id="L896" class="LineNr">896 </span><span class="muRecipe">def</span> foo_bar [
+<span id="L897" class="LineNr">897 </span>]
+<span id="L898" class="LineNr">898 </span><span class="traceContains">+error: foo_bar: don't create recipes with '_' in the name</span>
+<span id="L899" class="LineNr">899 </span>
+<span id="L900" class="LineNr">900 </span><span class="Delimiter">:(before &quot;End <a href='010vm.cc.html#L19'>recipe</a> Fields&quot;)</span>
+<span id="L901" class="LineNr">901 </span><span class="Normal">bool</span> is_autogenerated<span class="Delimiter">;</span>
+<span id="L902" class="LineNr">902 </span><span class="Delimiter">:(before &quot;End <a href='010vm.cc.html#L19'>recipe</a> Constructor&quot;)</span>
+<span id="L903" class="LineNr">903 </span>is_autogenerated = <span class="Constant">false</span><span class="Delimiter">;</span>
+<span id="L904" class="LineNr">904 </span><span class="Delimiter">:(code)</span>
+<span id="L905" class="LineNr">905 </span><span class="Normal">void</span> mark_autogenerated<span class="Delimiter">(</span><a href='010vm.cc.html#L14'>recipe_ordinal</a> r<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L906" class="LineNr">906 </span>  get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>is_autogenerated = <span class="Constant">true</span><span class="Delimiter">;</span>
+<span id="L907" class="LineNr">907 </span><span class="Delimiter">}</span>
+<span id="L908" class="LineNr">908 </span>
+<span id="L909" class="LineNr">909 </span><span class="Delimiter">:(after &quot;void transform_all()&quot;)</span>
+<span id="L910" class="LineNr">910 </span>  <span class="Normal">for</span> <span class="Delimiter">(</span>map&lt;recipe_ordinal<span class="Delimiter">,</span> recipe&gt;::iterator p = Recipe<span class="Delimiter">.</span>begin<span class="Delimiter">();</span>  p != Recipe<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>  ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L911" class="LineNr">911 </span>  <span class="Conceal">¦</span> <span class="Normal">const</span> recipe&amp; r = p<span class="Delimiter">-&gt;</span>second<span class="Delimiter">;</span>
+<span id="L912" class="LineNr">912 </span>  <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>name<span class="Delimiter">.</span>find<span class="Delimiter">(</span><span class="Constant">'_'</span><span class="Delimiter">)</span> == string::npos<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>
+<span id="L913" class="LineNr">913 </span>  <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>is_autogenerated<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>  <span class="Comment">// created by previous call to transform_all()</span>
+<span id="L914" class="LineNr">914 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; r<span class="Delimiter">.</span>name &lt;&lt; <span class="Constant">&quot;: don't create recipes with '_' in the name</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
+<span id="L915" class="LineNr">915 </span>  <span class="Delimiter">}</span>
+<span id="L916" class="LineNr">916 </span>
+<span id="L917" class="LineNr">917 </span><span class="SalientComment">//:: Helpers</span>
+<span id="L918" class="LineNr">918 </span>
+<span id="L919" class="LineNr">919 </span><span class="Delimiter">:(code)</span>
+<span id="L920" class="LineNr">920 </span><span class="Comment">// just for the scenarios running scenarios in C++ layers</span>
+<span id="L921" class="LineNr">921 </span><span class="Normal">void</span> run_mu_scenario<span class="Delimiter">(</span><span class="Normal">const</span> string&amp; form<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L922" class="LineNr">922 </span>  Scenario_names<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span>
+<span id="L923" class="LineNr">923 </span>  istringstream in<span class="Delimiter">(</span>form<span class="Delimiter">);</span>
+<span id="L924" class="LineNr">924 </span>  in &gt;&gt; std::noskipws<span class="Delimiter">;</span>
+<span id="L925" class="LineNr">925 </span>  <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span>
+<span id="L926" class="LineNr">926 </span>  string _scenario = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span>
+<span id="L927" class="LineNr">927 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>_scenario<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span>
+<span id="L928" class="LineNr">928 </span>  <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span>
+<span id="L929" class="LineNr">929 </span>  <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <span class="Constant">&quot;no <a href='050scenario.cc.html#L57'>scenario</a> in string passed into run_mu_scenario()</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
+<span id="L930" class="LineNr">930 </span>  <span class="Conceal">¦</span> <span class="Identifier">return</span><span class="Delimiter">;</span>
+<span id="L931" class="LineNr">931 </span>  <span class="Delimiter">}</span>
+<span id="L932" class="LineNr">932 </span>  assert<span class="Delimiter">(</span>_scenario == <span class="Constant">&quot;scenario&quot;</span><span class="Delimiter">);</span>
+<span id="L933" class="LineNr">933 </span>  <a href='050scenario.cc.html#L57'>scenario</a> s = <a href='050scenario.cc.html#L91'>parse_scenario</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span>
+<span id="L934" class="LineNr">934 </span>  run_mu_scenario<span class="Delimiter">(</span>s<span class="Delimiter">);</span>
+<span id="L935" class="LineNr">935 </span><span class="Delimiter">}</span>
 </pre>
 </body>
 </html>