<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Scott Madin]]></provider_name><provider_url><![CDATA[http://smadin.net]]></provider_url><author_name><![CDATA[Scott Madin]]></author_name><author_url><![CDATA[https://smadin.net/author/smadin/]]></author_url><title><![CDATA[Scuttle: pre-update update]]></title><type><![CDATA[link]]></type><html><![CDATA[
<p class="has-drop-cap">Scuttle is now working as intended for the standard use case. As described in the <a href="https://smadin.net/2020/12/07/new-project-scuttle/">introductory post</a>, for a C project with a standard layout, adding unit testing with Scuttle requires the following steps:</p>



<ol><li>Install <code>scuttle.h</code> either locally to the project or in the system include path</li><li>Install <code>scuttle.sh</code> either locally to the project or somewhere on your <code>$PATH</code></li><li>Add test suite source files under <code>test/</code>, each corresponding to a module of your project, named <code>test_&lt;module&gt;.c</code>, using Scuttle&#8217;s simple macros</li><li>Add a <code>test</code> target to your main <code>Makefile</code> as follows:</li></ol>



<pre class="wp-block-code"><code>test:
    bash scuttle.sh test
    $(MAKE) -C test</code></pre>



<p>Scuttle will generate <code>test/Makefile</code>, <code>test/test_&lt;module&gt;.h</code> and <code>test/test_&lt;module&gt;_gen.h</code> for each <code>test/test_&lt;module&gt;.c</code> suite, and the <code>test/test_&lt;project&gt;.c</code> harness; and the generated Makefile&#8217;s <code>test</code> target will build and run the test harness and pipe the output to <code>test/log/test_&lt;project&gt;.log</code>.</p>



<p>There&#8217;s a lot of room to make this more flexible and add some convenience features, but in terms of functionality it&#8217;s at MVP level now.</p>



<p>Tomorrow I&#8217;ll do a quick cleanup pass, make a few small tweaks I&#8217;ve already thought of, write some basic documentation, and actually push the code up to a public repo so if anyone&#8217;s interested in trying it out, it&#8217;ll be available.</p>
]]></html></oembed>