diff options
| author | Alasdair Armstrong | 2018-12-14 15:17:42 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-12-14 15:17:42 +0000 |
| commit | 2dfcbdeedb0ac40d4865aaf5c2202dfba95f4a38 (patch) | |
| tree | e267b9d9166e3548f71508d9d68b8ea1f35a304d /test | |
| parent | bfb20a209d1b72c832b4376d6d3c51d39970ef2f (diff) | |
Add a few more tests for Jenkins
Some of the output from the tests scripts is odd on Jenkins, try to
fix this by flushing stdout more regularly in the test scripts
Diffstat (limited to 'test')
| -rw-r--r-- | test/c/config.expect | 6 | ||||
| -rw-r--r-- | test/c/config.sail | 34 | ||||
| -rwxr-xr-x | test/run_tests.sh | 14 | ||||
| -rw-r--r-- | test/sailtest.py | 2 | ||||
| -rw-r--r-- | test/typecheck/pass/commentfix.sail | 7 |
5 files changed, 56 insertions, 7 deletions
diff --git a/test/c/config.expect b/test/c/config.expect new file mode 100644 index 00000000..059a413f --- /dev/null +++ b/test/c/config.expect @@ -0,0 +1,6 @@ +x = 3 +Hello +z = 0xFF +x = 4 +World +z = 0xAA diff --git a/test/c/config.sail b/test/c/config.sail new file mode 100644 index 00000000..2902d259 --- /dev/null +++ b/test/c/config.sail @@ -0,0 +1,34 @@ +default Order dec + +$include <arith.sail> +$include <vector_dec.sail> + +val "print" : string -> unit + +register q : int + +register configuration x : int = 3 + +register configuration y : string = "Hello\n" + +register configuration z : bits(8) = 0xFF + +val init : unit -> unit effect {configuration} + +function init() = { + x = 4; + y = "World\n"; + z = 0xAA; +} + +val main : unit -> unit effect {configuration} + +function main() = { + print_int("x = ", x); + print(y); + print_bits("z = ", z); + init(); + print_int("x = ", x); + print(y); + print_bits("z = ", z); +}
\ No newline at end of file diff --git a/test/run_tests.sh b/test/run_tests.sh index 5e6fe691..ba0a2112 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -12,28 +12,28 @@ printf "==========================================\n" ./typecheck/run_tests.sh printf "\n==========================================\n" -printf "Ocaml tests\n" +printf "Lem tests\n" printf "==========================================\n" -./ocaml/run_tests.sh +./lem/run_tests.sh printf "\n==========================================\n" -printf "C tests\n" +printf "Ocaml tests\n" printf "==========================================\n" -./c/run_tests.py +./ocaml/run_tests.sh printf "\n==========================================\n" -printf "Lem tests\n" +printf "C tests\n" printf "==========================================\n" -./lem/run_tests.sh +TEST_PAR=8 ./c/run_tests.py printf "\n==========================================\n" printf "Builtins tests\n" printf "==========================================\n" -./builtins/run_tests.py +TEST_PAR=4 ./builtins/run_tests.py printf "\n==========================================\n" printf "ARM spec tests\n" diff --git a/test/sailtest.py b/test/sailtest.py index 32d09aa9..5ee87b08 100644 --- a/test/sailtest.py +++ b/test/sailtest.py @@ -46,6 +46,7 @@ def banner(string): print '-' * len(string) print string print '-' * len(string) + sys.stdout.flush() class Results: def __init__(self, name): @@ -63,6 +64,7 @@ class Results: else: self.passes += 1 self.xml += ' <testcase name="{}"/>\n'.format(test) + sys.stdout.flush() def finish(self): print '{}{} passes and {} failures{}'.format(color.NOTICE, self.passes, self.failures, color.END) diff --git a/test/typecheck/pass/commentfix.sail b/test/typecheck/pass/commentfix.sail new file mode 100644 index 00000000..fd2cf0b2 --- /dev/null +++ b/test/typecheck/pass/commentfix.sail @@ -0,0 +1,7 @@ +/********/ + +/*=====*/ + +////// + +default Order inc |
