Permalink
Browse files

better testing: failing immediately after the unsuccessful test case;

the subgrammar handy script


git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@891 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information...
grammarware committed Dec 7, 2010
1 parent f874a2b commit 2da639c110cf3d395dc13b5d29e76f2dd55899e6
Showing with 25 additions and 6 deletions.
  1. +18 −0 shared/tools/subgrammar
  2. +1 −6 topics/presentation/subgrammar/Makefile
  3. +6 −0 topics/presentation/subgrammar/testperform
View
@@ -0,0 +1,18 @@
#!/bin/sh
LOCAL=${PWD}
cd `dirname $0`
cd ../..
SLPS=${PWD}
cd ${LOCAL}
if [ $# -ne 3 ]; then
echo "This tool extracts a portion of a grammar that starts at a given root nonterminal and includes all referenced nonterminals as well."
echo "Usage: subgrammar <bgf-input> <new-root> <bgf-output>"
exit 1
elif [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
fi
${SLPS}/topics/presentation/subgrammar/subgrammar.py $1 $2 $3
@@ -1,11 +1,6 @@
test:
../../../shared/tools/xsd2bgf ../../fl/xsd/fl.xsd fl.bgf
echo 'Executing test cases...'
ls -1 tests/ | xargs -n1 -I _ basename _ .baseline.bgf | xargs -n1 -I _ ./subgrammar.py fl.bgf _ fl._.bgf
echo 'Syntax checking test results...'
ls -1 *.bgf | xargs -n1 checkxml bgf
echo 'Validating test results...'
ls -1 tests/ | xargs -n1 -I _ basename _ .baseline.bgf | xargs -n1 -I _ ../../../shared/tools/gdt fl._.bgf tests/_.baseline.bgf
ls -1 tests/ | xargs -n1 -I _ basename _ .baseline.bgf | xargs -n1 ./testperform
clean:
rm -f *.bgf
@@ -0,0 +1,6 @@
#!/bin/sh
echo [Test Case] $1
./subgrammar.py fl.bgf $1 fl.$1.bgf || exit -1
../../../shared/tools/checkxml bgf fl.$1.bgf || exit -1
../../../shared/tools/gdt fl.$1.bgf tests/$1.baseline.bgf || exit -1

0 comments on commit 2da639c

Please sign in to comment.