-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1248 from ocaml/tests-stanza-action
Customize how (test) is run using (action)
- Loading branch information
Showing
21 changed files
with
134 additions
and
51 deletions.
There are no files selected for viewing
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 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 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 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 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 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 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 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 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 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 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
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/tests-stanza-action/default/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,3 @@ | ||
(test | ||
(name my_test) | ||
) |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/tests-stanza-action/default/my_test.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,4 @@ | ||
let show_argument n argument = | ||
Printf.printf "argv[%d] = %S\n" n argument | ||
|
||
let () = Array.iteri show_argument Sys.argv |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/tests-stanza-action/dune-project
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 @@ | ||
(lang dune 1.2) |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/tests-stanza-action/explicit-expect/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 @@ | ||
(tests | ||
(names my_test) | ||
(action (run %{test} arg1 arg2 arg3)) | ||
) |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/tests-stanza-action/explicit-expect/my_test.expected
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 @@ | ||
argv[0] = "./my_test.exe" | ||
argv[1] = "arg1" | ||
argv[2] = "arg2" | ||
argv[3] = "arg3" |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/tests-stanza-action/explicit-expect/my_test.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,4 @@ | ||
let show_argument n argument = | ||
Printf.printf "argv[%d] = %S\n" n argument | ||
|
||
let () = Array.iteri show_argument Sys.argv |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/tests-stanza-action/explicit-regular/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 @@ | ||
(tests | ||
(names my_test) | ||
(action (run %{test} arg1 arg2 arg3)) | ||
) |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/tests-stanza-action/explicit-regular/my_test.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,4 @@ | ||
let show_argument n argument = | ||
Printf.printf "argv[%d] = %S\n" n argument | ||
|
||
let () = Array.iteri show_argument Sys.argv |
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,17 @@ | ||
If there is an (action) field, it is used to invoke to the executable (in both | ||
regular and expect modes: | ||
|
||
$ dune build @explicit-regular/runtest | ||
my_test alias explicit-regular/runtest | ||
argv[0] = "./my_test.exe" | ||
argv[1] = "arg1" | ||
argv[2] = "arg2" | ||
argv[3] = "arg3" | ||
|
||
$ dune build @explicit-expect/runtest | ||
|
||
If there is no field, the program is run with no arguments: | ||
|
||
$ dune build @default/runtest | ||
my_test alias default/runtest | ||
argv[0] = "./my_test.exe" |
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