Move testsuite/compiler/canonical on level up, update test script
This commit is contained in:
1 parent
0f5be0bbaa
commit
4436cb101e
22 files changed
+42
-23
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Executable
+42
@@ -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