travis_linux_script.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. #!/bin/bash
  2. set -e
  3. # Sonar code quality
  4. if ! [ -z ${SONAR+x} ]; then
  5. if ([ "${TRAVIS_REPO_SLUG}" != "open62541/open62541" ] ||
  6. [ "${TRAVIS_PULL_REQUEST}" != "false" ] ||
  7. [ "${TRAVIS_BRANCH}" != "master" ]); then
  8. echo "Skipping Sonarcloud on forks"
  9. # Skip on forks
  10. exit 0;
  11. fi
  12. git fetch --unshallow
  13. mkdir -p build && cd build
  14. build-wrapper-linux-x86-64 --out-dir ../bw-output cmake \
  15. -DCMAKE_BUILD_TYPE=Debug \
  16. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  17. -DUA_BUILD_EXAMPLES=ON \
  18. -DUA_ENABLE_DISCOVERY=ON \
  19. -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
  20. -DUA_ENABLE_ENCRYPTION .. \
  21. && make -j
  22. cd ..
  23. sonar-scanner
  24. exit 0
  25. fi
  26. # Docker build test
  27. if ! [ -z ${DOCKER+x} ]; then
  28. docker build -t open62541 .
  29. docker run -d -p 127.0.0.1:80:80 --name open62541 open62541 /bin/sh
  30. docker ps | grep -q open62541
  31. # disabled since it randomly fails
  32. # docker ps | grep -q open62541
  33. exit 0
  34. fi
  35. # Cpplint checking
  36. if ! [ -z ${LINT+x} ]; then
  37. mkdir -p build
  38. cd build
  39. cmake ..
  40. make cpplint
  41. if [ $? -ne 0 ] ; then exit 1 ; fi
  42. exit 0
  43. fi
  44. # Fuzzer build test
  45. if ! [ -z ${FUZZER+x} ]; then
  46. # Test the corpus generator and use new corpus for fuzz test
  47. ./tests/fuzz/generate_corpus.sh
  48. if [ $? -ne 0 ] ; then exit 1 ; fi
  49. cd build_fuzz
  50. make && make run_fuzzer
  51. if [ $? -ne 0 ] ; then exit 1 ; fi
  52. exit 0
  53. fi
  54. # INSTALL build test
  55. if ! [ -z ${INSTALL+x} ]; then
  56. echo "=== Install build, then compile examples ===" && echo -en 'travis_fold:start:script.build.install\\r'
  57. # Use make install to deploy files and then test if we can build the examples based on the installed files
  58. mkdir -p build
  59. cd build
  60. cmake \
  61. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  62. -DBUILD_SHARED_LIBS=ON \
  63. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  64. -DUA_NAMESPACE_ZERO=FULL \
  65. -DUA_ENABLE_AMALGAMATION=OFF \
  66. -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/open62541_install ..
  67. make -j install
  68. if [ $? -ne 0 ] ; then exit 1 ; fi
  69. cd .. && rm build -rf
  70. echo -en 'travis_fold:end:script.build.install\\r'
  71. echo -en 'travis_fold:start:script.build.mini-example\\r'
  72. # Now create a simple CMake Project which uses the installed file
  73. mkdir compile
  74. cp -r examples compile/examples && cd compile/examples
  75. cmake \
  76. -DCMAKE_PREFIX_PATH=$TRAVIS_BUILD_DIR/open62541_install \
  77. -DUA_NAMESPACE_ZERO=FULL .
  78. make -j
  79. if [ $? -ne 0 ] ; then exit 1 ; fi
  80. cd ../..
  81. rm -rf compile
  82. echo -en 'travis_fold:end:script.build.mini-example\\r'
  83. exit 0
  84. fi
  85. if ! [ -z ${CLANG_FORMAT+x} ]; then
  86. # Only run clang format on Pull requests, not on direct push
  87. if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
  88. echo -en "\\nSkipping clang-format on non-pull request\\n"
  89. exit 0
  90. fi
  91. echo "=== Running clang-format with diff against branch '$TRAVIS_BRANCH' ===" && echo -en 'travis_fold:start:script.clang-format\\r'
  92. # add clang-format-ci
  93. curl -Ls "https://raw.githubusercontent.com/llvm-mirror/clang/c510fac5695e904b43d5bf0feee31cc9550f110e/tools/clang-format/git-clang-format" -o "$LOCAL_PKG/bin/git-clang-format"
  94. chmod +x $LOCAL_PKG/bin/git-clang-format
  95. # We want to get colored diff output into the variable
  96. git config color.diff always
  97. # clang-format the diff to the target branch of the PR
  98. difference="$($LOCAL_PKG/bin/git-clang-format --style=file --diff $TRAVIS_BRANCH)"
  99. if ! case $difference in *"no modified files to format"*) false;; esac; then
  100. echo "====== clang-format did not find any issues. Well done! ======"
  101. exit 0
  102. fi
  103. echo "====== clang-format Format Errors ======"
  104. echo -e "Please fix the following issues:\n\n"
  105. echo "${difference}"
  106. echo -en 'travis_fold:start:script.clang-format\\r'
  107. exit 1
  108. fi
  109. if ! [ -z ${ANALYZE+x} ]; then
  110. echo "=== Running static code analysis ===" && echo -en 'travis_fold:start:script.analyze\\r'
  111. if ! case $CC in clang*) false;; esac; then
  112. mkdir -p build
  113. cd build
  114. scan-build-6.0 cmake \
  115. -DUA_BUILD_EXAMPLES=ON \
  116. -DUA_BUILD_UNIT_TESTS=ON ..
  117. scan-build-6.0 -enable-checker security.FloatLoopCounter \
  118. -enable-checker security.insecureAPI.UncheckedReturn \
  119. --status-bugs -v \
  120. make -j
  121. cd .. && rm build -rf
  122. mkdir -p build
  123. cd build
  124. scan-build-6.0 cmake \
  125. -DUA_ENABLE_PUBSUB=ON \
  126. -DUA_ENABLE_PUBSUB_DELTAFRAMES=ON \
  127. -DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON ..
  128. scan-build-6.0 -enable-checker security.FloatLoopCounter \
  129. -enable-checker security.insecureAPI.UncheckedReturn \
  130. --status-bugs -v \
  131. make -j
  132. cd .. && rm build -rf
  133. mkdir -p build
  134. cd build
  135. scan-build-6.0 cmake \
  136. -DUA_ENABLE_AMALGAMATION=OFF ..
  137. scan-build-6.0 -enable-checker security.FloatLoopCounter \
  138. -enable-checker security.insecureAPI.UncheckedReturn \
  139. --status-bugs -v \
  140. make -j
  141. cd .. && rm build -rf
  142. #mkdir -p build && cd build
  143. #cmake -DUA_ENABLE_STATIC_ANALYZER=REDUCED ..
  144. ## previous clang-format to reduce to non-trivial warnings
  145. #make clangformat
  146. #make
  147. #cd .. && rm build -rf
  148. else
  149. cppcheck --template "{file}({line}): {severity} ({id}): {message}" \
  150. --enable=style --force --std=c++11 -j 8 \
  151. --suppress=duplicateBranch \
  152. --suppress=incorrectStringBooleanError \
  153. --suppress=invalidscanf --inline-suppr \
  154. -I include src plugins examples 2> cppcheck.txt
  155. if [ -s cppcheck.txt ]; then
  156. echo "====== CPPCHECK Static Analysis Errors ======"
  157. cat cppcheck.txt
  158. # flush output
  159. sleep 5
  160. exit 1
  161. fi
  162. fi
  163. echo -en 'travis_fold:end:script.analyze\\r'
  164. exit 0
  165. fi
  166. echo -en "\r\n=== Building ===\r\n"
  167. echo -e "\r\n== Documentation and certificate build ==" && echo -en 'travis_fold:start:script.build.doc\\r'
  168. mkdir -p build
  169. cd build
  170. cmake \
  171. -DCMAKE_BUILD_TYPE=Release \
  172. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  173. -DUA_BUILD_EXAMPLES=ON \
  174. -DUA_BUILD_SELFSIGNED_CERTIFICATE=ON ..
  175. make doc
  176. make doc_pdf
  177. make selfsigned
  178. cp -r doc ../../
  179. cp -r doc_latex ../../
  180. cp ./examples/server_cert.der ../../
  181. cd .. && rm build -rf
  182. echo -en 'travis_fold:end:script.build.doc\\r'
  183. # cross compilation only with gcc
  184. if ! [ -z ${MINGW+x} ]; then
  185. echo -e "\r\n== Cross compile release build for MinGW 32 bit ==" && echo -en 'travis_fold:start:script.build.cross_mingw32\\r'
  186. mkdir -p build && cd build
  187. cmake \
  188. -DBUILD_SHARED_LIBS=ON \
  189. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  190. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-win32 \
  191. -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw32.cmake \
  192. -DUA_BUILD_EXAMPLES=ON \
  193. -DUA_ENABLE_AMALGAMATION=OFF ..
  194. make -j
  195. if [ $? -ne 0 ] ; then exit 1 ; fi
  196. make install
  197. if [ $? -ne 0 ] ; then exit 1 ; fi
  198. cd ..
  199. zip -r open62541-win32.zip ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-win32/*
  200. rm build -rf
  201. echo -en 'travis_fold:end:script.build.cross_mingw32\\r'
  202. echo -e "\r\n== Cross compile release build for MinGW 64 bit ==" && echo -en 'travis_fold:start:script.build.cross_mingw64\\r'
  203. mkdir -p build && cd build
  204. cmake \
  205. -DBUILD_SHARED_LIBS=ON \
  206. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  207. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-win64 \
  208. -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw64.cmake \
  209. -DUA_BUILD_EXAMPLES=ON \
  210. -DUA_ENABLE_AMALGAMATION=OFF ..
  211. make -j
  212. if [ $? -ne 0 ] ; then exit 1 ; fi
  213. make install
  214. if [ $? -ne 0 ] ; then exit 1 ; fi
  215. cd ..
  216. zip -r open62541-win64.zip ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-win64/*
  217. rm build -rf
  218. echo -en 'travis_fold:end:script.build.cross_mingw64\\r'
  219. echo -e "\r\n== Cross compile release build for 32-bit linux ==" && echo -en 'travis_fold:start:script.build.cross_linux\\r'
  220. mkdir -p build && cd build
  221. cmake \
  222. -DBUILD_SHARED_LIBS=ON \
  223. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  224. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-linux32 \
  225. -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-gcc-m32.cmake \
  226. -DUA_BUILD_EXAMPLES=ON \
  227. -DUA_ENABLE_AMALGAMATION=OFF ..
  228. make -j
  229. if [ $? -ne 0 ] ; then exit 1 ; fi
  230. make install
  231. if [ $? -ne 0 ] ; then exit 1 ; fi
  232. cd ..
  233. tar -pczf open62541-linux32.tar.gz ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-linux32/*
  234. rm build -rf
  235. echo -en 'travis_fold:end:script.build.cross_linux\\r'
  236. echo -e "\r\n== Cross compile release build for RaspberryPi ==" && echo -en 'travis_fold:start:script.build.cross_raspi\\r'
  237. mkdir -p build && cd build
  238. git clone https://github.com/raspberrypi/tools
  239. export PATH=$PATH:${TRAVIS_BUILD_DIR}/build/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/
  240. cmake \
  241. -DBUILD_SHARED_LIBS=ON \
  242. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  243. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-raspberrypi \
  244. -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-rpi64.cmake \
  245. -DUA_BUILD_EXAMPLES=ON \
  246. -DUA_ENABLE_AMALGAMATION=OFF ..
  247. make -j
  248. if [ $? -ne 0 ] ; then exit 1 ; fi
  249. make install
  250. if [ $? -ne 0 ] ; then exit 1 ; fi
  251. cd ..
  252. tar -pczf open62541-raspberrypi.tar.gz ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-raspberrypi/*
  253. rm build -rf
  254. echo -en 'travis_fold:end:script.build.cross_raspi\\r'
  255. fi
  256. echo -e "\r\n== Compile release build for 64-bit linux ==" && echo -en 'travis_fold:start:script.build.linux_64\\r'
  257. mkdir -p build && cd build
  258. cmake \
  259. -DBUILD_SHARED_LIBS=ON \
  260. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  261. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-linux64 \
  262. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  263. -DUA_BUILD_EXAMPLES=ON \
  264. -DUA_ENABLE_AMALGAMATION=OFF ..
  265. make -j
  266. if [ $? -ne 0 ] ; then exit 1 ; fi
  267. make install
  268. if [ $? -ne 0 ] ; then exit 1 ; fi
  269. cd ..
  270. tar -pczf open62541-linux64.tar.gz ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-linux64/*
  271. rm build -rf
  272. echo -en 'travis_fold:end:script.build.linux_64\\r'
  273. echo -e "\r\n== Compile with amalgamation ==" && echo -en 'travis_fold:start:script.build.amalgamate\\r'
  274. mkdir -p build && cd build
  275. cmake \
  276. -DBUILD_SHARED_LIBS=ON \
  277. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  278. -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-linux64 \
  279. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  280. -DUA_BUILD_EXAMPLES=OFF \
  281. -DUA_ENABLE_AMALGAMATION=ON ..
  282. make -j
  283. cp open62541.h ../.. # copy single file-release
  284. cp open62541.c ../.. # copy single file-release
  285. gcc -std=c99 -c open62541.c
  286. g++ ../examples/server.cpp -I./ open62541.o -lrt -o cpp-server
  287. if [ $? -ne 0 ] ; then exit 1 ; fi
  288. cd .. && rm build -rf
  289. echo -en 'travis_fold:end:script.build.amalgamate\\r'
  290. echo "Compile as shared lib version" && echo -en 'travis_fold:start:script.build.shared_libs\\r'
  291. mkdir -p build && cd build
  292. cmake \
  293. -DBUILD_SHARED_LIBS=ON \
  294. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  295. -DUA_BUILD_EXAMPLES=ON \
  296. -DUA_ENABLE_AMALGAMATION=OFF ..
  297. make -j
  298. if [ $? -ne 0 ] ; then exit 1 ; fi
  299. cd .. && rm build -rf
  300. echo -en 'travis_fold:end:script.build.shared_libs\\r'
  301. echo "Compile as shared lib version with amalgamation" && echo -en 'travis_fold:start:script.build.shared_libs_amalgamate\\r'
  302. mkdir -p build && cd build
  303. cmake \
  304. -DBUILD_SHARED_LIBS=ON \
  305. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  306. -DUA_BUILD_EXAMPLES=OFF \
  307. -DUA_ENABLE_AMALGAMATION=ON ..
  308. make -j
  309. if [ $? -ne 0 ] ; then exit 1 ; fi
  310. cd .. && rm build -rf
  311. echo -en 'travis_fold:end:script.build.shared_libs_amalgamate\\r'
  312. if [ "$CC" != "tcc" ]; then
  313. echo -e "\r\n==Compile multithreaded version==" && echo -en 'travis_fold:start:script.build.multithread\\r'
  314. mkdir -p build && cd build
  315. cmake \
  316. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  317. -DUA_BUILD_EXAMPLES=ON \
  318. -DUA_ENABLE_MULTITHREADING=ON ..
  319. make -j
  320. if [ $? -ne 0 ] ; then exit 1 ; fi
  321. cd .. && rm build -rf
  322. echo -en 'travis_fold:end:script.build.multithread\\r'
  323. fi
  324. echo -e "\r\n== Compile with encryption ==" && echo -en 'travis_fold:start:script.build.encryption\\r'
  325. mkdir -p build && cd build
  326. cmake \
  327. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  328. -DUA_BUILD_EXAMPLES=ON \
  329. -DUA_ENABLE_ENCRYPTION=ON ..
  330. make -j
  331. if [ $? -ne 0 ] ; then exit 1 ; fi
  332. cd .. && rm build -rf
  333. echo -en 'travis_fold:end:script.build.encryption\\r'
  334. echo -e "\r\n== Compile without discovery version ==" && echo -en 'travis_fold:start:script.build.discovery\\r'
  335. mkdir -p build && cd build
  336. cmake \
  337. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  338. -DUA_BUILD_EXAMPLES=ON \
  339. -DUA_ENABLE_DISCOVERY=OFF \
  340. -DUA_ENABLE_DISCOVERY_MULTICAST=OFF ..
  341. make -j
  342. if [ $? -ne 0 ] ; then exit 1 ; fi
  343. cd .. && rm build -rf
  344. echo -en 'travis_fold:end:script.build.discovery\\r'
  345. if [ "$CC" != "tcc" ]; then
  346. echo -e "\r\n== Compile multithreaded version with discovery ==" && echo -en 'travis_fold:start:script.build.multithread_discovery\\r'
  347. mkdir -p build && cd build
  348. cmake \
  349. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  350. -DUA_BUILD_EXAMPLES=ON \
  351. -DUA_ENABLE_DISCOVERY=ON \
  352. -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
  353. -DUA_ENABLE_MULTITHREADING=ON ..
  354. make -j
  355. if [ $? -ne 0 ] ; then exit 1 ; fi
  356. cd .. && rm build -rf
  357. echo -en 'travis_fold:end:script.build.multithread_discovery\\r'
  358. fi
  359. echo -e "\r\n== Compile JSON encoding ==" && echo -en 'travis_fold:start:script.build.json\\r'
  360. mkdir -p build && cd build
  361. cmake \
  362. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  363. -DUA_ENABLE_JSON_ENCODING=ON ..
  364. make -j
  365. if [ $? -ne 0 ] ; then exit 1 ; fi
  366. cd .. && rm build -rf
  367. echo -en 'travis_fold:end:script.build.json\\r'
  368. echo -e "\r\n== Unit tests (full NS0) ==" && echo -en 'travis_fold:start:script.build.unit_test_ns0_full\\r'
  369. mkdir -p build && cd build
  370. # Valgrind cannot handle the full NS0 because the generated file is too big. Thus run NS0 full without valgrind
  371. cmake \
  372. -DCMAKE_BUILD_TYPE=Debug \
  373. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  374. -DUA_BUILD_EXAMPLES=ON \
  375. -DUA_BUILD_UNIT_TESTS=ON \
  376. -DUA_ENABLE_COVERAGE=OFF \
  377. -DUA_ENABLE_DA=ON \
  378. -DUA_ENABLE_DISCOVERY=ON \
  379. -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
  380. -DUA_ENABLE_ENCRYPTION=ON \
  381. -DUA_ENABLE_JSON_ENCODING=ON \
  382. -DUA_ENABLE_PUBSUB=ON \
  383. -DUA_ENABLE_PUBSUB_DELTAFRAMES=ON \
  384. -DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON \
  385. -DUA_ENABLE_SUBSCRIPTIONS=ON \
  386. -DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON \
  387. -DUA_ENABLE_UNIT_TESTS_MEMCHECK=OFF \
  388. -DUA_NAMESPACE_ZERO=FULL ..
  389. make -j && make test ARGS="-V"
  390. if [ $? -ne 0 ] ; then exit 1 ; fi
  391. cd .. && rm build -rf
  392. echo -en 'travis_fold:end:script.build.unit_test_ns0_full\\r'
  393. if ! [ -z ${DEBIAN+x} ]; then
  394. echo -e "\r\n== Building the Debian package ==" && echo -en 'travis_fold:start:script.build.debian\\r'
  395. dpkg-buildpackage -b
  396. if [ $? -ne 0 ] ; then exit 1 ; fi
  397. cp ../open62541*.deb .
  398. # Copy for github release script
  399. cp ../open62541*.deb ../..
  400. echo -en 'travis_fold:end:script.build.debian\\r'
  401. fi
  402. if [ "$CC" != "tcc" ]; then
  403. echo -e "\r\n== Unit tests (minimal NS0) ==" && echo -en 'travis_fold:start:script.build.unit_test_ns0_minimal\\r'
  404. mkdir -p build && cd build
  405. cmake \
  406. -DCMAKE_BUILD_TYPE=Debug \
  407. -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON \
  408. -DUA_BUILD_EXAMPLES=ON \
  409. -DUA_BUILD_UNIT_TESTS=ON \
  410. -DUA_ENABLE_COVERAGE=ON \
  411. -DUA_ENABLE_DA=ON \
  412. -DUA_ENABLE_DISCOVERY=ON \
  413. -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
  414. -DUA_ENABLE_ENCRYPTION=ON \
  415. -DUA_ENABLE_JSON_ENCODING=ON \
  416. -DUA_ENABLE_PUBSUB=ON \
  417. -DUA_ENABLE_PUBSUB_DELTAFRAMES=ON \
  418. -DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON \
  419. -DUA_ENABLE_UNIT_TESTS_MEMCHECK=ON ..
  420. make -j && make test ARGS="-V"
  421. if [ $? -ne 0 ] ; then exit 1 ; fi
  422. echo -en 'travis_fold:end:script.build.unit_test_ns0_minimal\\r'
  423. # only run coveralls on main repo and when MINGW=true
  424. # We only want to build coveralls once, so we just take the travis run where MINGW=true which is only enabled once
  425. echo -e "\r\n== -> Current repo: ${TRAVIS_REPO_SLUG} =="
  426. if [ $MINGW = "true" ] && [ "${TRAVIS_REPO_SLUG}" = "open62541/open62541" ]; then
  427. echo -en "\r\n== Building codecov.io for ${TRAVIS_REPO_SLUG} ==" && echo -en 'travis_fold:start:script.build.codecov\\r'
  428. cd ..
  429. /bin/bash -c "bash <(curl -s https://codecov.io/bash)"
  430. if [ $? -ne 0 ] ; then exit 1 ; fi
  431. cd build
  432. echo -en 'travis_fold:end:script.build.codecov\\r'
  433. echo -en "\r\n== Building coveralls for ${TRAVIS_REPO_SLUG} ==" && echo -en 'travis_fold:start:script.build.coveralls\\r'
  434. coveralls -E '.*/build/CMakeFiles/.*' -E '.*/examples/.*' -E '.*/tests/.*' -E '.*\.h' -E '.*CMakeCXXCompilerId\.cpp' -E '.*CMakeCCompilerId\.c' -r ../ || true # ignore result since coveralls is unreachable from time to time
  435. echo -en 'travis_fold:end:script.build.coveralls\\r'
  436. fi
  437. cd .. && rm build -rf
  438. fi