Skip to content

Commit

Permalink
Use unset in the testsuite to harden tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Jul 28, 2020
1 parent e59129e commit 209e74b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions testsuite/tests/basic/opt_variants.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
(* TEST *)
(* TEST
unset DOES_NOT_EXIST
*)

let () =
assert(Sys.getenv_opt "FOOBAR_UNLIKELY_TO_EXIST_42" = None);
assert(Sys.getenv_opt "DOES_NOT_EXIST" = None);

assert(int_of_string_opt "foo" = None);
assert(int_of_string_opt "42" = Some 42);
Expand Down
4 changes: 3 additions & 1 deletion testsuite/tests/lib-threads/pr7638.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(* TEST
unset FOO
* hassysthreads
include systhreads
** bytecode
Expand All @@ -15,5 +17,5 @@ let crashme v =
| s -> print_string "Surprising but OK\n"

let _ =
let th = Thread.create crashme "no such variable" in
let th = Thread.create crashme "FOO" in
Thread.join th
1 change: 1 addition & 0 deletions testsuite/tests/lib-unix/common/redirections.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(* TEST
files = "reflector.ml"
unset XVAR
* hasunix
** setup-ocamlc.byte-build-env
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/lib-unix/unix-execvpe/exec.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* TEST
unset FOO
* hasunix
include unix
script = "sh ${test_source_directory}/has-execvpe.sh"
Expand Down
2 changes: 2 additions & 0 deletions testsuite/tests/lib-unix/win-env/test_env.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(* TEST
unset FOO
unset FOO2
include unix
flags += "-strict-sequence -safe-string -w A -warn-error A"
modules = "stubs.c"
Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/output-complete-obj/test2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
files = "puts.c"
use_runtime = "false"
unset FOO
* hasunix
include unix
Expand Down

0 comments on commit 209e74b

Please sign in to comment.