diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-07-20 08:41:57 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-07-20 08:43:25 -0700 |
commit | d0f39e75ca761bb9c5fa6889ea0703e3700990a2 (patch) | |
tree | 8c4bf813419efeafc1f25165311b764df9b57b47 /linux/test_apps_emulated | |
parent | 13ef425825cef5fa30f7eb68688b6d114ecbe554 (diff) | |
download | mu-d0f39e75ca761bb9c5fa6889ea0703e3700990a2.tar.gz |
.
Diffstat (limited to 'linux/test_apps_emulated')
-rwxr-xr-x | linux/test_apps_emulated | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/linux/test_apps_emulated b/linux/test_apps_emulated index 844dee82..b46a9b0f 100755 --- a/linux/test_apps_emulated +++ b/linux/test_apps_emulated @@ -18,70 +18,70 @@ echo "== translating using the bootstrap C++ translator" # example programs echo ex1 -bootstrap/bootstrap translate 000init.subx ex1.subx -o ex1 +bootstrap/bootstrap translate 000init.subx apps/ex1.subx -o ex1 { bootstrap/bootstrap run ex1 || ret=$? test $ret -eq 42 # life, the universe and everything } echo ex2 -bootstrap/bootstrap translate 000init.subx ex2.subx -o ex2 +bootstrap/bootstrap translate 000init.subx apps/ex2.subx -o ex2 { bootstrap/bootstrap run ex2 || ret=$? test $ret -eq 7 # 3 + 4 } echo ex3 -bootstrap/bootstrap translate 000init.subx ex3.subx -o ex3 +bootstrap/bootstrap translate 000init.subx apps/ex3.subx -o ex3 { bootstrap/bootstrap run ex3 || ret=$? test $ret -eq 55 # 1 + 2 + ... + 10 } echo ex4 -bootstrap/bootstrap translate 000init.subx ex4.subx -o ex4 +bootstrap/bootstrap translate 000init.subx apps/ex4.subx -o ex4 { echo a | bootstrap/bootstrap run ex4 >ex4.out || true test `cat ex4.out` = 'a' } echo ex5 -bootstrap/bootstrap translate 000init.subx ex5.subx -o ex5 +bootstrap/bootstrap translate 000init.subx apps/ex5.subx -o ex5 { echo a | bootstrap/bootstrap run ex5 >ex5.out || true test `cat ex5.out` = 'a' } echo ex6 -bootstrap/bootstrap translate 000init.subx ex6.subx -o ex6 +bootstrap/bootstrap translate 000init.subx apps/ex6.subx -o ex6 { bootstrap/bootstrap run ex6 >ex6.out || true test "`cat ex6.out`" = 'Hello world!' } echo ex7 -bootstrap/bootstrap translate 000init.subx ex7.subx -o ex7 +bootstrap/bootstrap translate 000init.subx apps/ex7.subx -o ex7 { bootstrap/bootstrap run ex7 || ret=$? test $ret -eq 97 # 'a' } echo ex8 -bootstrap/bootstrap translate 000init.subx ex8.subx -o ex8 +bootstrap/bootstrap translate 000init.subx apps/ex8.subx -o ex8 { bootstrap/bootstrap run ex8 abcd || ret=$? test $ret -eq 4 # length('abcd') } echo ex9 -bootstrap/bootstrap translate 000init.subx ex9.subx -o ex9 +bootstrap/bootstrap translate 000init.subx apps/ex9.subx -o ex9 { bootstrap/bootstrap run ex9 z x || ret=$? test $ret -eq 2 # 'z' - 'x' } echo ex10 -bootstrap/bootstrap translate 000init.subx ex10.subx -o ex10 +bootstrap/bootstrap translate 000init.subx apps/ex10.subx -o ex10 { bootstrap/bootstrap run ex10 abc abc || ret=$? test $ret -eq 1 # equal @@ -89,18 +89,18 @@ bootstrap/bootstrap translate 000init.subx ex10.subx -o ex10 } echo ex11 -bootstrap/bootstrap translate 000init.subx ex11.subx -o ex11 +bootstrap/bootstrap translate 000init.subx apps/ex11.subx -o ex11 { bootstrap/bootstrap run ex11 echo } echo ex12 -bootstrap/bootstrap translate 000init.subx ex12.subx -o ex12 +bootstrap/bootstrap translate 000init.subx apps/ex12.subx -o ex12 bootstrap/bootstrap run ex12 # final byte of mmap'd address is well-nigh guaranteed to be 0 echo ex13 -bootstrap/bootstrap translate 000init.subx ex13.subx -o ex13 +bootstrap/bootstrap translate 000init.subx apps/ex13.subx -o ex13 { bootstrap/bootstrap run ex13 || ret=$? test $ret -eq 1 # 3 == 3 @@ -109,7 +109,7 @@ bootstrap/bootstrap translate 000init.subx ex13.subx -o ex13 # Larger apps that use the standard library. echo factorial -bootstrap/bootstrap translate [01]*.subx factorial.subx -o factorial +bootstrap/bootstrap translate [01]*.subx apps/factorial.subx -o factorial { bootstrap/bootstrap run factorial || ret=$? test $ret -eq 120 # factorial(5) @@ -118,7 +118,7 @@ bootstrap/bootstrap translate [01]*.subx factorial.subx -o factorial } echo random -bootstrap/bootstrap translate [01]*.subx random.subx -o random +bootstrap/bootstrap translate [01]*.subx apps/random.subx -o random # don't run # Phases of the self-hosted SubX translator. @@ -182,7 +182,7 @@ echo "== translating using the self-hosted translator" for n in `seq 1 12` do echo ex$n - ./translate_subx_emulated 000init.subx ex$n.subx + ./translate_subx_emulated 000init.subx apps/ex$n.subx diff ex$n a.elf done @@ -191,7 +191,7 @@ done for app in factorial do echo $app - ./translate_subx_emulated [01]*.subx $app.subx + ./translate_subx_emulated [01]*.subx apps/$app.subx diff $app a.elf done @@ -219,35 +219,35 @@ diff mu a.elf # Mu programs echo ex1.mu -./translate_emulated ex1.mu +./translate_emulated apps/ex1.mu { bootstrap/bootstrap run a.elf || ret=$? test $ret -eq 42 # life, the universe and everything } echo ex2.mu -./translate_emulated ex2.mu +./translate_emulated apps/ex2.mu { bootstrap/bootstrap run a.elf || ret=$? test $ret -eq 7 } echo ex3.mu -./translate_emulated ex3.mu +./translate_emulated apps/ex3.mu { bootstrap/bootstrap run a.elf || ret=$? test $ret -eq 55 } echo ex3.2.mu -./translate_emulated ex3.2.mu +./translate_emulated apps/ex3.2.mu { bootstrap/bootstrap run a.elf || ret=$? test $ret -eq 55 } echo factorial.mu -./translate_emulated factorial.mu +./translate_emulated apps/factorial.mu { bootstrap/bootstrap run a.elf || ret=$? test $ret -eq 120 |