compiler

Unnamed Compiled Systems Language Project
git clone http://frotz.net/git/compiler.git
Log | Files | Refs

commit 67fac0cdab5ee935a5507f00587fd7fca50996de
parent 15461e954e6002136911b11b673498d24bc7e781
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun,  8 Mar 2020 21:26:57 -0700

runtest improvements

- capture compiler output to *.msg
- correctly notify on success of error tests
- add a few error tests

Diffstat:
Mruntest.sh | 5+++--
Atest/1100-err-decl-mismatch-count.src | 6++++++
Atest/1100-err-decl-mismatch-return.src | 5+++++
Atest/1100-err-decl-mismatch-type.src | 6++++++
4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/runtest.sh b/runtest.sh @@ -8,11 +8,11 @@ txt="$2" bin="${txt%.txt}.bin" lst="${txt%.txt}.lst" log="${txt%.txt}.log" +msg="${txt%.txt}.msg" gold="${src%.src}.log" echo "RUNTEST: $src: compiling..." -#echo "bin/tlc -o $bin -l $lst $src" -if bin/tlc -o "$bin" -l "$lst" "$src"; then +if bin/tlc -o "$bin" -l "$lst" "$src" 2> "$msg"; then # success! if [[ "$txt" == *"-err"* ]]; then # but this was an error test, so... @@ -37,6 +37,7 @@ else # failure if [[ "$txt" == *"-err"* ]]; then # but this was an error test, so... + echo "RUNTEST: $src: PASS" echo "PASS: $src" > "$txt" else echo "RUNTEST: $src: FAIL: compiler error" diff --git a/test/1100-err-decl-mismatch-count.src b/test/1100-err-decl-mismatch-count.src @@ -0,0 +1,6 @@ + +func hello(a i32, b i32) bool; + +func hello(a i32, b i32, c i32) bool { + return false; +} diff --git a/test/1100-err-decl-mismatch-return.src b/test/1100-err-decl-mismatch-return.src @@ -0,0 +1,5 @@ + +func hello(a i32, b i32) bool; + +func hello(a i32, b i32) { +} diff --git a/test/1100-err-decl-mismatch-type.src b/test/1100-err-decl-mismatch-type.src @@ -0,0 +1,6 @@ + +func hello(a i32, b i32) bool; + +func hello(a i32, b bool) bool { + return false; +}