-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skippable tests #307
Comments
The main drawback of commenting out tests by default is that lazy students will get the impression that their program works because they haven't enabled all tests. At work we have a This is handled in the Haskell track with HSpec's I wonder if OUnit2 has an equivalent. |
I thought that maybe
means that we can exit the test suite given a failure. But trying let () =
run_test_tt_main ("connect tests" >::: tests)
~exit:(fun i ->
print_endline ("I got " ^ string_of_int i ^ "!");
exit i
) still runs all tests. So I don't think so. |
I thought about a solution along these lines: let ae ?(skip=false) exp got _test_ctxt =
skip_if skip "Skipped";
assert_equal exp (got ())
let () =
run_test_tt_main ("tests" >::: [
"skipped - would fail" >:: ae ~skip:true true (fun _ -> false);;
"not skipped - succeeds" >:: ae ~skip:false true (fun _ -> true);;
]) Running this creates output like this:
|
While working #306 I noticed that it might be beneficial for learners to skip single tests, enabling a workflow where learners implement and enable one test after the other (as seen e.g. on the Rust and F# track)
Also skipping all tests by default might improve the overall track setup as executingdune runtest
from the track root can serve as a basic sanity check for all exercises and test harnesses.An example of how this might look like can be found here
brainpower-org/ocaml-exercism-cubicle/acronym/test.ml#L4-L6
I also thought it might be nice to have a CI step that copiesexamples.ml
and runs the (then enabled) unit tests against it. I'm not sure what the best way to do this would be, thoughts?I tried to contributes this in the test-generator templates but failed to compile the
test-generator
.The text was updated successfully, but these errors were encountered: