Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2020-04-08 19:47:50 +0300
committerRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2020-04-08 19:47:50 +0300
commitc476a64444e07c0ff6a29d3d44181185cc4968b2 (patch)
treecbbe5b91e9ec980bbf44a19d38dc3a4b908a1c79 /tests
parent325fd45d0a8a0648c39cc26e9757b8bee246d20d (diff)
Abort if excessive fields in TSV input
Diffstat (limited to 'tests')
-rw-r--r--tests/interface/input-tsv/test_error_msg_if_excessive_fields.sh (renamed from tests/interface/input-tsv/test_tsv_train_excessive_fields.sh)13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/interface/input-tsv/test_tsv_train_excessive_fields.sh b/tests/interface/input-tsv/test_error_msg_if_excessive_fields.sh
index d439bf6..b923dcb 100644
--- a/tests/interface/input-tsv/test_tsv_train_excessive_fields.sh
+++ b/tests/interface/input-tsv/test_error_msg_if_excessive_fields.sh
@@ -1,8 +1,8 @@
#!/bin/bash -x
#####################################################################
-# SUMMARY: Train a model on data from a TSV file with excessive fields
-# TAGS: sentencepiece tsv train_extra_tabs
+# SUMMARY: Report an error if the tab-separated training data has a line with excessive fields
+# TAGS: sentencepiece tsv train
#####################################################################
# Exit on error
@@ -23,15 +23,10 @@ $MRT_MARIAN/marian \
--no-shuffle --seed 1111 --dim-emb 32 --dim-rnn 64 --maxi-batch 1 --maxi-batch-sort none --optimizer sgd \
-m train_extra_tabs/model.npz --tsv -t train_extra_tabs.tsv -v $MRT_MODELS/rnn-spm/vocab.deen.{spm,spm} \
--after-batches 10 --disp-freq 2 \
- --log train_extra_tabs.log
+ > train_extra_tabs.log 2>&1 || true
-# Check if files exist
-test -e train_extra_tabs/model.npz
test -e train_extra_tabs.log
-
-# Compare the current output with the expected output
-cat train_extra_tabs.log | $MRT_TOOLS/strip-timestamps.sh | grep -i 'warn.*excessive field' > train_extra_tabs.out
-$MRT_TOOLS/diff.sh train_extra_tabs.out train_extra_tabs.expected > train_extra_tabs.diff
+grep -qi "excessive field" train_extra_tabs.log
# Exit with success code
exit 0