"codegen" tests whether enabling code generation adds further checking.
"patches", which iterates over the patch pool, now runs with code
generation enabled.
---
 src/compiler/test/codegen |   30 ++++++++++++++++++++++++++++++
 src/compiler/test/patches |    2 +-
 2 files changed, 31 insertions(+), 1 deletions(-)
 create mode 100755 src/compiler/test/codegen

diff --git a/src/compiler/test/codegen b/src/compiler/test/codegen
new file mode 100755
index 0000000..da90615
--- /dev/null
+++ b/src/compiler/test/codegen
@@ -0,0 +1,30 @@
+#!/bin/sh
+. ./Common
+
+###############################################################################
+
+ptest "codegen: global wave_a = 1" -c -q <<EOF
+wave_a = 1
+EOF
+expect <<EOF
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest_fail "codegen: global foo = 1" -c -q <<EOF
+foo = 1
+EOF
+expect <<EOF
+FPVM, line 1: unknown parameter near ''
+EOF
+
+#------------------------------------------------------------------------------
+
+ptest_fail "codegen: wave_a = bar" -c -q <<EOF
+wave_a = bar
+EOF
+expect <<EOF
+FPVM, line 1: value must be a constant near 'bar'
+EOF
+
+###############################################################################
diff --git a/src/compiler/test/patches b/src/compiler/test/patches
index 29c2f4c..f567a5c 100755
--- a/src/compiler/test/patches
+++ b/src/compiler/test/patches
@@ -71,7 +71,7 @@ for n in \
     "Zylot - The Inner Workings of my New Computer.fnp" \
     "bmelgren - Godhead (Video mix).fnp" \
     "nil - Cid and Lucy.fnp"; do
-       ptest "patch: $n" -q <"$PATCHDIR/$n"
+       ptest "patch: $n" -c -q <"$PATCHDIR/$n"
        expect </dev/null
 done
 
-- 
1.7.1

_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode

Reply via email to