-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conditionally run native test if the native compilation support is de…
…tected.
- Loading branch information
Showing
2 changed files
with
58 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,86 @@ | ||
;; Async tests | ||
(subdir | ||
native | ||
(rule | ||
(with-stdout-to compiler | ||
(bash "$(%{ocamlc} -config | grep 'native_compiler: ' | grep -oE '[^ ]+$') || echo 'false'")))) | ||
|
||
(rule | ||
(with-stdout-to async.output | ||
(setenv "LD_LIBRARY_PATH" "." | ||
(run ../examples/async.exe)))) | ||
(run %{workspace_root}/examples/async.exe)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(enabled_if (= %{read:native/compiler} "true\n")) | ||
(action (diff async.expected async.output))) | ||
|
||
(rule | ||
(with-stdout-to async.bc.output | ||
(setenv "LD_LIBRARY_PATH" "." | ||
(run %{workspace_root}/examples/async.bc.exe)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action (diff async.expected async.bc.output))) | ||
|
||
;; Choice tests | ||
(rule | ||
(with-stdout-to choice.output | ||
(setenv "LD_LIBRARY_PATH" "." | ||
(run ../examples/choice.exe)))) | ||
(run %{workspace_root}/examples/choice.exe)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(enabled_if (= %{read:native/compiler} "true\n")) | ||
(action (diff choice.expected choice.output))) | ||
|
||
(rule | ||
(with-stdout-to choice.bc.output | ||
(setenv "LD_LIBRARY_PATH" "." | ||
(run %{workspace_root}/examples/choice.bc.exe)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action (diff choice.expected choice.bc.output))) | ||
|
||
;; Generic count tests | ||
(rule | ||
(with-stdout-to generic_count.output | ||
(setenv "LD_LIBRARY_PATH" "." | ||
(run ../examples/generic_count.exe)))) | ||
(run %{workspace_root}/examples/generic_count.exe)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(enabled_if (= %{read:native/compiler} "true\n")) | ||
(action (diff generic_count.expected generic_count.output))) | ||
|
||
(rule | ||
(with-stdout-to generic_count.bc.output | ||
(setenv "LD_LIBRARY_PATH" "." | ||
(run %{workspace_root}/examples/generic_count.bc.exe)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action (diff generic_count.expected generic_count.bc.output))) | ||
|
||
;; Supervised tests | ||
(rule | ||
(with-stdout-to supervised.output | ||
(setenv "LD_LIBRARY_PATH" "." | ||
(run ../examples/supervised.exe)))) | ||
(run %{workspace_root}/examples/supervised.exe)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(enabled_if (= %{read:native/compiler} "true\n")) | ||
(action (diff supervised.expected supervised.output))) | ||
|
||
(rule | ||
(with-stdout-to supervised.bc.output | ||
(setenv "LD_LIBRARY_PATH" "." | ||
(run %{workspace_root}/examples/supervised.bc.exe)))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action (diff supervised.expected supervised.bc.output))) | ||
|
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 @@ | ||
(rule | ||
(with-stdout-to native_compiler | ||
(bash "%{ocamlc} -config | grep 'native_compiler: ' | grep -oE '[^ ]+$'"))) |