diff options
Diffstat (limited to 'test/suite/test.sh')
-rwxr-xr-x | test/suite/test.sh | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/test/suite/test.sh b/test/suite/test.sh index c112351..ec603f5 100755 --- a/test/suite/test.sh +++ b/test/suite/test.sh @@ -1,4 +1,6 @@ #!/bin/bash +#set -x + : ${CXX:=g++} : ${CTORDIR:=../../build} : ${BUILDDIR:=build} @@ -17,6 +19,12 @@ function ctor ./ctor $* } +STAT_FORMAT="-c %Y" +if [[ "$OSTYPE" == "darwin"* ]]; then + # Mac OSX + STAT_FORMAT="-f %B" +fi + # Wipe the board rm -Rf ${BUILDDIR} rm -f configuration.cc @@ -26,7 +34,7 @@ echo "** ctor_files/ctor.cc.base" cp ctor_files/ctor.cc.base ctor.cc # Compile bootstrap binary -$CXX -pthread -std=c++20 -L${CTORDIR} -lctor -I../../src ctor.cc -o ctor || fail ${LINENO} +$CXX -pthread $LDFLAGS $CXXFLAGS -std=c++20 -L${CTORDIR} -lctor -I../../src ctor.cc -o ctor || fail ${LINENO} # No build files should have been created yet [ -d ${BUILDDIR} ] && fail ${LINENO} @@ -55,7 +63,7 @@ ctor -v # ctor should not have been rebuilt, so md5 sum should be the same (echo $MD5 | md5sum --status -c) || fail ${LINENO} -MOD1=`stat -c %Y ${BUILDDIR}/hello-hello_cc.o` +MOD1=`stat $STAT_FORMAT ${BUILDDIR}/hello-hello_cc.o` touch hello.cc sleep 1.1 @@ -63,7 +71,7 @@ sleep 1.1 ctor -v # Object file should have been recompiled -MOD2=`stat -c %Y ${BUILDDIR}/hello-hello_cc.o` +MOD2=`stat $STAT_FORMAT ${BUILDDIR}/hello-hello_cc.o` [[ $MOD1 == $MOD2 ]] && fail ${LINENO} # Replacve -DFOO with -DBAR in foo external.cxxflags @@ -72,13 +80,13 @@ cp ctor_files/ctor.cc.bar ctor.cc MD5C=`md5sum configuration.cc` MD5=`md5sum ctor` -MOD1=`stat -c %Y build/hello-hello_cc.o` +MOD1=`stat $STAT_FORMAT build/hello-hello_cc.o` sleep 1.1 # Run normally to reconfigure, rebuild ctor and rebuild hello.cc ctor -v -MOD2=`stat -c %Y ${BUILDDIR}/hello-hello_cc.o` +MOD2=`stat $STAT_FORMAT ${BUILDDIR}/hello-hello_cc.o` [[ $MOD1 == $MOD2 ]] && fail ${LINENO} (echo $MD5C | md5sum --status -c) && fail ${LINENO} (echo $MD5 | md5sum --status -c) && fail ${LINENO} @@ -88,13 +96,13 @@ cp ctor_files/ctor.cc.multi ctor.cc MD5C=`md5sum configuration.cc` MD5=`md5sum ctor` -MOD1=`stat -c %Y ${BUILDDIR}/hello-hello_cc.o` +MOD1=`stat $STAT_FORMAT ${BUILDDIR}/hello-hello_cc.o` sleep 1.1 # Run normally to reconfigure, rebuild ctor and rebuild hello.cc ctor -v -MOD2=`stat -c %Y ${BUILDDIR}/hello-hello_cc.o` +MOD2=`stat $STAT_FORMAT ${BUILDDIR}/hello-hello_cc.o` [[ $MOD1 == $MOD2 ]] && fail ${LINENO} (echo $MD5C | md5sum --status -c) && fail ${LINENO} (echo $MD5 | md5sum --status -c) && fail ${LINENO} @@ -102,13 +110,13 @@ MOD2=`stat -c %Y ${BUILDDIR}/hello-hello_cc.o` # now touching foobar.h, should retrigger re-configuration touch foobar.h -MOD1=`stat -c %Y ctor` +MOD1=`stat $STAT_FORMAT ctor` sleep 1.1 # Run normally to reconfigure, rebuild ctor and rebuild hello.cc ctor -v -MOD2=`stat -c %Y ctor` +MOD2=`stat $STAT_FORMAT ctor` [[ $MOD1 == $MOD2 ]] && fail ${LINENO} exit 0 |