diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-02-06 17:42:36 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-02-06 17:42:36 +0100 |
commit | 60cce51f54078a1d10b02f138288d0888a8c707e (patch) | |
tree | 2353f9dcefb01ef61f8eb7cdfa9dfccf0909f6f4 /test/suite/test.sh | |
parent | 5b65a0df0a45fa4fa5a38e6927acabe0e6855fa1 (diff) |
Add support for building on MacOSX
Diffstat (limited to 'test/suite/test.sh')
-rwxr-xr-x | test/suite/test.sh | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/test/suite/test.sh b/test/suite/test.sh index fe5d696..97d2551 100755 --- a/test/suite/test.sh +++ b/test/suite/test.sh @@ -17,6 +17,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 @@ -55,7 +61,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 +69,9 @@ 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` +echo $MOD1 +echo $MOD2 [[ $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 |