]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
travis: Enable ASan build 117/head
authorVitaly Chikunov <vt@altlinux.org>
Sun, 3 Feb 2019 10:15:40 +0000 (13:15 +0300)
committerVitaly Chikunov <vt@altlinux.org>
Sun, 3 Feb 2019 10:17:22 +0000 (13:17 +0300)
.travis.yml
CMakeLists.txt

index f46d2349ed0b2d84c1ac7473d6ee04e2493794ac..5c61adffe7b5682dd008be4a3e326b88e64f4f96 100644 (file)
@@ -16,6 +16,11 @@ matrix:
     - env: OPENSSL_BRANCH=master
       os: linux
       compiler: gcc
+    - env:
+      - OPENSSL_BRANCH=master
+      - ASAN=-DASAN=1
+      os: linux
+      compiler: gcc
 #    - env: OPENSSL_BRANCH=OpenSSL_1_1_0-stable
 #      os: linux
 #      compiler: gcc
@@ -26,12 +31,12 @@ matrix:
 before_script:
   - git clone --depth 1 -b ${OPENSSL_BRANCH} https://github.com/openssl/openssl.git
   - cd openssl
-  - ./config shared --prefix=${PREFIX} --openssldir=${PREFIX} && make -j$(nproc) all && make install_sw > build.log 2>&1 || (cat build.log && exit 1)
+  - ./config shared -d --prefix=${PREFIX} --openssldir=${PREFIX} && make -j$(nproc) all && make install_sw > build.log 2>&1 || (cat build.log && exit 1)
   - cd ..
 
 script:
   - mkdir build
   - cd build
-  - cmake -DOPENSSL_ROOT_DIR=${PREFIX} -DOPENSSL_LIBRARIES=${PREFIX}/lib -DOPENSSL_ENGINES_DIR=${PREFIX}/engines ..
+  - cmake -DOPENSSL_ROOT_DIR=${PREFIX} -DOPENSSL_LIBRARIES=${PREFIX}/lib -DOPENSSL_ENGINES_DIR=${PREFIX}/engines ${ASAN} ..
   - make
   - make test CTEST_OUTPUT_ON_FAILURE=1
index 326b8f40ce7e9fd9f68c8f39f8fb4037a877d6dc..cbbf312d49e5e487c99725a7b324ed37ca0d0e34 100644 (file)
@@ -19,6 +19,11 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
  add_compile_options(/MP /WX /W4 /wd4100 /wd4267 /wd4206 /wd4706 /wd4244 /wd4115)
 endif()
 
+if (ASAN)
+  message(STATUS "address sanitizer enabled")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -g3 -fno-omit-frame-pointer")
+endif()
+
 set(CMAKE_C_STANDARD 90)
 
 include (TestBigEndian)
@@ -159,11 +164,13 @@ target_link_libraries(test_gost89 gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY
 add_test(NAME gost89
        COMMAND test_gost89)
 
+if(NOT ASAN)
 add_test(NAME engine
        COMMAND perl run_tests
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
 set_tests_properties(engine PROPERTIES ENVIRONMENT
        "OPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR};OPENSSL_ENGINES=${OUTPUT_DIRECTORY}")
+endif()
 
 add_executable(sign benchmark/sign.c)
 target_link_libraries(sign gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY})