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
Compile only tests #1710
Merged
Merged
Compile only tests #1710
Changes from 5 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5d14572
Fixing warnings on MSVC, replace __PRETTY_FUNCTION__, add solution fo…
hkaiser 7f30cc3
Fixing compile-only tests
hkaiser 2fd27f3
Generate tests from existing headers
hkaiser 7456b6e
Making compile only executable project not depend on anything by default
hkaiser cf8f2e7
Re-enable dependencies for compile only tests
hkaiser 0d9dd0c
Skip headers from detail directories
hkaiser b3b432f
Adding header tests to circleci
hkaiser 29c5e19
Changing target dependencies for header only tests
hkaiser df10baa
Addressing compilation problems resulting from header only compilations
hkaiser abc66dc
Merge branch 'master' into compile_only_tests
hkaiser 4acf73b
More work on cleaning up headers
hkaiser a6ced00
Merge branch 'master' into compile_only_tests
sithhell bbad5ef
Temporarily disabling header compile checks on circleci
sithhell f4d7215
Replacing BOOST_MSVC with _MSC_VER_ in config.hpp since boost/config.…
sithhell e9e5baf
More attempts to fix MSVC builder
sithhell 3d45889
Making build unit test work on Visual Studio
sithhell 6110618
Adding virtual dtor
sithhell File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Copyright (c) 2015 Hartmut Kaiser | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
# collect a list of all header files in the source tree | ||
file(GLOB_RECURSE headers "${PROJECT_SOURCE_DIR}/hpx/*hpp") | ||
|
||
set(all_headers) | ||
|
||
# for each of the found headers, generate a test executable | ||
foreach(header ${headers}) | ||
|
||
# extract relative path of header | ||
string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/hpx/" "" relpath "${header}") | ||
|
||
# .hpp --> .cpp | ||
string(REGEX REPLACE ".hpp" ".cpp" full_test_file "${relpath}") | ||
|
||
# remove extension, '/' --> '_' | ||
string(REGEX REPLACE ".hpp" "_hpp" test_file "${relpath}") | ||
string(REGEX REPLACE "/" "_" test_name "${test_file}") | ||
|
||
# generate the test | ||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${full_test_file} | ||
"#include <hpx/${relpath}>\n" | ||
"int main() { return 0; }\n") | ||
|
||
set(all_headers ${all_headers} "#include <hpx/${relpath}>\n") | ||
|
||
get_filename_component(header_dir "${relpath}" DIRECTORY) | ||
|
||
# add compile only test | ||
add_hpx_unit_compile_test( | ||
"headers" | ||
${test_name} | ||
SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${full_test_file}" | ||
SOURCE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/${header_dir}" | ||
FOLDER "Tests/Headers/${header_dir}") | ||
|
||
# add a custom target for this example | ||
add_hpx_pseudo_target(tests.headers.${test_name}) | ||
|
||
# make pseudo-targets depend on master pseudo-target | ||
add_hpx_pseudo_dependencies(tests.headers tests.headers.${test_name}) | ||
|
||
# add dependencies to pseudo-target | ||
add_hpx_pseudo_dependencies(tests.headers.${test_name} | ||
"tests.unit.headers.${test_name}") | ||
|
||
endforeach() | ||
|
||
# generate a test executable project including all found header files | ||
set(test_name "all_headers") | ||
set(all_headers_test_name "${CMAKE_CURRENT_BINARY_DIR}/${test_name}.cpp") | ||
file(WRITE ${all_headers_test_name} | ||
${all_headers} | ||
"int main() { return 0; }\n") | ||
|
||
add_hpx_unit_compile_test( | ||
"all_headers" | ||
${test_name} | ||
SOURCES "${all_headers_test_name}" | ||
SOURCE_ROOT "${CMAKE_CURRENT_BINARY_DIR}" | ||
FOLDER "Tests/Headers") | ||
|
||
# add a custom target for this example | ||
add_hpx_pseudo_target(tests.headers.${test_name}) | ||
|
||
# make pseudo-targets depend on master pseudo-target | ||
add_hpx_pseudo_dependencies(tests.headers tests.headers.${test_name}) | ||
|
||
# add dependencies to pseudo-target | ||
add_hpx_pseudo_dependencies(tests.headers.${test_name} | ||
"tests.unit.headers.${test_name}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably exclude everything in directories in "detail" directories, those are not meant to be included by anyone knowing exactly what they do anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will do.