Repository navigation
pt: make the Sparrowhawk test scripts runnable - #515
Open
VitorAMJorge wants to merge 1 commit into
Open
VitorAMJorge wants to merge 1 commit into
VitorAMJorge wants to merge 1 commit into
Conversation
tests/nemo_text_processing/pt/test_sparrowhawk_inverse_text_normalization.sh
could not run in the sparrowhawk container (docker/launch.sh, which
tools/text_processing_deployment/export_grammars.sh --MODE=test starts,
as CONTRIBUTING.md describes):
- PROJECT_DIR defaulted to /workspace/tests/en, while every test case path
is $PROJECT_DIR/pt/..., and shUnit2 is loaded from $PROJECT_DIR/../shunit2.
Default it to /workspace/tests, which resolves both. The second argument,
when given, is that tests root (not the language directory).
- Arguments were not cleared before loading shUnit2, which then took them
for test names when the script is called with arguments. Clear them
before loading shUnit2, as the English scripts do.
The pt TN script, test_sparrowhawk_normalization.sh, already had the right
default but not the shift; it gets the same two lines.
With these, the ITN script passes all 11 test groups and the TN script all
10 on main ("Ran 11 tests. OK" / "Ran 10 tests. OK"), also when called with
the grammar directory and the tests root as arguments. Other languages'
scripts (fr, ru, sv, vi, zh, hy, es_en) share the PROJECT_DIR default and
are not changed here. These scripts declare #!/bin/sh but use bash
features, as most of the repo's Sparrowhawk scripts do; they are run with
bash, and that is left for a separate change.
Signed-off-by: Vitor A. M. Jorge <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
Make the pt Sparrowhawk test scripts runnable. Fixes #514.
PROJECT_DIRdefaulted to/workspace/tests/en, but the script builds$PROJECT_DIR/pt/...and$PROJECT_DIR/../shunit2, so it failed before running any test. Default it to/workspace/tests, as the pt TN script already does.shift $#before sourcing shUnit2, as the English scripts do. Without it, calling a script with its optional<grammars_dir> <tests_root>arguments makes shUnit2 treat them as a test file and test names. (The TN script already ran without arguments; this fixes the with-arguments case.)Test scripts only, no grammar change.
Tests (Sparrowhawk container, grammars exported from this branch):
main: ITN fails withshunit2: No such file or directory; TN with arguments runs 1 bogus test