blob: 7f8472d04225634953acea38eee3d931b96eb2c1 (
plain) (
tree)
|
|
L81" class="LineNr"> 81 </span><span class="Normal">void</span> <a href='002test.cc.html#L81'>run_test</a><span class="Delimiter">(</span><span class="Normal">size_t</span> i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
<span id="L82" class="LineNr"> 82 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>i >= <span class="Normal">sizeof</span><span class="Delimiter">(</span><span class="Special"><a href='002test.cc.html#L15'>Tests</a></span><span class="Delimiter">)</span>/<span class="Normal">sizeof</span><span class="Delimiter">(</span><span class="Special"><a href='002test.cc.html#L15'>Tests</a></span>[<span class="Constant">0</span>]<span class="Delimiter">))</span> <span class="Delimiter">{</span>
<span id="L83" class="LineNr"> 83 </span> cerr << <span class="Constant">"no test "</span> << i << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span>
<span id="L84" class="LineNr"> 84 </span> <span class="Identifier">return</span><span class="Delimiter">;</span>
<span id="L85" class="LineNr"> 85 </span> <span class="Delimiter">}</span>
<span id="L86" class="LineNr"> 86 </span> <a href='000organization.cc.html#L150'>reset</a><span class="Delimiter">();</span>
<span id="L87" class="LineNr"> 87 </span> <span class="Comment">// End Test Setup</span>
<span id="L88" class="LineNr"> 88 </span> <span class="Delimiter">(</span>*<span class="Special"><a href='002test.cc.html#L15'>Tests</a></span>[i]<span class="Delimiter">)();</span>
<span id="L89" class="LineNr"> 89 </span> <span class="Comment">// End Test Teardown</span>
<span id="L90" class="LineNr"> 90 </span><span class="Delimiter">}</span>
<span id="L91" class="LineNr"> 91 </span>
<span id="L92" class="LineNr"> 92 </span><span class="Comment">//: Convenience: run a single test</span>
<span id="L93" class="LineNr"> 93 </span><span class="Delimiter">:(before "Globals")</span>
<span id="L94" class="LineNr"> 94 </span><span class="Comment">// Names for each element of the 'Tests' global, respectively.</span>
<span id="L95" class="LineNr"> 95 </span><span class="Normal">const</span> string <span class="Special"><a href='002test.cc.html#L95'>Test_names</a></span>[] = <span class="Delimiter">{</span>
<span id="L96" class="LineNr"> 96 </span> <span class="PreProc">#include </span><span class="Constant">"test_name_list"</span> <span class="Comment">// auto-generated; see 'build*' scripts</span>
<span id="L97" class="LineNr"> 97 </span><span class="Delimiter">};</span>
<span id="L98" class="LineNr"> 98 </span><span class="Delimiter">:(after "Test Runs")</span>
<span id="L99" class="LineNr"> 99 </span>string <a href='002test.cc.html#L99'>maybe_single_test_to_run</a> = argv[argc-<span class="Constant">1</span>]<span class="Delimiter">;</span>
<span id="L100" class="LineNr">100 </span><span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">size_t</span> i=<span class="Constant">0</span><span class="Delimiter">;</span> i < <span class="Normal">sizeof</span><span class="Delimiter">(</span><span class="Special"><a href='002test.cc.html#L15'>Tests</a></span><span class="Delimiter">)</span>/<span class="Normal">sizeof</span><span class="Delimiter">(</span><span class="Special"><a href='002test.cc.html#L15'>Tests</a></span>[<span class="Constant">0</span>]<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
<span id="L101" class="LineNr">101 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><span class="Special"><a href='002test.cc.html#L95'>Test_names</a></span>[i] == <a href='002test.cc.html#L99'>maybe_single_test_to_run</a><span class="Delimiter">)</span> <span class="Delimiter">{</span>
<span id="L102" class="LineNr">102 </span> <a href='002test.cc.html#L81'>run_test</a><span class="Delimiter">(</span>i<span class="Delimiter">);</span>
<span id="L103" class="LineNr">103 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><span class="Special"><a href='002test.cc.html#L21'>Passed</a></span><span class="Delimiter">)</span> cerr << <span class="Constant">".\n"</span><span class="Delimiter">;</span>
<span id="L104" class="LineNr">104 </span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span>
<span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span>
<span id="L106" class="LineNr">106 </span><span class="Delimiter">}</span>
<span id="L107" class="LineNr">107 </span>
<span id="L108" class="LineNr">108 </span><span class="Delimiter">:(before "End Includes")</span>
<span id="L109" class="LineNr">109 </span><span class="PreProc">#include </span><span class="Constant"><stdlib.h></span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->
|