diff options
| author | John J. Camilleri <john@digitalgrammars.com> | 2021-06-30 13:47:15 +0200 |
|---|---|---|
| committer | John J. Camilleri <john@digitalgrammars.com> | 2021-06-30 13:47:15 +0200 |
| commit | 4436cb101e0756ad2a452fe81f0db2f18c14d60e (patch) | |
| tree | e7a68117571568dd5e82b70e5279aef904768f88 | |
| parent | 0f5be0bbaa862d2ccdb649eb6dd9fc5e26814e8a (diff) | |
Move testsuite/compiler/canonical on level up, update test script
| -rw-r--r-- | testsuite/canonical/.gitignore (renamed from testsuite/compiler/canonical/.gitignore) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/gold/FoodsFin.gf (renamed from testsuite/compiler/canonical/FoodsFin.gf.gold) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/Foods.gf (renamed from testsuite/compiler/canonical/Foods.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/FoodsFin.gf (renamed from testsuite/compiler/canonical/FoodsFin.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/FoodsI.gf (renamed from testsuite/compiler/canonical/FoodsI.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/Greetings.gf (renamed from testsuite/compiler/canonical/Greetings.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/GreetingsBul.gf (renamed from testsuite/compiler/canonical/GreetingsBul.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/GreetingsGer.gf (renamed from testsuite/compiler/canonical/GreetingsGer.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/LexFoods.gf (renamed from testsuite/compiler/canonical/LexFoods.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/LexFoodsFin.gf (renamed from testsuite/compiler/canonical/LexFoodsFin.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/Phrasebook.gf (renamed from testsuite/compiler/canonical/Phrasebook.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/PhrasebookBul.gf (renamed from testsuite/compiler/canonical/PhrasebookBul.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/PhrasebookGer.gf (renamed from testsuite/compiler/canonical/PhrasebookGer.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/Sentences.gf (renamed from testsuite/compiler/canonical/Sentences.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/SentencesBul.gf (renamed from testsuite/compiler/canonical/SentencesBul.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/SentencesGer.gf (renamed from testsuite/compiler/canonical/SentencesGer.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/SentencesI.gf (renamed from testsuite/compiler/canonical/SentencesI.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/Words.gf (renamed from testsuite/compiler/canonical/Words.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/WordsBul.gf (renamed from testsuite/compiler/canonical/WordsBul.gf) | 0 | ||||
| -rw-r--r-- | testsuite/canonical/grammars/WordsGer.gf (renamed from testsuite/compiler/canonical/WordsGer.gf) | 0 | ||||
| -rwxr-xr-x | testsuite/canonical/run.sh | 42 | ||||
| -rwxr-xr-x | testsuite/compiler/canonical/run.sh | 23 |
22 files changed, 42 insertions, 23 deletions
diff --git a/testsuite/compiler/canonical/.gitignore b/testsuite/canonical/.gitignore index 72988cf10..72988cf10 100644 --- a/testsuite/compiler/canonical/.gitignore +++ b/testsuite/canonical/.gitignore diff --git a/testsuite/compiler/canonical/FoodsFin.gf.gold b/testsuite/canonical/gold/FoodsFin.gf index 55c2fa6c9..55c2fa6c9 100644 --- a/testsuite/compiler/canonical/FoodsFin.gf.gold +++ b/testsuite/canonical/gold/FoodsFin.gf diff --git a/testsuite/compiler/canonical/Foods.gf b/testsuite/canonical/grammars/Foods.gf index aa68d4429..aa68d4429 100644 --- a/testsuite/compiler/canonical/Foods.gf +++ b/testsuite/canonical/grammars/Foods.gf diff --git a/testsuite/compiler/canonical/FoodsFin.gf b/testsuite/canonical/grammars/FoodsFin.gf index 962199805..962199805 100644 --- a/testsuite/compiler/canonical/FoodsFin.gf +++ b/testsuite/canonical/grammars/FoodsFin.gf diff --git a/testsuite/compiler/canonical/FoodsI.gf b/testsuite/canonical/grammars/FoodsI.gf index f4113b724..f4113b724 100644 --- a/testsuite/compiler/canonical/FoodsI.gf +++ b/testsuite/canonical/grammars/FoodsI.gf diff --git a/testsuite/compiler/canonical/Greetings.gf b/testsuite/canonical/grammars/Greetings.gf index 580b1560b..580b1560b 100644 --- a/testsuite/compiler/canonical/Greetings.gf +++ b/testsuite/canonical/grammars/Greetings.gf diff --git a/testsuite/compiler/canonical/GreetingsBul.gf b/testsuite/canonical/grammars/GreetingsBul.gf index f271d7717..f271d7717 100644 --- a/testsuite/compiler/canonical/GreetingsBul.gf +++ b/testsuite/canonical/grammars/GreetingsBul.gf diff --git a/testsuite/compiler/canonical/GreetingsGer.gf b/testsuite/canonical/grammars/GreetingsGer.gf index f027d70ac..f027d70ac 100644 --- a/testsuite/compiler/canonical/GreetingsGer.gf +++ b/testsuite/canonical/grammars/GreetingsGer.gf diff --git a/testsuite/compiler/canonical/LexFoods.gf b/testsuite/canonical/grammars/LexFoods.gf index 12ace208c..12ace208c 100644 --- a/testsuite/compiler/canonical/LexFoods.gf +++ b/testsuite/canonical/grammars/LexFoods.gf diff --git a/testsuite/compiler/canonical/LexFoodsFin.gf b/testsuite/canonical/grammars/LexFoodsFin.gf index 8b12f449f..8b12f449f 100644 --- a/testsuite/compiler/canonical/LexFoodsFin.gf +++ b/testsuite/canonical/grammars/LexFoodsFin.gf diff --git a/testsuite/compiler/canonical/Phrasebook.gf b/testsuite/canonical/grammars/Phrasebook.gf index 9ebc13106..9ebc13106 100644 --- a/testsuite/compiler/canonical/Phrasebook.gf +++ b/testsuite/canonical/grammars/Phrasebook.gf diff --git a/testsuite/compiler/canonical/PhrasebookBul.gf b/testsuite/canonical/grammars/PhrasebookBul.gf index bbc092963..bbc092963 100644 --- a/testsuite/compiler/canonical/PhrasebookBul.gf +++ b/testsuite/canonical/grammars/PhrasebookBul.gf diff --git a/testsuite/compiler/canonical/PhrasebookGer.gf b/testsuite/canonical/grammars/PhrasebookGer.gf index 69a61187c..69a61187c 100644 --- a/testsuite/compiler/canonical/PhrasebookGer.gf +++ b/testsuite/canonical/grammars/PhrasebookGer.gf diff --git a/testsuite/compiler/canonical/Sentences.gf b/testsuite/canonical/grammars/Sentences.gf index 6798c2127..6798c2127 100644 --- a/testsuite/compiler/canonical/Sentences.gf +++ b/testsuite/canonical/grammars/Sentences.gf diff --git a/testsuite/compiler/canonical/SentencesBul.gf b/testsuite/canonical/grammars/SentencesBul.gf index b2968bc85..b2968bc85 100644 --- a/testsuite/compiler/canonical/SentencesBul.gf +++ b/testsuite/canonical/grammars/SentencesBul.gf diff --git a/testsuite/compiler/canonical/SentencesGer.gf b/testsuite/canonical/grammars/SentencesGer.gf index cc0922d5f..cc0922d5f 100644 --- a/testsuite/compiler/canonical/SentencesGer.gf +++ b/testsuite/canonical/grammars/SentencesGer.gf diff --git a/testsuite/compiler/canonical/SentencesI.gf b/testsuite/canonical/grammars/SentencesI.gf index 913aa11ad..913aa11ad 100644 --- a/testsuite/compiler/canonical/SentencesI.gf +++ b/testsuite/canonical/grammars/SentencesI.gf diff --git a/testsuite/compiler/canonical/Words.gf b/testsuite/canonical/grammars/Words.gf index 08704990a..08704990a 100644 --- a/testsuite/compiler/canonical/Words.gf +++ b/testsuite/canonical/grammars/Words.gf diff --git a/testsuite/compiler/canonical/WordsBul.gf b/testsuite/canonical/grammars/WordsBul.gf index 527b3604a..527b3604a 100644 --- a/testsuite/compiler/canonical/WordsBul.gf +++ b/testsuite/canonical/grammars/WordsBul.gf diff --git a/testsuite/compiler/canonical/WordsGer.gf b/testsuite/canonical/grammars/WordsGer.gf index 4984eb080..4984eb080 100644 --- a/testsuite/compiler/canonical/WordsGer.gf +++ b/testsuite/canonical/grammars/WordsGer.gf diff --git a/testsuite/canonical/run.sh b/testsuite/canonical/run.sh new file mode 100755 index 000000000..7e5a90f12 --- /dev/null +++ b/testsuite/canonical/run.sh @@ -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 diff --git a/testsuite/compiler/canonical/run.sh b/testsuite/compiler/canonical/run.sh deleted file mode 100755 index b9cc7e25b..000000000 --- a/testsuite/compiler/canonical/run.sh +++ /dev/null @@ -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 |
