File: runtests

package info (click to toggle)
libastro-fits-cfitsio-perl 1.11-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,072 kB
  • ctags: 58
  • sloc: perl: 7,735; ansic: 872; sh: 49; makefile: 9
file content (64 lines) | stat: -rwxr-xr-x 1,236 bytes parent folder | download | duplicates (10)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh

usage() {

	cat 2>&1 <<EOP
Usage: $0 cfitsio_dir

    cfitsio_dir - location of cfitsio distribution

    This small script runs each of the testprog*.pl scripts, validating
    their outputs against the output of the testprog.c program which
    comes with cfitsio. It should be called with the location of the
    normal cfitsio (not Astro::FITS::CFITSIO) distribution

EOP

	exit 1
}

[ $# -eq 1 ] || usage
cfitsio=$1

if [ ! -f $cfitsio/testprog.out ]
then
	echo 1>&2 $0: cannot find file $cfitsio/testprog.out
	usage
elif [ ! -f $cfitsio/testprog.std ]; then
	echo 1>&2 $0: cannot find file $cfitsio/testprog.std
	usage
fi


for f in testprog*pl ;
do
	echo perl $f \> testprog.lis
	perl $f > testprog.lis
	if [ $? -ne 0 ];
	then
		echo 1>&2 \*\*\* failed running $f
		exit
	fi

	echo diff -u testprog.lis $cfitsio/testprog.out
	diff -u testprog.lis $cfitsio/testprog.out
	if [ $? -ne 0 ];
	then
		echo 1>&2 \*\*\* failed diffing testprog.lis and $cfitsio/testprog.out
		exit
	fi

	echo cmp testprog.fit $cfitsio/testprog.std
	cmp testprog.fit $cfitsio/testprog.std
	if [ $? -ne 0 ];
	then
		echo 1>&2 \*\*\* failed cmping testprog.fit and $cfitsio/testprog.std
		exit
	fi

	echo
done

echo
echo All tests succeeded
echo