diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2015-09-08 19:35:02 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2015-12-04 13:41:28 +0900 |
commit | e18d79d3062a776f5898ab3f83fd4ec0d1abb105 (patch) | |
tree | 709cf04a097c05823e6610e735c742641d384e4d /test | |
parent | 17ed260cfad50c82495daeca85d52bbb243cd2a2 (diff) | |
download | ragel-accepted/tizen/wearable/20151223.105009.tar.gz ragel-accepted/tizen/wearable/20151223.105009.tar.bz2 ragel-accepted/tizen/wearable/20151223.105009.zip |
Bump to 6.8upstream/6.8submit/tizen_ivi/20160217.000007submit/tizen_ivi/20160217.000000submit/tizen_common/20151229.154718submit/tizen_common/20151229.144031submit/tizen_common/20151229.142028submit/tizen/20151223.035251accepted/tizen/wearable/20151223.105009accepted/tizen/tv/20151223.104924accepted/tizen/mobile/20151223.104855accepted/tizen/ivi/20160218.025832accepted/tizen_wearableaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_ivi
Change-Id: Ic8161a63cda6242edf910c9808e0fd5a8953cb27
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 3 | ||||
-rw-r--r-- | test/Makefile.in | 479 | ||||
-rw-r--r-- | test/atoi1.rl | 2 | ||||
-rw-r--r-- | test/atoi2.rl | 2 | ||||
-rw-r--r-- | test/cond7.rl | 4 | ||||
-rw-r--r-- | test/cppscan6.rl | 2 | ||||
-rw-r--r-- | test/langtrans_c.txl | 18 | ||||
-rw-r--r-- | test/langtrans_csharp.txl | 18 | ||||
-rw-r--r-- | test/langtrans_d.txl | 18 | ||||
-rw-r--r-- | test/langtrans_java.txl | 18 | ||||
-rw-r--r-- | test/langtrans_ruby.txl | 18 | ||||
-rwxr-xr-x | test/runtests.in | 42 | ||||
-rw-r--r-- | test/testcase.txl | 1 |
13 files changed, 605 insertions, 20 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index f49c9c1..e27bd5b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -42,4 +42,5 @@ EXTRA_DIST = \ CLEANFILES = \ *.c *.cpp *.m *.d *.java *.bin *.class *.exp \ - *.out *_c.rl *_d.rl *_java.rl *_ruby.rl *_csharp.rl *.cs *.exe + *.out *_c.rl *_d.rl *_java.rl *_ruby.rl *_csharp.rl *.cs \ + *_go.rl *.go *.exe diff --git a/test/Makefile.in b/test/Makefile.in new file mode 100644 index 0000000..a9b2e93 --- /dev/null +++ b/test/Makefile.in @@ -0,0 +1,479 @@ +# Makefile.in generated by automake 1.11.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright 2002-2009 Adrian Thurston <thurston@complang.org> +# + +# This file is part of Ragel. +# +# Ragel is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Ragel is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# 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 +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/runtests.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/ragel/config.h +CONFIG_CLEAN_FILES = runtests +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__tty_colors = \ +red=; grn=; lgn=; blu=; std= +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +FIG2DEV = @FIG2DEV@ +GDC = @GDC@ +GMCS = @GMCS@ +GOBIN = @GOBIN@ +GOBJC = @GOBJC@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JAVAC = @JAVAC@ +KELBT = @KELBT@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PDFLATEX = @PDFLATEX@ +PUBDATE = @PUBDATE@ +RAGEL = @RAGEL@ +RANLIB = @RANLIB@ +RUBY = @RUBY@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TXL = @TXL@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TESTS = runtests +EXTRA_DIST = \ + atoi1.rl clang2.rl cond7.rl element3.rl erract8.rl forder3.rl java1.rl \ + range.rl scan3.rl xml.rl atoi2.rl clang3.rl cppscan1.rl eofact.rl \ + erract9.rl gotocallret1.rl java2.rl recdescent1.rl scan4.rl atoi3.rl \ + clang4.rl cppscan2.rl erract1.rl export1.rl gotocallret2.rl keller1.rl \ + recdescent2.rl stateact1.rl awkemu.rl cond1.rl cppscan3.rl erract2.rl \ + export2.rl high1.rl lmgoto.rl recdescent3.rl statechart1.rl builtin.rl \ + cond2.rl cppscan4.rl erract3.rl export3.rl high2.rl mailbox1.rl \ + repetition.rl strings1.rl call1.rl cond3.rl cppscan5.rl erract4.rl \ + export4.rl high3.rl mailbox2.rl rlscan.rl strings2.rl call2.rl cond4.rl \ + cppscan6.rl erract5.rl fnext1.rl import1.rl mailbox3.rl ruby1.rl \ + tokstart1.rl call3.rl cond5.rl element1.rl erract6.rl forder1.rl \ + include1.rl minimize1.rl scan1.rl union.rl clang1.rl cond6.rl \ + element2.rl erract7.rl forder2.rl include2.rl patact.rl scan2.rl \ + xmlcommon.rl langtrans_c.sh langtrans_csharp.sh langtrans_d.sh \ + langtrans_java.sh langtrans_ruby.sh checkeofact.txl \ + langtrans_csharp.txl langtrans_c.txl langtrans_d.txl langtrans_java.txl \ + langtrans_ruby.txl testcase.txl cppscan1.h eofact.h mailbox1.h strings2.h + +CLEANFILES = \ + *.c *.cpp *.m *.d *.java *.bin *.class *.exp \ + *.out *_c.rl *_d.rl *_java.rl *_ruby.rl *_csharp.rl *.cs \ + *_go.rl *.go *.exe + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +runtests: $(top_builddir)/config.status $(srcdir)/runtests.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + $(am__tty_colors); \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + col=$$red; res=XPASS; \ + ;; \ + *) \ + col=$$grn; res=PASS; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + col=$$lgn; res=XFAIL; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + col=$$red; res=FAIL; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + col=$$blu; res=SKIP; \ + fi; \ + echo "$${col}$$res$${std}: $$tst"; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + if test "$$failed" -eq 0; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + fi; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + distclean distclean-generic distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ + uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/test/atoi1.rl b/test/atoi1.rl index ea706c8..013348e 100644 --- a/test/atoi1.rl +++ b/test/atoi1.rl @@ -19,7 +19,7 @@ neg = false; } action add_digit { - val = val * 10 + (fc - 48); + val = val * 10 + <int>(fc - 48); } action finish { diff --git a/test/atoi2.rl b/test/atoi2.rl index 923e88f..9f17c69 100644 --- a/test/atoi2.rl +++ b/test/atoi2.rl @@ -20,7 +20,7 @@ neg = false; } action add_digit { - val = val * 10 + (fc - 48); + val = val * 10 + <int>(fc - 48); } action finish { diff --git a/test/cond7.rl b/test/cond7.rl index 3951af0..a88e67c 100644 --- a/test/cond7.rl +++ b/test/cond7.rl @@ -11,14 +11,14 @@ int c; action testi {i > 0} action inc { i = i - 1; - c = fc; + c = <int>(fc); prints "item: "; printi c; prints "\n"; } count = [0-9] @{ - i = fc - '0'; + i = <int>(fc - '0'); prints "count: "; printi i; prints "\n"; diff --git a/test/cppscan6.rl b/test/cppscan6.rl index ed82fe6..ad2d266 100644 --- a/test/cppscan6.rl +++ b/test/cppscan6.rl @@ -266,7 +266,7 @@ int token; # Single char symbols. ( punct - [_"'] ) => { - token = first_token_char; + token = <int>(first_token_char); prints "<"; printi token; prints "> "; diff --git a/test/langtrans_c.txl b/test/langtrans_c.txl index e80e508..5a4971f 100644 --- a/test/langtrans_c.txl +++ b/test/langtrans_c.txl @@ -122,11 +122,27 @@ function alStmtToC1 AlStmt [action_lang_stmt] Result end function -function alTermToC +rule alTermToC1 replace [al_term] 'first_token_char by 'ts '[0] +end rule + +rule alTermToC2 + replace [al_term] + '< _ [al_type_decl] '> '( AlExpr [al_expr] ') + by + '( AlExpr ') +end rule + +function alTermToC + replace [al_term] + AlTerm [al_term] + by + AlTerm + [alTermToC1] + [alTermToC2] end function function alExprExtendToC AlExprExtend [repeat al_expr_extend] diff --git a/test/langtrans_csharp.txl b/test/langtrans_csharp.txl index cf4a2c1..a8c6003 100644 --- a/test/langtrans_csharp.txl +++ b/test/langtrans_csharp.txl @@ -125,11 +125,27 @@ function alStmtToCSharp1 AlStmt [action_lang_stmt] Result end function -function alTermToCSharp +rule alTermToCSharp1 replace [al_term] 'first_token_char by 'data '[ts] +end rule + +rule alTermToCSharp2 + replace [al_term] + '< _ [al_type_decl] '> '( AlExpr [al_expr] ') + by + '( AlExpr ') +end rule + +function alTermToCSharp + replace [al_term] + AlTerm [al_term] + by + AlTerm + [alTermToCSharp1] + [alTermToCSharp2] end function function alExprExtendToCSharp AlExprExtend [repeat al_expr_extend] diff --git a/test/langtrans_d.txl b/test/langtrans_d.txl index 3d8b8a7..845a003 100644 --- a/test/langtrans_d.txl +++ b/test/langtrans_d.txl @@ -95,11 +95,27 @@ function alStmtToD1 AlStmt [action_lang_stmt] Result end function -function alTermToD +rule alTermToD1 replace [al_term] 'first_token_char by 'ts '[0] +end rule + +rule alTermToD2 + replace [al_term] + '< _ [al_type_decl] '> '( AlExpr [al_expr] ') + by + '( AlExpr ') +end rule + +function alTermToD + replace [al_term] + AlTerm [al_term] + by + AlTerm + [alTermToD1] + [alTermToD2] end function function alExprExtendToD AlExprExtend [repeat al_expr_extend] diff --git a/test/langtrans_java.txl b/test/langtrans_java.txl index 8016ab2..c5cde5d 100644 --- a/test/langtrans_java.txl +++ b/test/langtrans_java.txl @@ -132,11 +132,27 @@ function alStmtToJava1 AlStmt [action_lang_stmt] Result end function -function alTermToJava +rule alTermToJava1 replace [al_term] 'first_token_char by 'data '[ts] +end rule + +rule alTermToJava2 + replace [al_term] + '< _ [al_type_decl] '> '( AlExpr [al_expr] ') + by + '( AlExpr ') +end rule + +function alTermToJava + replace [al_term] + AlTerm [al_term] + by + AlTerm + [alTermToJava1] + [alTermToJava2] end function function alExprExtendToJava AlExprExtend [repeat al_expr_extend] diff --git a/test/langtrans_ruby.txl b/test/langtrans_ruby.txl index 265426f..42f203d 100644 --- a/test/langtrans_ruby.txl +++ b/test/langtrans_ruby.txl @@ -140,11 +140,27 @@ function alStmtToRuby1 AlStmt [action_lang_stmt] [initDecl5 VarDecl] end function -function alTermToRuby +rule alTermToRuby1 replace [al_term] 'first_token_char by 'data '[ts] +end rule + +rule alTermToRuby2 + replace [al_term] + '< _ [al_type_decl] '> '( AlExpr [al_expr] ') + by + '( AlExpr ') +end rule + +function alTermToRuby + replace [al_term] + AlTerm [al_term] + by + AlTerm + [alTermToRuby1] + [alTermToRuby2] end function function alExprExtendToRuby AlExprExtend [repeat al_expr_extend] 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 diff --git a/test/testcase.txl b/test/testcase.txl index 3369c15..65d7912 100644 --- a/test/testcase.txl +++ b/test/testcase.txl @@ -127,6 +127,7 @@ define al_term_base | 'true | 'false | '( [al_expr] ') + | '< [SPOFF] [al_type_decl] '> '( [SPON] [al_expr] ') | 'first_token_char end define |