From: helly Date: Thu, 13 Mar 2008 17:32:12 +0000 (+0000) Subject: - Add 'make vtest' which triggers valgrind testing and use it prior to X-Git-Tag: 0.13.6~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88e83a8c2e3f2e9f89f2ca54777940e3156cae88;p=re2c - Add 'make vtest' which triggers valgrind testing and use it prior to releasing. The normal 'make test' no longer triggers valgrind testing. --- diff --git a/re2c/Makefile.am b/re2c/Makefile.am index e91b8712..e332e59e 100755 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = parser.cc scanner.cc man_MANS = re2c.1 #CXXFLAGS = -O2 -Wall -Wno-unused -Wno-parentheses -Wno-deprecated -#CXXFLAGS = -O2 -Wall -Wextra -pedantic -Wconversion -Wpointer-arith -Wwrite-strings -Wredundant-decls -Werror -Wunused-function -DPEDANTIC +#CXXFLAGS = -ggdb -fno-inline -O2 -Wall -Wextra -pedantic -Wconversion -Wpointer-arith -Wwrite-strings -Wredundant-decls -Werror -Wunused-function -DPEDANTIC YFLAGS = -d RE2C = re2c$(EXEEXT) @@ -26,7 +26,7 @@ EXTRA_SRC = $(man_MANS) README parser.y scanner.re y.tab.h CHANGELOG \ EXTRA_DIST = $(EXTRA_SRC) makerpm.in re2c.spec.in re2c.spec README.in config_w32.h.in EXTRA_ZIP = $(EXTRA_SRC) config_w32.h *.sln *.vcproj re2c.rules -dist-hook: re2c.spec +dist-hook: vtest re2c.spec rm -rf `find $(distdir)/doc -name .svn` rm -rf `find $(distdir)/examples -name .svn` rm -rf `find $(distdir)/test -name .svn -o -name .cvsignore` @@ -85,3 +85,7 @@ TESTS = run_tests.sh test: all $(TESTS) test -x $(TESTS) || chmod +x $(TESTS) ./$(TESTS) + +vtest: all $(TESTS) + test -x $(TESTS) || chmod +x $(TESTS) + ./$(TESTS) --valgrind diff --git a/re2c/run_tests.sh.in b/re2c/run_tests.sh.in index 0fea9d58..beb3b89b 100644 --- a/re2c/run_tests.sh.in +++ b/re2c/run_tests.sh.in @@ -3,21 +3,27 @@ _XPG=1 result=0 errcnt=0 tstcnt=0; +if test "$1" == "--valgrind"; then +valgrind=`which valgrind` +shift +else +valgrind= +fi diff -u $0 $0 >/dev/null 2>&1 && diff='diff -u' || diff='diff' #diff="${diff} -I '#line [0-9]*'" if uname|grep -q -i 'CYGWIN' && test -x "@WINBUILDDIR@/re2c.exe"; then re2c='@WINBUILDDIR@/re2c.exe' else -valgrind=`which valgrind` -if test -n "${valgrind}"; then - valgrind="${valgrind} -q " - echo "Using valgrind" -fi -re2c="${valgrind}@builddir@/re2c" +re2c='@builddir@/re2c' fi if test ! -x "${re2c}"; then echo "Cannot find re2c executable (${re2c})." fi +if test -n "${valgrind}"; then + valgrind="${valgrind} -q " + echo "Using valgrind" +fi +re2c="${valgrind}${re2c}" echo "Testing: ${re2c}" if ${re2c} -v|grep -q 're2c @PACKAGE_VERSION@ *\r*'; then echo "Version: @PACKAGE_VERSION@"