Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: gperf/src/gperf/3.0.1/gperf-3.0.1-src/tests/validate

Issue 10804012: Add native Windows binary for gperf. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gperf/src/gperf/3.0.1/gperf-3.0.1-src/tests/test2.c ('k') | gperf/src/gperf/3.0.1/gperf-3.0.1/Makefile » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gperf/src/gperf/3.0.1/gperf-3.0.1-src/tests/validate
===================================================================
--- gperf/src/gperf/3.0.1/gperf-3.0.1-src/tests/validate (revision 0)
+++ gperf/src/gperf/3.0.1/gperf-3.0.1-src/tests/validate (revision 0)
@@ -0,0 +1,62 @@
+#! /bin/sh
+# Validate gperf's operation on a given input file.
+# Usage: validate languages input.gperf [more gperf options]
+# Uses the environment variables GPERF, CC, CFLAGS, CXX, CXXFLAGS.
+# Supposes gcc and g++.
+
+# Exit on error
+set -e
+
+verbose () {
+ echo "$@"
+ "$@"
+}
+
+languages=$1
+shift
+
+# On old systems, it's worth trying gcc -traditional.
+# On glibc-2.1 systems, gcc -traditional doesn't work any more.
+use_traditional=false
+
+for lang in `echo $languages | sed -e 's/,/ /g'`; do
+ case "$lang" in
+ KR-C )
+ echo "${GPERF} -I -L KR-C $@ > valitest.c"
+ ${GPERF} -I -L KR-C "$@" > valitest.c
+ grep -n ' const ' valitest.c /dev/null && exit 1
+ if test $use_traditional = true; then
+ verbose ${CC} ${CFLAGS} -traditional valitest.c -o valitest
+ ./valitest
+ fi
+ verbose ${CC} ${CFLAGS} -ansi -pedantic valitest.c -o valitest
+ ./valitest
+ ;;
+ C )
+ echo "${GPERF} -I -L C $@ > valitest.c"
+ ${GPERF} -I -L C "$@" > valitest.c
+ if test $use_traditional = true; then
+ verbose ${CC} ${CFLAGS} -traditional -Dconst= valitest.c -o valitest
+ ./valitest
+ fi
+ verbose ${CC} ${CFLAGS} -ansi -pedantic -pedantic-errors valitest.c -o valitest
+ ./valitest
+ ;;
+ ANSI-C )
+ echo "${GPERF} -I -L ANSI-C $@ > valitest.c"
+ ${GPERF} -I -L ANSI-C "$@" > valitest.c
+ verbose ${CC} ${CFLAGS} -ansi -pedantic -pedantic-errors valitest.c -o valitest
+ ./valitest
+ verbose ${CXX} ${CXXFLAGS} -ansi -pedantic -pedantic-errors valitest.c -o valitest
+ ./valitest
+ ;;
+ "C++" )
+ echo "${GPERF} -I -L C++ $@ > valitest.c"
+ ${GPERF} -I -L C++ "$@" > valitest.c
+ verbose ${CXX} ${CXXFLAGS} -ansi -pedantic -pedantic-errors -DCPLUSPLUS_TEST valitest.c -o valitest
+ ./valitest
+ ;;
+ esac
+done
+
+exit 0
« no previous file with comments | « gperf/src/gperf/3.0.1/gperf-3.0.1-src/tests/test2.c ('k') | gperf/src/gperf/3.0.1/gperf-3.0.1/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698