##// END OF EJS Templates
Drop -t option from mktemp
mpm@selenic.com -
r787:f199e188 default
parent child Browse files
Show More
@@ -1,102 +1,102
1 1 #!/bin/sh -e
2 2
3 3 export LANG=C
4 4 export LC_CTYPE="C"
5 5 export LC_NUMERIC="C"
6 6 export LC_TIME="C"
7 7 export LC_COLLATE="C"
8 8 export LC_MONETARY="C"
9 9 export LC_MESSAGES="C"
10 10 export LC_PAPER="C"
11 11 export LC_NAME="C"
12 12 export LC_ADDRESS="C"
13 13 export LC_TELEPHONE="C"
14 14 export LC_MEASUREMENT="C"
15 15 export LC_IDENTIFICATION="C"
16 16 export LC_ALL=""
17 17 export HGEDITOR=true
18 18 export HGMERGE=true
19 19 export HGUSER=test
20 20
21 21 umask 022
22 22
23 23 tests=0
24 24 failed=0
25 25 H=$PWD
26 26
27 27 if [ -d /usr/lib64 ]; then
28 28 lib=lib64
29 29 else
30 30 lib=lib
31 31 fi
32 32
33 33 TESTPATH=$PWD/install/bin
34 34 export PATH=$TESTPATH:$PATH
35 35 export PYTHONPATH=$PWD/install/$lib/python
36 36
37 37 rm -rf install
38 38 cd ..
39 39 ${PYTHON:-python} setup.py install --home=tests/install > tests/install.err
40 40 if [ $? != 0 ] ; then
41 41 cat tests/install.err
42 42 fi
43 43 cd $H
44 44 rm install.err
45 45
46 46 function run_one
47 47 {
48 48 rm -f $1.err
49 49 export TZ=GMT
50 D=`mktemp -d -t tmp.XXXXXX`
50 D=`mktemp -d ${TMP-/tmp}/tmp.XXXXXX`
51 51 if [ "$D" = "" ] ; then
52 52 echo mktemp failed!
53 53 fi
54 54
55 55 cd $D
56 56 fail=0
57 57 export HOME=$D
58 58
59 59 if ! $H/$1 > .out 2>&1 ; then
60 60 echo $1 failed with error code $?
61 61 fail=1
62 62 fi
63 63
64 64 if [ -s .out -a ! -r $H/$1.out ] ; then
65 65 echo $1 generated unexpected output:
66 66 cat .out
67 67 cp .out $H/$1.err
68 68 fail=1
69 69 elif [ -r $H/$1.out ] && ! diff -u $H/$1.out .out > /dev/null ; then
70 70 echo $1 output changed:
71 71 diff -u $H/$1.out .out && true
72 72 cp .out $H/$1.err
73 73 fail=1
74 74 fi
75 75
76 76 cd $H
77 77 rm -r $D
78 78 return $fail
79 79 }
80 80
81 81 TESTS=$@
82 82 if [ "$TESTS" = "" ] ; then
83 83 TESTS=`ls test-* | grep -Ev "\.|~"`
84 84 fi
85 85
86 86 for f in $TESTS ; do
87 87 echo -n "."
88 88 if ! run_one $f ; then
89 89 failed=$[$failed + 1]
90 90 fi
91 91 tests=$[$tests + 1]
92 92 done
93 93
94 94 rm -rf install
95 95
96 96 echo
97 97 echo Ran $tests tests, $failed failed
98 98
99 99 if [ $failed -gt 0 ] ; then
100 100 exit 1
101 101 fi
102 102
General Comments 0
You need to be logged in to leave comments. Login now