I'm trying to set up a server to run extensive random tests against a Racket program, and want to have output from these tests sent to logs in files. How can I log output from tests to a file?
Tests from rackunit return #<void>, not a string, so trying to use (call-with-output-file ... with the tests only adds #<void> to the output file.
(call-with-output-file "testing.txt"
(λ (out)
(display <TESTS> out))
#:exists 'append)
The output file should log the test results or errors if there are any. Any help is appreciated.
Instead of running checks by themselves, which print to
stderrand return#<void>, put the checks in a test suite, so that you can userun-testsfromrackunit/text-ui.However, the
run-testsfunction seems to usecurrent-error-port, notcurrent-output-port, to print test failures, so within yourcall-with-output-file, you need to set thecurrent-error-porttoout.