[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] tests: add test case for "factor -e"
From: |
Rasmus Villemoes |
Subject: |
[PATCH 2/2] tests: add test case for "factor -e" |
Date: |
Wed, 27 Apr 2022 12:07:21 +0200 |
* tests/factor/create-test.sh: Add logic for passing options to factor.
* tests/factor/create-test.sh: Add test case for "factor -e".
* tests/factor/run.sh: Honour options passed from the test case.
* tests/local.mk (factor_tests): Add tf37.sh.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
tests/factor/create-test.sh | 2 ++
tests/factor/run.sh | 3 ++-
tests/local.mk | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/tests/factor/create-test.sh b/tests/factor/create-test.sh
index be8248792..856fbb2e4 100755
--- a/tests/factor/create-test.sh
+++ b/tests/factor/create-test.sh
@@ -66,6 +66,7 @@ case $t in
t34) set ${q}956336 ${q}958335 d1ae6bc712d994f35edf55c785d71ddf31f16535
;;
t35) set ${q}958336 ${q}960335 2374919a89196e1fce93adfe779cb4664556d4b6
;;
t36) set ${q}960336 ${q}962335 569e4363e8d9e8830a187d9ab27365eef08abde1
;;
+ t37) set -- 0 10000000 8c4d3f021ac89fa0f7ce21857e16474549f83417
-e ;;
*)
echo "$0: error: unknown test: '$test_name' -> '$t'" >&2
exit 1
@@ -80,4 +81,5 @@ exec sed \
-e "s/__START__/$1/" \
-e "s/__END__/$2/" \
-e "s/__CKSUM__/$3/" \
+ -e "s/__OPTS__/$4/" \
-e "s!__TEMPLATE__!$TEMPLATE!" "$template"
diff --git a/tests/factor/run.sh b/tests/factor/run.sh
index 4a1dbb01b..a95e9b6d3 100755
--- a/tests/factor/run.sh
+++ b/tests/factor/run.sh
@@ -23,12 +23,13 @@ print_ver_ factor seq sha1sum
START=__START__
END=__END__
CKSUM=__CKSUM__
+ OPTS=__OPTS__
test "$START" = '__ST''ART__' && skip_ 'ignoring factor test template'
echo "$CKSUM -" > exp
f=1
-seq $START $END | factor | sha1sum -c --status exp && f=0
+seq $START $END | factor $OPTS | sha1sum -c --status exp && f=0
Exit $f
diff --git a/tests/local.mk b/tests/local.mk
index 0f7778619..ff919bfc5 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -739,7 +739,7 @@ factor_tests = \
$(tf)/t20.sh $(tf)/t21.sh $(tf)/t22.sh $(tf)/t23.sh $(tf)/t24.sh \
$(tf)/t25.sh $(tf)/t26.sh $(tf)/t27.sh $(tf)/t28.sh $(tf)/t29.sh \
$(tf)/t30.sh $(tf)/t31.sh $(tf)/t32.sh $(tf)/t33.sh $(tf)/t34.sh \
- $(tf)/t35.sh $(tf)/t36.sh
+ $(tf)/t35.sh $(tf)/t36.sh $(tf)/t37.sh
$(factor_tests): $(tf)/run.sh $(tf)/create-test.sh
$(AM_V_GEN)$(MKDIR_P) $(tf)
--
2.31.1