diff --git a/CMakeLists.txt b/CMakeLists.txt index bf3a2de..38bc06d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_BUILD_TYPE Release) project (DeathKnell) set(PROJECT_SRC ${DeathKnell_SOURCE_DIR}/src) set(DIR_UNIT_TEST ${DeathKnell_SOURCE_DIR}/test) -set(DIR_3RDPARTY ${DeathKnell_SOURCE_DIR}/3rdparty) +set(DIR_3RDPARTY ${DeathKnell_SOURCE_DIR}/thirdparty) MESSAGE(" PROJECT_SRC = : ${PROJECT_SRC}") @@ -90,7 +90,7 @@ include_directories(${PROJECT_SRC}) file(GLOB TEST_SRC_FILES "test/*.cpp") SET(CMAKE_CXX_FLAGS "-Wall -Wno-sign-compare -rdynamic -Wunused -std=c++14 -pthread -D_GLIBCXX_USE_NANOSLEEP") -add_executable(UnitTestRunner 3rdparty/test_main.cpp ${TEST_SRC_FILES} ) +add_executable(UnitTestRunner thirdparty/test_main.cpp ${TEST_SRC_FILES} ) target_link_libraries(UnitTestRunner ${LIBRARY_TO_BUILD} gtest_170_lib ${LIBS}) set_target_properties(${test} PROPERTIES COMPILE_FLAGS "-isystem -pthread ") diff --git a/packaging/DeathKnell.spec b/packaging/DeathKnell.spec index adbc70a..2d0f0b4 100644 --- a/packaging/DeathKnell.spec +++ b/packaging/DeathKnell.spec @@ -26,7 +26,7 @@ fi cd %{name}/ PATH=/usr/local/gcc/bin:/usr/local/probe/bin:$PATH rm -f CMakeCache.txt -cd 3rdparty +cd thirdparty unzip -u gtest-1.7.0.zip cd .. @@ -37,7 +37,7 @@ if [ "%{buildtype}" == "-DUSE_LR_DEBUG=OFF" ]; then -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER=/usr/local/gcc/bin/g++ elif [ "%{buildtype}" == "-DUSE_LR_DEBUG=ON" ]; then /usr/local/probe/bin/cmake -DUSE_LR_DEBUG=ON -DVERSION:STRING=%{version}.%{buildnumber} \ - -DCMAKE_CXX_COMPILER_ARG1:STRING=' -std=c++14 -Wall -Werror -g -gdwarf-2 -O0 -fPIC -m64 -isystem/usr/local/gcc/include -isystem/usr/local/probe/include -Wl,-rpath -Wl,. -Wl,-rpath -Wl,/usr/local/probe/lib -Wl,-rpath -Wl,/usr/local/gcc/lib64 ' \ + -DCMAKE_CXX_COMPILER_ARG1:STRING=' -std=c++14 -Wall -Werror -g -gdwarf-2 --coverage -O0 -fPIC -m64 -isystem/usr/local/gcc/include -isystem/usr/local/probe/include -Wl,-rpath -Wl,. -Wl,-rpath -Wl,/usr/local/probe/lib -Wl,-rpath -Wl,/usr/local/gcc/lib64 ' \ -DCMAKE_CXX_COMPILER=/usr/local/gcc/bin/g++ else echo "Unknown buildtype:" "%{buildtype}" @@ -46,7 +46,12 @@ fi make -j6 ./UnitTestRunner - +if [ "%{buildtype}" == "-DUSE_LR_DEBUG=ON" ]; then + /usr/local/probe/bin/CodeCoverage.py + username=$(whoami) + userhome=$HOME + sudo chown -R ${username}:${username} ${userhome}/rpmbuild/BUILD/* +fi mkdir -p $RPM_BUILD_ROOT/usr/local/probe/lib cp -rfd lib%{name}.so* $RPM_BUILD_ROOT/usr/local/probe/lib mkdir -p $RPM_BUILD_ROOT/usr/local/probe/include diff --git a/scripts/buildRpm.sh b/scripts/buildRpm.sh index 22cc201..1f6cc2a 100755 --- a/scripts/buildRpm.sh +++ b/scripts/buildRpm.sh @@ -3,21 +3,21 @@ set -e PACKAGE=DeathKnell if [[ $# -ne 2 ]] ; then - echo 'Usage: sh buildRpm ' + echo 'Usage: sh buildRpm ' echo ' BUILD_TYPE is PRODUCTION or DEBUG' exit 0 fi -if [ "$1" = "PRODUCTION" ] ; then +if [ "$2" = "PRODUCTION" ] ; then BUILD_TYPE="-DUSE_LR_DEBUG=OFF" -elif [ "$1" = "DEBUG" ] ; then +elif [ "$2" = "DEBUG" ] ; then BUILD_TYPE="-DUSE_LR_DEBUG=ON" else echo " must be one of: PRODUCTION or DEBUG" exit 0 fi -BUILD="$2" +BUILD="$1" # As version number we use the commit number on HEAD # we do not bother with other branches for now @@ -31,7 +31,6 @@ CWD=$PWD/$PACKAGE DISTDIR=$CWD/dist/$PACKAGE PATH=$PATH:/usr/local/probe/bin:$PATH -rm -rf ~/rpmbuild rpmdev-setuptree cp packaging/$PACKAGE.spec ~/rpmbuild/SPECS rm -f $PACKAGE-$VERSION.tar.gz diff --git a/3rdparty/gtest-1.7.0.zip b/thirdparty/gtest-1.7.0.zip similarity index 100% rename from 3rdparty/gtest-1.7.0.zip rename to thirdparty/gtest-1.7.0.zip diff --git a/3rdparty/test_main.cpp b/thirdparty/test_main.cpp similarity index 100% rename from 3rdparty/test_main.cpp rename to thirdparty/test_main.cpp