about summary refs log tree commit diff stats
path: root/test_apps
diff options
context:
space:
mode:
Diffstat (limited to 'test_apps')
-rwxr-xr-xtest_apps25
1 files changed, 25 insertions, 0 deletions
diff --git a/test_apps b/test_apps
index 79a95196..91929b6d 100755
--- a/test_apps
+++ b/test_apps
@@ -23,6 +23,8 @@ test $NATIVE  &&  echo 'testing native runs'
 
 echo "== translating and running using C++"
 
+# example programs
+
 echo ex1
 ./subx translate examples/ex1.subx  -o examples/ex1
 test "$1" = 'record'  ||  git diff --exit-code examples/ex1
@@ -163,6 +165,8 @@ 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
 
+# Larger apps that use the standard library.
+
 echo factorial
 ./subx translate 0*.subx apps/factorial.subx  -o apps/factorial
 test "$1" = 'record'  ||  git diff --exit-code apps/factorial
@@ -217,6 +221,8 @@ test $NATIVE  &&  {
   grep -q 'lookup failed' handle.out  ||  { echo "missing failure test"; exit 1; }
 }
 
+# Phases of the self-hosted SubX translator.
+
 echo hex
 ./subx translate 0*.subx apps/subx-common.subx apps/hex.subx  -o apps/hex
 test "$1" = 'record'  ||  git diff --exit-code apps/hex
@@ -289,8 +295,22 @@ test $NATIVE  &&  {
   echo
 }
 
+# Higher-level syntax.
+
+echo desugar
+./subx translate 0*.subx apps/subx-common.subx apps/desugar.subx  -o apps/desugar
+[ "$1" != record ]  &&  git diff --exit-code apps/desugar
+./subx run apps/desugar test
+echo
+test `uname` = 'Linux'  &&  {
+  apps/desugar test
+  echo
+}
+
 echo "== translating using SubX"
 
+# example programs
+
 echo ex1
 test $EMULATED  &&  {
   cat examples/ex1.subx |./subx_bin run apps/tests |./subx_bin run apps/dquotes |./subx_bin run apps/assort |./subx_bin run apps/pack |./subx_bin run apps/survey |./subx_bin run apps/hex |diff examples/ex1 -
@@ -407,4 +427,9 @@ cat 0*.subx apps/subx-common.subx apps/dquotes.subx |apps/tests |apps/dquotes |a
 echo tests
 cat 0*.subx apps/subx-common.subx apps/tests.subx |apps/tests |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff apps/tests -
 
+# Higher-level syntax.
+
+echo desugar
+cat 0*.subx apps/subx-common.subx apps/desugar.subx |apps/tests |apps/dquotes |apps/assort |apps/pack |apps/survey |apps/hex |diff apps/desugar -
+
 exit 0