summaryrefslogtreecommitdiff
path: root/test/suite
diff options
context:
space:
mode:
Diffstat (limited to 'test/suite')
-rwxr-xr-xtest/suite/test.sh24
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