This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 688f1ee40a27f38bc410f23bfb9e3b2a1feed6a0 (commit)
from d64add4185ab48f67c70dff941e0143aa72fe0ae (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/688f1ee40a27f38bc410f23bfb9e3b2a1feed6a0
commit 688f1ee40a27f38bc410f23bfb9e3b2a1feed6a0
Author: Jim Meyering <meyering(a)redhat.com>
Date: Tue Oct 5 17:07:25 2010 +0200
tests: exercise the parser
* t/Makefile.am: Add rules/code to generate parser.c and to
run the new test.
* t/parser-test: New file. I/O pairs from Jeff Darcy.
diff --git a/t/Makefile.am b/t/Makefile.am
index f68e661..8099177 100644
--- a/t/Makefile.am
+++ b/t/Makefile.am
@@ -15,13 +15,28 @@
# along with this program. If not, see <
http://www.gnu.org/licenses/>.
TESTS = - basic
+ basic + parser-test
EXTRA_DIST = $(TESTS) init.cfg init.sh
+check_PROGRAMS = parser
+
+BUILT_SOURCES =
+BUILT_SOURCES += parser.c
+MAINTAINERCLEANFILES = $(BUILT_SOURCES)
+parser_CPPFLAGS = -I $(top_srcdir)
+
+parser.c: Makefile.am
+ rm -f $@-t $@
+ printf '#define UNIT_TEST 1n' > $@-t
+ printf '#include "query.c"n' >> $@-t
+ chmod a=r $@-t
+ mv $@-t $@
+
TESTS_ENVIRONMENT = tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.;
TMPDIR=$$tmp__; export TMPDIR; diff --git a/t/parser-test b/t/parser-test
new file mode 100755
index 0000000..9d0a6c8
--- /dev/null
+++ b/t/parser-test
@@ -0,0 +1,36 @@
+#!/bin/sh
+# exercise the parser
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+
+cat <<EOF > f.exp || framework_failure_
+AND
+ COMPARISON
+ SERVER FIELD a (never)
+ STRING fubar
+ NOT
+ COMPARISON
+ LINK
+ LINK
+ OBJECT FIELD b (7)
+ DEST FIELD c
+ DEST FIELD d
+ NUMBER 3
+d= 0
+EOF
+
+parser '#a=="fubar"&&!($b.c.d<3)' > features 2> err ||
fail=1
+compare features f.exp
+compare /dev/null err
+
+parser '#a == "fubar" && ! ( $b.c.d < 3)' > white-space
2> err || fail=1
+compare white-space f.exp
+compare /dev/null err
+
+parser '$ a' > e1.out 2>&1; test $? = 1 || fail=1
+printf "could not parse '$ a'n" > e1.exp
+compare e1.exp e1.out
+
+parser '1 = = 1' > e2.out 2>&1; test $? = 1 || fail=1
+printf "could not parse '1 = = 1'n" > e2.exp
+compare e2.exp e2.out
-----------------------------------------------------------------------
Summary of changes:
t/Makefile.am | 17 ++++++++++++++++-
t/parser-test | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 1 deletions(-)
create mode 100755 t/parser-test
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")