From fb52e792879eaf599c1f6731c9d639980a37b615 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 12 Feb 2021 19:41:34 -0500 Subject: [PATCH] test: update test harness --- src/arith/tests/dune | 9 ++++++--- src/arith/tests/run_tests.ml | 20 ++++++++++++++++---- src/mini-cc/tests/dune | 1 + 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/arith/tests/dune b/src/arith/tests/dune index e9895459..fa402df0 100644 --- a/src/arith/tests/dune +++ b/src/arith/tests/dune @@ -1,10 +1,13 @@ (executable (name run_tests) - (libraries containers sidekick-arith.lra zarith iter qcheck) + (libraries containers sidekick-arith.lra zarith iter alcotest qcheck) (flags :standard -warn-error -a+8 -color always)) (alias (name runtest) - (deps run_tests.exe) + (locks /test) + (package sidekick-arith) (action - (run %{deps} --verbose))) + (progn + (run ./run_tests.exe alcotest) ; run regressions first + (run ./run_tests.exe qcheck --verbose)))) diff --git a/src/arith/tests/run_tests.ml b/src/arith/tests/run_tests.ml index a1345c65..2a766dd7 100644 --- a/src/arith/tests/run_tests.ml +++ b/src/arith/tests/run_tests.ml @@ -1,10 +1,22 @@ +let tests : unit Alcotest.test list = [ + Test_simplex2.tests; +] + let props = List.flatten - [ Test_simplex.props; + [ Test_simplex2.props; + Test_simplex.props; ] let () = - CCFormat.set_color_default true; - QCheck_runner.run_tests_main props - + match Array.to_list Sys.argv with + | a0::"alcotest"::tl -> + Sidekick_util.Log.set_debug 50; + let argv= Array.of_list (a0::tl) in + Alcotest.run ~argv ~and_exit:true "arith tests" tests; + | a0::"qcheck"::tl -> + let argv= Array.of_list (a0::tl) in + CCFormat.set_color_default true; + QCheck_runner.run_tests_main ~argv props + | _ -> failwith "expected (qcheck|alcotest) as first arg" diff --git a/src/mini-cc/tests/dune b/src/mini-cc/tests/dune index 4ff9dad0..29dc21ae 100644 --- a/src/mini-cc/tests/dune +++ b/src/mini-cc/tests/dune @@ -2,4 +2,5 @@ (names tests) (libraries sidekick.mini-cc sidekick-arith.base-term alcotest) (package sidekick-arith) + (locks /test) (modes native))