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
diff options
context:
space:
mode:
Diffstat (limited to 'tests/interface/cli/test_cli_options_with_equals.sh')
-rw-r--r--tests/interface/cli/test_cli_options_with_equals.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/interface/cli/test_cli_options_with_equals.sh b/tests/interface/cli/test_cli_options_with_equals.sh
new file mode 100644
index 0000000..d9fafc6
--- /dev/null
+++ b/tests/interface/cli/test_cli_options_with_equals.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Exit on error
+set -e
+
+rm -rf config_equals.yml
+
+# Test all types of options
+$MRT_MARIAN/marian \
+ --quiet-translation=true \
+ --mini-batch=16 \
+ --dropout-rnn=0.3 \
+ --type=s2s \
+ --data-weighting=data.txt \
+ --dim-vocabs=8000 8000 \
+ --sentencepiece-alphas=0.01 0.01 \
+ --precision=float32 float16 float16 \
+ --vocabs=vocab.yml vocab.yml \
+ --dump-config minimal > config_equals.yml
+
+test -e config_equals.yml
+
+grep -q "quiet-translation: true" config_equals.yml
+grep -q "mini-batch: 16" config_equals.yml
+grep -q "dropout-rnn: 0.3" config_equals.yml
+grep -q "type: s2s" config_equals.yml
+grep -q "data-weighting: data.txt" config_equals.yml
+grep -q "dim-vocabs: - 8000 - 8000" <(grep -A2 "dim-vocabs:" config_equals.yml | tr '\n' ' ')
+grep -q "sentencepiece-alphas: - 0.01 - 0.01" <(grep -A2 "sentencepiece-alphas:" config_equals.yml | tr '\n' ' ')
+grep -q "precision: - float32 - float16 - float16" <(grep -A3 "precision:" config_equals.yml | tr '\n' ' ')
+grep -q "vocabs: - vocab.yml - vocab.yml" <(grep -A2 "vocabs:" config_equals.yml | tr '\n' ' ')
+
+# Exit with success code
+exit 0