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 | |
parent | 5b65a0df0a45fa4fa5a38e6927acabe0e6855fa1 (diff) |
Add support for building on MacOSX
-rw-r--r-- | Jenkinsfile | 21 | ||||
-rwxr-xr-x | test/suite/test.sh | 24 |
2 files changed, 37 insertions, 8 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 290f412..561d0cf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,27 @@ pipeline { agent any stages { //////////////////////////////////////////////////// + stage('MacOSX clang') { + agent { label 'macos' } + steps { + echo 'Cleaning workspace ...' + sh 'git clean -d -x -f' + echo 'Building (clang) ...' + sh 'CXX=/usr/local/opt/llvm/bin/clang++ LDFLAGS="-L/usr/local/opt/llvm/lib/c++ -L/usr/local/opt/llvm/lib/unwind -lunwind" ./bootstrap.sh' + echo 'Testing (clang) ...' + sh './ctor check' + echo 'Testing suite (clang) ...' + sh '(cd test/suite; CTORDIR=../../build CXX=/usr/local/opt/llvm/bin/clang++ LDFLAGS="-L/usr/local/opt/llvm/lib/c++ -L/usr/local/opt/llvm/lib/unwind -lunwind" ./test.sh)' + } + post { + always { + xunit(thresholds: [ skipped(failureThreshold: '0'), + failed(failureThreshold: '0') ], + tools: [ CppUnit(pattern: 'build/test/*.xml') ]) + } + } + } + //////////////////////////////////////////////////// stage('Linux gcc') { agent { label 'linux && gcc && c++20' } steps { 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 |