Skip to content

Commit

Permalink
Merge pull request #3 from hassansalehe/move-gtests-to-new-test-folder
Browse files Browse the repository at this point in the history
Create dedicated folder for tests
  • Loading branch information
hassansalehe authored Jun 12, 2021
2 parents fe4a872 + c75c398 commit 5e0b050
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/C_Integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE/src/unittests -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCODE_COVERAGE=ON -DENABLE_COVERAGE=ON
run: cmake $GITHUB_WORKSPACE/test -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCODE_COVERAGE=ON -DENABLE_COVERAGE=ON

- name: Build
working-directory: ${{runner.workspace}}/build
Expand All @@ -53,9 +53,9 @@ jobs:
run: |
find ${{runner.workspace}}/build -iname '*.gcno' -exec cp {} ./ \;
find ${{runner.workspace}}/build -iname '*.gcda' -exec cp {} ./ \;
gcov -o . ./tests/race_test.cpp --object-directory ./
gcov -o . ./test/common_tests --object-directory ./
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/tests/*' --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/test/*' --output-file coverage.info
lcov --list coverage.info
bash <(curl -s https://codecov.io/bash) -X gcov -f coverage.info || echo "Failed to upload to Codecov"
Expand Down
8 changes: 3 additions & 5 deletions src/unittests/CMakeLists.txt → test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ enable_testing()
# Locate GTest package
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../../bin/include
${CMAKE_CURRENT_SOURCE_DIR}/../common
${CMAKE_CURRENT_SOURCE_DIR}/../detector
${CMAKE_CURRENT_SOURCE_DIR}/../detector/commutativity)
${CMAKE_CURRENT_SOURCE_DIR}/../bin/include
${CMAKE_CURRENT_SOURCE_DIR}/../src/detector/commutativity)

add_compile_options(-g -O0 -Wall -fprofile-arcs -ftest-coverage -fpermissive)
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE ON)
Expand Down
File renamed without changes.

0 comments on commit 5e0b050

Please sign in to comment.