-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
67 additions
and
29 deletions.
There are no files selected for viewing
15 changes: 12 additions & 3 deletions
15
test/blackbox-tests/test-cases/inline_tests/parallel.t/backend/dune
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
50 changes: 28 additions & 22 deletions
50
test/blackbox-tests/test-cases/inline_tests/parallel.t/run.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
First, build silently to avoid some noise | ||
|
||
$ dune build --display short @runtest | ||
ocamlc backend/.fake_backend_runner.objs/byte/fake_backend_runner.{cmi,cmo,cmt} | ||
ocamlc .test_lib.objs/byte/test_lib.{cmi,cmo,cmt} | ||
ocamlopt backend/.fake_backend_runner.objs/native/fake_backend_runner.{cmx,o} | ||
ocamlc .test_lib.inline-tests/.test_lib.inline-tests.eobjs/byte/dune__exe__Inline_test_runner_test_lib.{cmi,cmo,cmt} | ||
ocamlopt .test_lib.objs/native/test_lib.{cmx,o} | ||
ocamlopt backend/fake_backend_runner.{a,cmxa} | ||
ocamlopt .test_lib.inline-tests/.test_lib.inline-tests.eobjs/native/dune__exe__Inline_test_runner_test_lib.{cmx,o} | ||
ocamlopt test_lib.{a,cmxa} | ||
ocamlopt .test_lib.inline-tests/inline_test_runner_test_lib.exe | ||
inline_test_runner_test_lib .test_lib.inline-tests/partitions-best | ||
inline_test_runner_test_lib alias runtest | ||
Running first test | ||
Ok | ||
Running second test | ||
Ok | ||
inline_test_runner_test_lib alias runtest | ||
Running first test | ||
Ok | ||
inline_test_runner_test_lib alias runtest | ||
Running first test | ||
Error: Failure("This failure is expected") | ||
$ dune build | ||
|
||
See that test1/runtest, which uses fake_backend_1, only run one inline test runner | ||
|
||
$ dune build --display short @test1/runtest | ||
ocamlc test1/.test_lib1.inline-tests/.test_lib1.inline-tests.eobjs/byte/dune__exe__Inline_test_runner_test_lib1.{cmi,cmo,cmt} | ||
ocamlopt test1/.test_lib1.inline-tests/.test_lib1.inline-tests.eobjs/native/dune__exe__Inline_test_runner_test_lib1.{cmx,o} | ||
ocamlopt test1/.test_lib1.inline-tests/inline_test_runner_test_lib1.exe | ||
inline_test_runner_test_lib1 alias test1/runtest | ||
|
||
See that test2/runtest, which uses fake_backend_2, run one inline test runner per partition | ||
|
||
$ dune build --display short @test2/runtest | ||
ocamlc test2/.test_lib2.inline-tests/.test_lib2.inline-tests.eobjs/byte/dune__exe__Inline_test_runner_test_lib2.{cmi,cmo,cmt} | ||
ocamlopt test2/.test_lib2.inline-tests/.test_lib2.inline-tests.eobjs/native/dune__exe__Inline_test_runner_test_lib2.{cmx,o} | ||
ocamlopt test2/.test_lib2.inline-tests/inline_test_runner_test_lib2.exe | ||
inline_test_runner_test_lib2 test2/.test_lib2.inline-tests/partitions-best | ||
inline_test_runner_test_lib2 alias test2/runtest | ||
inline_test_runner_test_lib2 alias test2/runtest | ||
inline_test_runner_test_lib2 alias test2/runtest | ||
|
||
See that we indeed have 3 partitions | ||
|
||
$ cat _build/default/test2/.test_lib2.inline-tests/partitions-best | ||
p1 | ||
p2 | ||
p3 |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/inline_tests/parallel.t/test1/dune
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(library | ||
(name test_lib1) | ||
(libraries fake_backend_runner) | ||
(inline_tests (backend fake_backend_1))) |
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/inline_tests/parallel.t/test2/dune
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(library | ||
(name test_lib2) | ||
(libraries fake_backend_runner) | ||
(inline_tests (backend fake_backend_2))) |
19 changes: 19 additions & 0 deletions
19
test/blackbox-tests/test-cases/inline_tests/parallel.t/test2/test_lib2.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
let () = | ||
Fake_backend_runner.register ~libname:"test_lib" ~partition:"p1" "first test" | ||
(fun () -> assert true) | ||
|
||
let () = | ||
Fake_backend_runner.register ~libname:"test_lib" ~partition:"p1" "second test" | ||
(fun () -> () ) | ||
|
||
let () = | ||
Fake_backend_runner.register ~libname:"test_lib" ~partition:"p2" "first test" | ||
(fun () -> ()) | ||
|
||
let () = | ||
Fake_backend_runner.register ~libname:"test_lib" ~partition:"p3" "first test" | ||
(fun () -> failwith "This failure is expected") | ||
|
||
let () = | ||
Fake_backend_runner.register ~libname:"other_lib" ~partition:"p1" | ||
"second test" (fun () -> assert false) |