[SCM] Lisaac compiler branch, stable, updated. lisaac-0.12-546-g2442565
Mildred Ki'Lya
silkensedai at online.fr
Fri Oct 9 23:17:32 UTC 2009
The following commit has been merged in the stable branch:
commit 082b2aad4384d7214086086b79cbdbfd740323c5
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date: Fri Oct 9 19:54:20 2009 +0200
Improved tests
diff --git a/run-tests.sh b/run-tests.sh
index 1cd98b3..586da98 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -82,7 +82,6 @@ if $op_runcwd; then
res=1
echo
header 80 '*' "$op_testname"
- #echo "******************** $op_testname ********************"
if [ -f test.sh -a -x test.sh ]; then
./test.sh
res=$?
@@ -91,6 +90,8 @@ if $op_runcwd; then
fi
if [ $res != 0 ]; then
header 80 ' ' "error: $res"
+ else
+ header 80 ' ' "ok"
fi
header 80 '*'
echo
diff --git a/tests/.gitignore b/tests/.gitignore
index 9733823..255d7b5 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -4,7 +4,6 @@ lib_tests
abstract_string_test
boolean_test
boolean_test2
-boolean_test3
character_test
lib_tests
living_external
diff --git a/tests/ambiguous_protoname/test.sh b/tests/ambiguous_protoname/test.sh
index cf5cb02..ada6bec 100755
--- a/tests/ambiguous_protoname/test.sh
+++ b/tests/ambiguous_protoname/test.sh
@@ -5,7 +5,7 @@ echo "Test if the error message contains non ambiguous prototype names"
expected="Slot \`toto' not found in \`AMBIGUOUS_PROTONAME.PROTO'."
-out="$(lisaac 2>&1)"
+out="$(lisaac -partial 2>&1)"
grep -q "$expected" <<<"$out" || \
{
echo
diff --git a/tests/boolean_test3.li b/tests/boolean_test3/boolean_test3.li
similarity index 100%
rename from tests/boolean_test3.li
rename to tests/boolean_test3/boolean_test3.li
diff --git a/tests/boolean_test3/test.sh b/tests/boolean_test3/test.sh
new file mode 100755
index 0000000..5ca40af
--- /dev/null
+++ b/tests/boolean_test3/test.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+
+echo "Test ( + b:BOOLEAN; b == TRUE) compiles"
+
+compile="$(lisaac boolean_test3 -partial 2>&1)" || {
+ echo
+ echo "$compile"
+ exit 1
+}
+
+exit 0
diff --git a/lib/guii/test.li b/tests/strict_type_parameter/dynamic_type.li
old mode 100755
new mode 100644
similarity index 75%
copy from lib/guii/test.li
copy to tests/strict_type_parameter/dynamic_type.li
index 7a31fd7..a92b2d6
--- a/lib/guii/test.li
+++ b/tests/strict_type_parameter/dynamic_type.li
@@ -18,28 +18,32 @@
// //
// http://isaacproject.u-strasbg.fr/ //
///////////////////////////////////////////////////////////////////////////////
+
Section Header
-
- + name := TEST;
- - copyright := "Jonathan Ponte, Maxime Audrin, Benoit Sonntag";
+ + name := DYNAMIC_TYPE;
+ - copyright := "2009 Mildred Ki'Lya <http://ki.lya.online.fr>";
+ - comment := "Test dynamic type";
- - comment := "Horizontal menu for GUII.";
-
-Section Inherit
-
- - parent_internal_inode:INTERNAL_INODE := INTERNAL_INODE;
-
Section Public
- - main<-
- (
- +bitmap:ABSTRACT_STRING;
+ - get_dynamic_type e:Strict E :E <- E;
+
+ - main <-
+ ( + s:ABSTRACT_STRING;
+ + t:ABSTRACT_STRING;
+
+ s := "test";
+ t := get_dynamic_type s;
- bitmap:="hello";
- (bitmap=NULL).if {
- "NULL\n".print;
+ "dynamic_type = ".print;
+ (t = ABSTRACT_STRING).if {
+ "ABSTRACT_STRING".println;
+ }.elseif {t = STRING} then {
+ "STRING".println;
+ }.elseif {t = STRING_CONSTANT} then {
+ "STRING_CONSTANT".println;
} else {
- "Pas NULL\n".print;
+ "???".println;
};
- );
\ No newline at end of file
+ );
diff --git a/tests/strict_type_parameter/test.sh b/tests/strict_type_parameter/test.sh
new file mode 100755
index 0000000..fbb27e8
--- /dev/null
+++ b/tests/strict_type_parameter/test.sh
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+
+echo "Test if a Strict parameter type gives you the dynamic type"
+
+expected="dynamic_type = STRING_CONSTANT"
+
+compile="$(lisaac dynamic_type -q -o out.exe 2>&1)" || {
+ echo
+ echo "$compile"
+ exit 1
+}
+
+out="$(./out.exe)"
+grep -q "$expected" <<<"$out" || \
+{
+ echo
+ echo "Expected: $expected"
+ echo "Got: $out"
+ exit 1
+}
+
+exit $?
--
Lisaac compiler
More information about the Lisaac-commits
mailing list