title: Dynamically generating rackunit test-suite: tests pass and also raise exception
body: <p>I am trying to dynamically generate a bunch of test cases.</p>
  <p>Basically I want to run the same tests several times with different values. Maybe there's a better way to do that, if so let me know, I haven't found it yet.</p>
  <p>I found <code>make-test-suite</code> which says you can pass it a list of <code>test-case</code> instances.</p>
  <p>So I made a <code>for/fold</code> loop which collects the test cases generated for each set of values into a flat list.</p>
  <p>What I don't understand is it seems to successfully run all the tests while also raising an exception:</p>
  <pre><code>tests-&gt;test-suite-action received #&lt;void&gt; in list of tests (#&lt;void&gt; #&lt;void&gt; #&lt;void&gt; #&lt;void&gt; #&lt;void&gt; #&lt;void&gt; #&lt;void&gt; #&lt;void&gt;), which is not a test.
    context...:
     /usr/share/racket/pkgs/rackunit-lib/rackunit/private/test-suite.rkt:139:7
     /usr/share/racket/pkgs/rackunit-lib/rackunit/private/test-suite.rkt:136:2
     /usr/share/racket/pkgs/rackunit-lib/rackunit/private/test-suite.rkt:61:0: apply-test-suite
     /usr/share/racket/pkgs/rackunit-lib/rackunit/text-ui.rkt:91:0: run-tests
     &quot;/write-thru-hash/tests.rkt&quot;: [running body]
     temp35_0
     for-loop
     run-module-instance!
     /usr/share/racket/pkgs/compiler-lib/compiler/commands/test.rkt:179:16
  
  ...
  
  1 1 write-thru-hash/tests.rkt
  8 tests passed
  rkt-write-thru-hash_tests_1 exited with code 1
  </code></pre>
  <p>I put a <code>writeln</code> in each of my test cases and I see those lines printed out where I abbreviated with <code>...</code> above. So I know the tests are actually running.</p>
  <p>(The tests also ran and worked fine before I multiplied them with the <code>for/fold</code> loop and just built them in the body of <code>test-suite</code>)</p>
  <p>My <code>tests.rkt</code> code looks like:</p>
  <pre><code>(define test-cases-list
    (for/fold ([test-cases (list)])
              ([db-type (list 'sqlite 'postgres)])
      (append test-cases
        (list
          (test-case/fixture &quot;basic operations&quot; ... )
          (test-case/fixture &quot;complex serializable keys and values&quot; ... )
          (test-case/fixture &quot;custom table-name&quot; ... )
          (test-case/fixture &quot;use initial src-hash&quot; ... )))))
  
  (define db-tests
    (make-test-suite &quot;db-tests&quot; test-cases-list))
  </code></pre>
  <p>(I'm using the <code>fixture</code> library <a href="https://docs.racket-lang.org/fixture/" rel="nofollow noreferrer">https://docs.racket-lang.org/fixture/</a>)</p>
  <p>UPDATE:</p>
  <p>Actually I think the <code>writeln</code> in my test cases are printing at definition time ... i.e. they are running too early because they are outside of the <code>test-suite</code> context.</p>
  <p>I guess the tail <code>check</code> in each <code>test-case</code> returns <code>#&lt;void&gt;</code>, so I have filled a list with the results of the tests (voids) rather than the test cases themselves and given that to the test suite, hence the error.</p>
  <p>But then I don't see how to actually use <code>make-test-suite</code>...?</p>