Skip to content

Commit

Permalink
Add ixml parses itself test.
Browse files Browse the repository at this point in the history
  • Loading branch information
weetmuts committed Dec 8, 2024
1 parent e442554 commit 7f60653
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ fi
rm -rf "$OUTPUT"
mkdir -p "$OUTPUT"

tests/test_grammars.sh "$PROG" "$OUTPUT" || (echo "Testing aborted" ; exit 1)

for i in tests/ixml_grammar_[0-9][0-9][0-9]_*.test
do
if [ -n $FILTER ] && [[ ! "$i" =~ $FILTER ]]; then continue; fi
Expand Down
23 changes: 23 additions & 0 deletions tests/test_grammars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
# libxmq - Copyright 2024 Fredrik Öhrström (spdx: MIT)

PROG=$1
OUTPUT=$2

if [ -z "$OUTPUT" ] || [ -z "$PROG" ]
then
echo "Usage: tests/test_grammars.sh [XMQ_BINARY] [OUTPUT_DIR]"
exit 1
fi

mkdir -p $OUTPUT

$PROG --ixml=grammars/core/ixml.ixml grammars/core/ixml.ixml > $OUTPUT/ixml.output 2>/dev/null
$PROG grammars/core/ixml.xml > $OUTPUT/ixml.expected 2>/dev/null
if diff $OUTPUT/ixml.output $OUTPUT/ixml.expected
then
echo "OK: test ixml.ixml"
else
echo "ERR: Failed to parse ixml.ixml"
exit 1
fi

0 comments on commit 7f60653

Please sign in to comment.