Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create dedicated folder for tests #3

Merged
merged 2 commits into from
Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.