summaryrefslogtreecommitdiff
path: root/tests/factor/run.sh
blob: 33ec8cd69f69ed2d996030c322333faa390fa32f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

# === THIS IS A __TEMPLATE__ ===

# Test the factor rewrite.
# The test is to run this command
# seq $START $END | factor | shasum -c --status <(echo $CKSUM  -)
# I.e., to ensure that the factorizations of integers $1..$2
# match what we expect.
#
# See: tests/factor/create-test.sh

# Copyright (C) 2012 Free Software Foundation, Inc.

. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src

# Don't run these tests by default.
very_expensive_

print_ver_ factor seq

# Template variables.
START=__START__
  END=__END__
CKSUM=__CKSUM__

echo "$CKSUM  -" > exp

f=1
seq $START $END | factor | shasum -c --status exp && f=0

Exit $f