Closed jasonhemann closed 2 years ago
I currently use something closer to Matthias' suggestion (https://github.com/cpsc411/cpsc411-pub/blob/3033dfd6db0d25122d94cfd924e065e76a44231a/cpsc411-lib/cpsc411/test-suite/utils.rkt#L294), because I ported my test suite to generate almost everything from a little DSL for compiler tests. Before that, it was too difficult to insert manual termination checks for every input, so I needed something like my gist.
I prefer the explicit termination check as it gives you better control over error messages and fewer false positives if you have long running tests.
https://github.com/rymaju/gradescope-racket/commit/53c2eaf0638b9f1acaf0f29ccd6f1e33947f2041
This seems to work? Not sure if a more experienced Racketeer could chime in on whether this is robust enough. Of course this should be optional as well -- maybe through passing in some optional arguments / a parameter?
Unfortunately, it seems like the best way to do this would be to time out each individual test with something like racket/engine
, I would have loved to run everything async, but that only works if you don't have any before
or after
setup/teardown.
Fwiw, @rymaju, I definitely like your proposal!
closing via #24
My students' will sometimes accidentally code infinite loops. As written, the entire test suite will time out when I test such code, which isn't as helpful as it could be.
I'm currently needing to wrap this around almost all my tests, which seems gross and wrong. In principle I'll want to timeout on almost any tests, b/c they could accidentally loop in any program they write. It's a shame to have to set one single time-out.
@wilbowma , are you currently using https://gist.github.com/wilbowma/79330280f474ecc456916787028206cc ? Matthias suggests: https://www.mail-archive.com/racket-users@googlegroups.com/msg32199.html on So what's the right API and a good standard implementation to support it?