depot/third_party/nixpkgs/pkgs/applications/science/math/yacas/fix-test-script.patch
Default email a425ba4985 Project import generated by Copybara.
GitOrigin-RevId: 5b091d4fbe3b7b7493c3b46fe0842e4b30ea24b3
2021-12-30 14:39:12 +01:00

26 lines
964 B
Diff

diff --git i/tests/test-yacas w/tests/test-yacas
index b375d78b..0e3a616b 100755
--- i/tests/test-yacas
+++ w/tests/test-yacas
@@ -35,9 +35,9 @@ FAILED_TESTS="" # list of failed tests
FAILURES=0 # number of failed tests
TOTALTESTS=0 # total number of tests
-TESTFILE=/tmp/test-yacas.$$
-TIMEFILE=/tmp/time-yacas.$$
-VERSIONF=/tmp/version-yacas-$$.ys
+TESTFILE="$(mktemp -t test-yacas.XXX)"
+TIMEFILE="$(mktemp -t time-yacas.XXX)"
+VERSIONF="$(mktemp -t version-yacas-XXX.ys)"
LOGFILE=yacas-logfile.txt
echo "Print(Version());" > $VERSIONF
VERSION=`$CMD $VERSIONF`
@@ -69,7 +69,7 @@ for scr in $SCRIPTS; do
# fi
echo "Running $scr"
if [ -f $TESTFILE ]; then rm $TESTFILE ; fi
- /bin/bash -c "time -p ($CMD $f || echo \"Error: exit status $?\") | tee $TESTFILE" \
+ bash -c "time -p ($CMD $f || echo \"Error: exit status $?\") | tee $TESTFILE" \
2> $TIMEFILE \
|| (echo "Error -- User interrupt" > $TESTFILE)
# cat $TIMEFILE