mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-27 15:24:00 +00:00
Estimated hours taken: 0.5
Avoid about half of the slow "mmake realclean"s required by a bootcheck.
tests/*/runtests:
Concentrate all the actions performed before the test and after
a successful tests (both of which involve an "mmake realclean")
into two scripts, tests/{startup,shutdown}.
tests/shutdown:
Clean up the directory, and touch the file CLEAN.
tests/startup:
If the file CLEAN exists and is the most recent file in the directory,
consider the directory clean to beging with. Otherwise, run mmake
realclean.
33 lines
769 B
Bash
Executable File
33 lines
769 B
Bash
Executable File
#!/bin/sh
|
|
# Test whether the compiler succeeds in generating code for each test.
|
|
# Return a status of 0 (true) if everything is all right, and 1 otherwise.
|
|
|
|
. ../handle_options
|
|
. ../startup
|
|
|
|
mmake $gradeopt $jfactor depend || exit 1
|
|
eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
|
|
checkstatus=$?
|
|
|
|
objs=`mmake $gradeopt printobjs`
|
|
failed=""
|
|
for obj in $objs
|
|
do
|
|
if test ! -f "$obj"
|
|
then
|
|
failed="$failed $obj"
|
|
fi
|
|
done
|
|
|
|
if test "$failed" = "" -a "$checkstatus" = 0
|
|
then
|
|
echo "the tests in the valid directory succeeded"
|
|
echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
|
|
. ../shutdown
|
|
exit 0
|
|
else
|
|
echo "some tests in the valid directory failed: $failed"
|
|
echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
|
|
exit 1
|
|
fi
|