Skip to content

Instantly share code, notes, and snippets.

@simonjbeaumont
Created May 13, 2014 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonjbeaumont/9dbb0771baf616c3493d to your computer and use it in GitHub Desktop.
Save simonjbeaumont/9dbb0771baf616c3493d to your computer and use it in GitHub Desktop.
Why does this have return code 0 when executed?
default:
ocamlfind ocamlc -o test_test -package oUnit -linkpkg -g test.ml
clean:
rm *.cmi *.cmo *.cmx test_test
open OUnit
let test1 () = assert_failure "Test failure"
let suite = "suite" >::: ["test1" >:: test1]
let _ =
run_test_tt_main suite
@simonjbeaumont
Copy link
Author

For me, running the executable from the above ./test_test states there was a failure but the executable returns 0. Contrary to the following docs for OUnit:

When using OUnit.run_test_tt_main, a non zero exit code signals that the test suite was not successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment