I don&#x27;t think it&#x27;s a big pain in python. I imagine ruby wouldn&#x27;t be terrible either:<p><pre><code>    #!&#x2F;usr&#x2F;bin&#x2F;env python

    import sys, os, subprocess, glob 

    os.chdir(os.path.dirname(sys.argv[0]))
    for test in glob.glob(&quot;*.in&quot;):
        test = os.path.splitext(test)[0]
        infile = test + &quot;.in&quot;
        outfile = test + &quot;.out&quot;
        output = subprocess.check_output([&quot;.&#x2F;whofrom&quot;, infile], stderr=subprocess.STDOUT)
        expected = open(outfile, &#x27;r&#x27;).read()
        if output != expected:
            print(&quot;Failed test&quot;, test)
        try:
            devnull = open(os.devnull, &#x27;w&#x27;)
            subprocess.check_call([&quot;valgrind&quot;, &quot;--error-exitcode=1&quot;, &quot;--leak-check=full&quot;, &quot;.&#x2F;whofrom&quot;, infile], stderr=devnull, stdout=devnull)
        except subprocess.CalledProcessError:
            print(&quot;Failed test&quot;, test)
            subprocess.check_call([&quot;valgrind&quot;, &quot;-q&quot;, &quot;--leak-check=full&quot;, &quot;.&#x2F;whofrom&quot;, infile])
</code></pre>
(since it&#x27;s a quick script, I&#x27;m ignoring stuff like closing files - they&#x27;ll get GCd on each iteration anyway)<p>Apart from the header, the whole script is pretty much the same when comparing line-by-line.