diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-01-01 17:23:29 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-01-01 17:23:29 -0800 |
commit | 113bae7311b63e55e55160970718d19bfeeb56c3 (patch) | |
tree | d2468b58470e173329c7ef6e8da496c2f768b037 /test_apps | |
parent | 1b050736eea04323e09e5e8e7499c33cee1899d0 (diff) | |
download | mu-113bae7311b63e55e55160970718d19bfeeb56c3.tar.gz |
5856
Diffstat (limited to 'test_apps')
-rwxr-xr-x | test_apps | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/test_apps b/test_apps index b9b22db1..eaf102e8 100755 --- a/test_apps +++ b/test_apps @@ -28,144 +28,144 @@ echo "== translating and running using C++" # example programs echo ex1 -./subx translate init.$OS examples/ex1.subx -o examples/ex1 -test "$1" = 'record' || git diff --exit-code examples/ex1 +./subx translate init.$OS apps/ex1.subx -o apps/ex1 +test "$1" = 'record' || git diff --exit-code apps/ex1 test $EMULATED && { - ./subx run examples/ex1 || ret=$? + ./subx run apps/ex1 || ret=$? test $ret -eq 42 # life, the universe and everything } test $NATIVE && { - examples/ex1 || ret=$? + apps/ex1 || ret=$? test $ret -eq 42 # life, the universe and everything } echo ex2 -./subx translate init.$OS examples/ex2.subx -o examples/ex2 -test "$1" = 'record' || git diff --exit-code examples/ex2 +./subx translate init.$OS apps/ex2.subx -o apps/ex2 +test "$1" = 'record' || git diff --exit-code apps/ex2 test $EMULATED && { - ./subx run examples/ex2 || ret=$? + ./subx run apps/ex2 || ret=$? test $ret -eq 2 # 1 + 1 } test $NATIVE && { - examples/ex2 || ret=$? + apps/ex2 || ret=$? test $ret -eq 2 # 1 + 1 } echo ex3 -./subx translate init.$OS examples/ex3.subx -o examples/ex3 -test "$1" = 'record' || git diff --exit-code examples/ex3 +./subx translate init.$OS apps/ex3.subx -o apps/ex3 +test "$1" = 'record' || git diff --exit-code apps/ex3 test $EMULATED && { - ./subx run examples/ex3 || ret=$? + ./subx run apps/ex3 || ret=$? test $ret -eq 55 # 1 + 2 + ... + 10 } test $NATIVE && { - examples/ex3 || ret=$? + apps/ex3 || ret=$? test $ret -eq 55 # 1 + 2 + ... + 10 } echo ex4 -./subx translate init.$OS examples/ex4.subx -o examples/ex4 -test "$1" = 'record' || git diff --exit-code examples/ex4 +./subx translate init.$OS apps/ex4.subx -o apps/ex4 +test "$1" = 'record' || git diff --exit-code apps/ex4 test $EMULATED && { - echo a | ./subx run examples/ex4 >ex4.out || true + echo a | ./subx run apps/ex4 >ex4.out || true test `cat ex4.out` = 'a' } test $NATIVE && { - echo a | examples/ex4 >ex4.out || true + echo a | apps/ex4 >ex4.out || true test `cat ex4.out` = 'a' } echo ex5 -./subx translate init.$OS examples/ex5.subx -o examples/ex5 -test "$1" = 'record' || git diff --exit-code examples/ex5 +./subx translate init.$OS apps/ex5.subx -o apps/ex5 +test "$1" = 'record' || git diff --exit-code apps/ex5 test $EMULATED && { - echo a | ./subx run examples/ex5 >ex5.out || true + echo a | ./subx run apps/ex5 >ex5.out || true test `cat ex5.out` = 'a' } test $NATIVE && { - echo a | examples/ex5 >ex5.out || true + echo a | apps/ex5 >ex5.out || true test `cat ex5.out` = 'a' } echo ex6 -./subx translate init.$OS examples/ex6.subx -o examples/ex6 -test "$1" = 'record' || git diff --exit-code examples/ex6 +./subx translate init.$OS apps/ex6.subx -o apps/ex6 +test "$1" = 'record' || git diff --exit-code apps/ex6 test $EMULATED && { - ./subx run examples/ex6 >ex6.out || true + ./subx run apps/ex6 >ex6.out || true test "`cat ex6.out`" = 'Hello, world!' } test $NATIVE && { - examples/ex6 >ex6.out || true + apps/ex6 >ex6.out || true test "`cat ex6.out`" = 'Hello, world!' } echo ex7 -./subx translate init.$OS examples/ex7.subx -o examples/ex7 -test "$1" = 'record' || git diff --exit-code examples/ex7 +./subx translate init.$OS apps/ex7.subx -o apps/ex7 +test "$1" = 'record' || git diff --exit-code apps/ex7 test $EMULATED && { - ./subx run examples/ex7 || ret=$? + ./subx run apps/ex7 || ret=$? test $ret -eq 97 # 'a' } test $NATIVE && { - examples/ex7 || ret=$? + apps/ex7 || ret=$? test $ret -eq 97 # 'a' } echo ex8 -./subx translate init.$OS examples/ex8.subx -o examples/ex8 -test "$1" = 'record' || git diff --exit-code examples/ex8 +./subx translate init.$OS apps/ex8.subx -o apps/ex8 +test "$1" = 'record' || git diff --exit-code apps/ex8 test $EMULATED && { - ./subx run examples/ex8 abcd || ret=$? + ./subx run apps/ex8 abcd || ret=$? test $ret -eq 4 # length('abcd') } test $NATIVE && { - examples/ex8 abcd || ret=$? + apps/ex8 abcd || ret=$? test $ret -eq 4 # length('abcd') } echo ex9 -./subx translate init.$OS examples/ex9.subx -o examples/ex9 -test "$1" = 'record' || git diff --exit-code examples/ex9 +./subx translate init.$OS apps/ex9.subx -o apps/ex9 +test "$1" = 'record' || git diff --exit-code apps/ex9 test $EMULATED && { - ./subx run examples/ex9 z x || ret=$? + ./subx run apps/ex9 z x || ret=$? test $ret -eq 2 # 'z' - 'x' } test $NATIVE && { - examples/ex9 z x || ret=$? + apps/ex9 z x || ret=$? test $ret -eq 2 # 'z' - 'x' } echo ex10 -./subx translate init.$OS examples/ex10.subx -o examples/ex10 -test "$1" = 'record' || git diff --exit-code examples/ex10 +./subx translate init.$OS apps/ex10.subx -o apps/ex10 +test "$1" = 'record' || git diff --exit-code apps/ex10 test $EMULATED && { - ./subx run examples/ex10 abc abc || ret=$? + ./subx run apps/ex10 abc abc || ret=$? test $ret -eq 1 # equal - ./subx run examples/ex10 abc abcd # 0; not equal + ./subx run apps/ex10 abc abcd # 0; not equal } test $NATIVE && { - examples/ex10 abc abc || ret=$? + apps/ex10 abc abc || ret=$? test $ret -eq 1 # equal - examples/ex10 abc abcd # 0; not equal + apps/ex10 abc abcd # 0; not equal } echo ex11 -./subx translate init.$OS examples/ex11.subx -o examples/ex11 -test "$1" = 'record' || git diff --exit-code examples/ex11 +./subx translate init.$OS apps/ex11.subx -o apps/ex11 +test "$1" = 'record' || git diff --exit-code apps/ex11 test $EMULATED && { - ./subx run examples/ex11 + ./subx run apps/ex11 echo } test $NATIVE && { - examples/ex11 + apps/ex11 echo } echo ex12 -./subx translate init.$OS examples/ex12.subx -o examples/ex12 -test "$1" = 'record' || git diff --exit-code examples/ex12 -test $EMULATED && ./subx run examples/ex12 # final byte of mmap'd address is well-nigh guaranteed to be 0 -test $NATIVE && examples/ex12 +./subx translate init.$OS apps/ex12.subx -o apps/ex12 +test "$1" = 'record' || git diff --exit-code apps/ex12 +test $EMULATED && ./subx run apps/ex12 # final byte of mmap'd address is well-nigh guaranteed to be 0 +test $NATIVE && apps/ex12 # Larger apps that use the standard library. @@ -304,8 +304,8 @@ echo "== translating using SubX (native only)" for n in `seq 1 12` do echo ex$n - ./translate_subx init.$OS examples/ex$n.subx - diff examples/ex$n a.elf + ./translate_subx init.$OS apps/ex$n.subx + diff apps/ex$n a.elf done # Larger apps that use the standard library. |