summaryrefslogtreecommitdiff
path: root/test/runtests.in
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2015-09-08 19:35:02 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2015-12-04 13:41:28 +0900
commite18d79d3062a776f5898ab3f83fd4ec0d1abb105 (patch)
tree709cf04a097c05823e6610e735c742641d384e4d /test/runtests.in
parent17ed260cfad50c82495daeca85d52bbb243cd2a2 (diff)
downloadragel-e18d79d3062a776f5898ab3f83fd4ec0d1abb105.tar.gz
ragel-e18d79d3062a776f5898ab3f83fd4ec0d1abb105.tar.bz2
ragel-e18d79d3062a776f5898ab3f83fd4ec0d1abb105.zip
Change-Id: Ic8161a63cda6242edf910c9808e0fd5a8953cb27 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'test/runtests.in')
-rwxr-xr-xtest/runtests.in42
1 files changed, 33 insertions, 9 deletions
diff --git a/test/runtests.in b/test/runtests.in
index d331f77..8eb91ed 100755
--- a/test/runtests.in
+++ b/test/runtests.in
@@ -18,9 +18,10 @@
#
# You should have received a copy of the GNU General Public License
# along with Ragel; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+TEST_LOG="/tmp/ragel_test"
-while getopts "gcnmleT:F:G:P:CDJRA" opt; do
+while getopts "gcnmleT:F:G:P:CDJRAZ" opt; do
case $opt in
T|F|G|P)
genflags="$genflags -$opt$OPTARG"
@@ -37,7 +38,7 @@ while getopts "gcnmleT:F:G:P:CDJRA" opt; do
g)
allow_generated="true"
;;
- C|D|J|R|A)
+ C|D|J|R|A|Z)
langflags="$langflags -$opt"
;;
esac
@@ -45,13 +46,13 @@ done
[ -z "$minflags" ] && minflags="-n -m -l -e"
[ -z "$genflags" ] && genflags="-T0 -T1 -F0 -F1 -G0 -G1 -G2"
-[ -z "$langflags" ] && langflags="-C -D -J -R -A"
+[ -z "$langflags" ] && langflags="-C -D -J -R -A -Z"
shift $((OPTIND - 1));
[ -z "$*" ] && set -- *.rl
-config=../ragel/config.h
+config=../src/config.h
ragel=../ragel/ragel
cxx_compiler="@CXX@"
@@ -62,6 +63,7 @@ java_compiler="@JAVAC@"
txl_engine="@TXL@"
ruby_engine="@RUBY@"
csharp_compiler="@GMCS@"
+go_compiler="@GOBIN@"
function test_error
{
@@ -124,9 +126,10 @@ function run_test()
$exec_cmd 2>&1 > $output;
if diff --strip-trailing-cr $expected_out $output > /dev/null; then
echo "passed";
+ echo "TEST: PASS: $root" >> $TEST_LOG;
else
- echo "FAILED";
- test_error;
+ echo "FAILED";
+ echo "TEST: FAIL: $root" >> $TEST_LOG;
fi;
fi
}
@@ -203,18 +206,25 @@ for test_case; do
compiler=$csharp_compiler
cflags=""
;;
+ go)
+ lang_opt="-Z"
+ code_suffix=go
+ compiler=$go_compiler
+ cflags=""
+ ;;
indep)
lang_opt="";
# If we have no txl engine then skip this test.
[ -z "$txl_engine" ] && continue
- for lang in c d java ruby csharp; do
+ for lang in c d java ruby csharp go; do
case $lang in
c) lf="-C";;
d) lf="-D";;
java) lf="-J";;
ruby) lf="-R";;
csharp) lf="-A";;
+ go) lf="-Z";;
esac
echo "$langflags" | grep -e $lf >/dev/null || continue
@@ -308,6 +318,20 @@ for test_case; do
done
done
;;
- esac
+ go)
+ # Using genflags, get the allowed gen flags from the test case. If the
+ # test case doesn't specify assume that all gen flags are allowed.
+ allow_genflags=`sed '/@ALLOW_GENFLAGS:/s/^.*: *//p;d' $test_case`
+ [ -z "$allow_genflags" ] && allow_genflags="-T0 -T1 -F0 -F1 -G0 -G1 -G2"
+
+ for min_opt in $minflags; do
+ echo "$allow_minflags" | grep -e $min_opt >/dev/null || continue
+ for gen_opt in $genflags; do
+ echo "$allow_genflags" | grep -e $gen_opt >/dev/null || continue
+ run_test
+ done
+ done
+ ;;
+ esac
done