Skip to content

Commit

Permalink
completely merged checkxml and checkbtf (as well as many others) into…
Browse files Browse the repository at this point in the history
… validate
  • Loading branch information
grammarware committed May 31, 2012
1 parent 13a8a4c commit f9cdc37
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 70 deletions.
19 changes: 0 additions & 19 deletions shared/tools/checkbtf

This file was deleted.

21 changes: 0 additions & 21 deletions shared/tools/checkxml

This file was deleted.

2 changes: 1 addition & 1 deletion topics/comparison/Makefile
@@ -1,5 +1,5 @@
test:
ls -1 tests/*.bgf | xargs -n1 ../../shared/tools/checkxml bgf
ls -1 tests/*.bgf | xargs -n1 ../../shared/tools/validate bgf
../../shared/tools/gdt tests/foobar.pretty.bgf tests/foobar.ugly.bgf
! ../../shared/tools/gdt tests/foobar.pretty.bgf tests/foobar.term.bgf
../../shared/tools/gdt tests/foo.b.a.r.bgf tests/foo.b.r.a.bgf
Expand Down
2 changes: 1 addition & 1 deletion topics/convergence/mbgf/tests/m1
Expand Up @@ -3,7 +3,7 @@
# m1 file.mbgf one two
# $0 $1 $2 $3
rm -f tmp.xbgf tmp1.bgf
../../tri/mbgf2xbgf.py $1 $2 $3 tmp.xbgf
../mbgf2xbgf.py $1 $2 $3 tmp.xbgf
xbgf tmp.xbgf `xpath $1 'mbgf:sequence/sources/src[@name="'$2'"]/text()' 2> /dev/null` tmp1.bgf
gdt tmp1.bgf `xpath $1 'mbgf:sequence/sources/src[@name="'$3'"]/text()' 2> /dev/null` || exit -1
rm -f tmp.xbgf tmp1.bgf
10 changes: 0 additions & 10 deletions topics/convergence/mbgf/tests/testperform
Expand Up @@ -7,13 +7,3 @@ echo [Test MBGF] `basename $1 .mbgf`
./m1 $1 b c
./m1 $1 c a
./m1 $1 c b

#
#
#
# rm -f `basename $1 .xbgf`.log
# touch `basename $1 .xbgf`.log
# ../../../../shared/tools/checkxml bgf `basename $1 .xbgf`.bgf || exit -1
# ../../../../shared/tools/checkxml xbgf `basename $1 .xbgf`.xbgf || exit -1
# ../../../../shared/tools/xbgf `basename $1 .xbgf`.xbgf `basename $1 .xbgf`.bgf `basename $1 .xbgf`.out || exit -1
# ../../../../shared/tools/gdt `basename $1 .xbgf`.out `basename $1 .xbgf`.baseline || exit -1
2 changes: 1 addition & 1 deletion topics/mutation/subgrammar/testperform
Expand Up @@ -2,5 +2,5 @@

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/validate bgf fl.$1.bgf || exit -1
../../../shared/tools/gdt fl.$1.bgf tests/$1.baseline.bgf || exit -1
17 changes: 11 additions & 6 deletions topics/transformation/update/Makefile
Expand Up @@ -2,6 +2,11 @@ all:
make build
make test

check:
ls -1 tests/*/*.xbgf | xargs -n1 ../../../shared/tools/validate xbgf
ls -1 tests/*/*.bgf | xargs -n1 ../../../shared/tools/validate bgf
ls -1 tests/*/*.cbgf | xargs -n1 ../../../shared/tools/validate cbgf

build:
cp ../../convergence/xbgf/fl/snapshot/rascal.bgf tests/bad-f/g1.bgf
cp ../../convergence/xbgf/fl/snapshot/rascal.bgf tests/bad-d/g1.bgf
Expand All @@ -10,14 +15,14 @@ build:
cp ../../convergence/xbgf/fl/snapshot/rascal.bgf tests/incompatible/g1.bgf

test:
./testperform bad-f || echo "Ok"
./testperform bad-d || echo "Ok"
./testperform independent || echo "Ok"
./testperform input || echo "Ok"
./testperform incompatible || echo "Ok"
./testperform bad-f
./testperform bad-d
./testperform independent
./testperform input
./testperform incompatible

quiet:
make test 2> /dev/null | grep OUTCOME
make test | grep OUTCOME

clean:
rm -f tests/*/g?.bgf tests/*/*.cbgf tests/*/d-1*.xbgf
11 changes: 4 additions & 7 deletions topics/transformation/update/testperform
@@ -1,29 +1,26 @@
#!/bin/sh

echo [Test Update] $1
../../../shared/tools/checkxml xbgf tests/$1/f.xbgf || exit -1
../../../shared/tools/checkxml xbgf tests/$1/d.xbgf || exit -1
../../../shared/tools/checkxml bgf tests/$1/g1.bgf || exit -1
# let's try f of G1
../../../shared/tools/xbgf tests/$1/f.xbgf tests/$1/g1.bgf tests/$1/g2.bgf
if [ $? -ne 0 ]
then
echo "OUTCOME for $1: Impossible output — bad f."
exit -1
exit
fi
# let's try ∆ of G1
../../../shared/tools/xbgf tests/$1/d.xbgf tests/$1/g1.bgf tests/$1/g3.bgf
if [ $? -ne 0 ]
then
echo "OUTCOME for $1: Impossible output — incompatible ∆."
exit -1
exit
fi
# let's try f of ∆ of G1 and ∆ of f of G1
../../../shared/tools/xbgf tests/$1/f.xbgf tests/$1/g3.bgf tests/$1/g4.bgf && ../../../shared/tools/xbgf tests/$1/d.xbgf tests/$1/g2.bgf tests/$1/g5.bgf && gdt tests/$1/g4.bgf tests/$1/g5.bgf
if [ $? -eq 0 ]
then
echo "OUTCOME for $1: f and ∆ are independent; any composition is valid."
exit -1
exit
fi
# let's try f of ∆ of G1 and ∆ of f of G1
../../../shared/tools/xbgf2cbgf tests/$1/d.xbgf tests/$1/d.cbgf tests/$1/g1.bgf
Expand All @@ -33,6 +30,6 @@ fi
if [ $? -eq 0 ]
then
echo "OUTCOME for $1: ∆ messes with input of f; a composition with reversed ∆ is valid."
exit -1
exit
fi
echo "OUTCOME for $1: f and ∆ are incompatible."
4 changes: 2 additions & 2 deletions topics/transformation/xbgf/tests/testperform
Expand Up @@ -3,7 +3,7 @@
echo [Test XBGF] `basename $1 .xbgf`
rm -f `basename $1 .xbgf`.log
touch `basename $1 .xbgf`.log
../../../../shared/tools/checkxml bgf `basename $1 .xbgf`.bgf || exit -1
../../../../shared/tools/checkxml xbgf `basename $1 .xbgf`.xbgf || exit -1
../../../../shared/tools/validate bgf `basename $1 .xbgf`.bgf || exit -1
../../../../shared/tools/validate xbgf `basename $1 .xbgf`.xbgf || exit -1
../../../../shared/tools/xbgf `basename $1 .xbgf`.xbgf `basename $1 .xbgf`.bgf `basename $1 .xbgf`.out || exit -1
../../../../shared/tools/gdt `basename $1 .xbgf`.out `basename $1 .xbgf`.baseline || exit -1
4 changes: 2 additions & 2 deletions topics/transformation/xbgf/tests/testthorough
Expand Up @@ -3,8 +3,8 @@
echo [Test XBGF] `basename $1 .xbgf`
rm -f `basename $1 .xbgf`.log
touch `basename $1 .xbgf`.log
../../../../shared/tools/checkxml bgf `basename $1 .xbgf`.bgf >> `basename $1 .xbgf`.log 2>&1 || exit -1
../../../../shared/tools/checkxml xbgf `basename $1 .xbgf`.xbgf >> `basename $1 .xbgf`.log 2>&1 || exit -1
../../../../shared/tools/validate bgf `basename $1 .xbgf`.bgf >> `basename $1 .xbgf`.log 2>&1 || exit -1
../../../../shared/tools/validate xbgf `basename $1 .xbgf`.xbgf >> `basename $1 .xbgf`.log 2>&1 || exit -1
../../../../shared/tools/showbgf `basename $1 .xbgf`.bgf >> `basename $1 .xbgf`.log 2>&1 || exit -1
../../../../shared/tools/showxbgf `basename $1 .xbgf`.xbgf >> `basename $1 .xbgf`.log 2>&1 || exit -1
../../../../shared/tools/xbgf `basename $1 .xbgf`.xbgf `basename $1 .xbgf`.bgf `basename $1 .xbgf`.out >> `basename $1 .xbgf`.log 2>&1 || exit -1
Expand Down

0 comments on commit f9cdc37

Please sign in to comment.