mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
Move testsuite/compiler/canonical on level up, update test script
This commit is contained in:
42
testsuite/canonical/run.sh
Executable file
42
testsuite/canonical/run.sh
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
FAILURES=0
|
||||||
|
|
||||||
|
# https://github.com/GrammaticalFramework/gf-core/issues/100
|
||||||
|
stack run -- --batch --output-format=canonical_gf grammars/PhrasebookBul.gf
|
||||||
|
stack run -- --batch canonical/PhrasebookBul.gf
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Canonical grammar doesn't compile: FAIL"
|
||||||
|
FAILURES=$((FAILURES+1))
|
||||||
|
else
|
||||||
|
echo "Canonical grammar compiles: OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# https://github.com/GrammaticalFramework/gf-core/issues/101
|
||||||
|
stack run -- --batch --output-format=canonical_gf grammars/PhrasebookGer.gf
|
||||||
|
for s in c2 objCtrl; do
|
||||||
|
grep VRead --after-context=216 canonical/PhrasebookGer.gf | grep "$s" > /dev/null
|
||||||
|
if [ $? -ne 1 ]; then
|
||||||
|
echo "Canonical grammar contains `$s`: FAIL"
|
||||||
|
FAILURES=$((FAILURES+1))
|
||||||
|
else
|
||||||
|
echo "Canonical grammar does not contain `$s`: OK"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# https://github.com/GrammaticalFramework/gf-core/issues/102
|
||||||
|
stack run -- --batch --output-format=canonical_gf grammars/FoodsFin.gf
|
||||||
|
diff canonical/FoodsFin.gf gold/FoodsFin.gf
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Canonical grammar doesn't match gold version: FAIL"
|
||||||
|
FAILURES=$((FAILURES+1))
|
||||||
|
else
|
||||||
|
echo "Canonical grammar matches gold version: OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $FAILURES -ne 0 ]; then
|
||||||
|
echo "Failures: $FAILURES"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "All tests passed"
|
||||||
|
fi
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
# https://github.com/GrammaticalFramework/gf-core/issues/100
|
|
||||||
stack run -- --batch --output-format=canonical_gf PhrasebookBul.gf
|
|
||||||
stack run -- --batch canonical/PhrasebookBul.gf
|
|
||||||
|
|
||||||
# https://github.com/GrammaticalFramework/gf-core/issues/101
|
|
||||||
stack run -- --batch --output-format=canonical_gf PhrasebookGer.gf
|
|
||||||
for s in c2 objCtrl; do
|
|
||||||
grep VRead --after-context=216 canonical/PhrasebookGer.gf | grep "$s" > /dev/null
|
|
||||||
if [ $? -ne 1 ]; then
|
|
||||||
echo "$s found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# https://github.com/GrammaticalFramework/gf-core/issues/102
|
|
||||||
stack run -- --batch --output-format=canonical_gf FoodsFin.gf
|
|
||||||
diff canonical/FoodsFin.gf ./FoodsFin.gf.gold
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Compiled grammar doesn't match gold version"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user