travis_osx_script.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. set -e
  3. echo "\n=== Building ==="
  4. export OPENSSL_ROOT_DIR="/usr/local/opt/openssl"
  5. export PATH="/Users/travis/Library/Python/2.7/bin:$PATH"
  6. # echo "Documentation and certificate build" && echo -en 'travis_fold:start:script.build.doc\\r'
  7. # mkdir -p build && cd build
  8. # cmake \
  9. # -DCMAKE_BUILD_TYPE=Release \
  10. # -DUA_BUILD_EXAMPLES=ON \
  11. # -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON ..
  12. # make selfsigned
  13. # ls examples
  14. # cp examples/server_cert.der ../
  15. # cd .. && rm -rf build
  16. # echo -en 'travis_fold:end:script.build.doc\\r'
  17. echo "Full Namespace 0 Generation" && echo -en 'travis_fold:start:script.build.ns0\\r'
  18. mkdir -p build
  19. cd build
  20. cmake \
  21. -DCMAKE_BUILD_TYPE=Debug \
  22. -DUA_BUILD_EXAMPLES=ON \
  23. -DUA_NAMESPACE_ZERO=FULL ..
  24. make -j
  25. if [ $? -ne 0 ] ; then exit 1 ; fi
  26. cd .. && rm -rf build
  27. echo -en 'travis_fold:end:script.build.ns0\\r'
  28. echo "Compile release build for OS X" && echo -en 'travis_fold:start:script.build.osx\\r'
  29. mkdir -p build && cd build
  30. cmake \
  31. -DCMAKE_BUILD_TYPE=Release \
  32. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-osx \
  33. -DUA_BUILD_EXAMPLES=ON \
  34. -DUA_ENABLE_AMALGAMATION=OFF ..
  35. make -j
  36. if [ $? -ne 0 ] ; then exit 1 ; fi
  37. make install
  38. if [ $? -ne 0 ] ; then exit 1 ; fi
  39. cd ..
  40. tar -pczf open62541-osx.tar.gz LICENSE AUTHORS README.md ${TRAVIS_BUILD_DIR}/open62541-osx/*
  41. rm -rf build
  42. echo -en 'travis_fold:end:script.build.osx\\r'
  43. echo "Compile multithreaded version" && echo -en 'travis_fold:start:script.build.multithread\\r'
  44. mkdir -p build && cd build
  45. cmake \
  46. -DUA_BUILD_EXAMPLES=ON \
  47. -DUA_ENABLE_MULTITHREADING=ON ..
  48. make -j
  49. if [ $? -ne 0 ] ; then exit 1 ; fi
  50. cd .. && rm -rf build
  51. echo -en 'travis_fold:end:script.build.multithread\\r'
  52. echo "Debug build and unit tests with valgrind" && echo -en 'travis_fold:start:script.build.unit_test\\r'
  53. mkdir -p build && cd build
  54. cmake \
  55. -DCHECK_PREFIX=/usr/local/Cellar/check/0.11.0 \
  56. -DCMAKE_BUILD_TYPE=Debug \
  57. -DUA_BUILD_EXAMPLES=ON \
  58. -DUA_BUILD_UNIT_TESTS=ON \
  59. -DUA_ENABLE_COVERAGE=OFF \
  60. -DUA_ENABLE_DISCOVERY=ON \
  61. -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
  62. -DUA_ENABLE_ENCRYPTION=ON \
  63. -DUA_ENABLE_UNIT_TESTS_MEMCHECK=OFF ..
  64. make -j && make test ARGS="-V"
  65. if [ $? -ne 0 ] ; then exit 1 ; fi
  66. cd .. && rm -rf build
  67. echo -en 'travis_fold:end:script.build.unit_test\\r'