Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADIOS2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Podhorszki, Norbert
ADIOS2
Commits
f25085c9
Commit
f25085c9
authored
7 years ago
by
Atkins, Charles Vernon
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #123 from chuckatkins/add-gtests-individually
GoogleTest: Update to upstream
parents
3a78fee3
6f73f1f7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/GoogleTest.cmake
+1
-1
1 addition, 1 deletion
cmake/GoogleTest.cmake
cmake/upstream/GoogleTest.cmake
+35
-33
35 additions, 33 deletions
cmake/upstream/GoogleTest.cmake
with
36 additions
and
34 deletions
cmake/GoogleTest.cmake
+
1
−
1
View file @
f25085c9
...
@@ -7,5 +7,5 @@
...
@@ -7,5 +7,5 @@
if
(
CMAKE_VERSION VERSION_LESS 3.10
)
if
(
CMAKE_VERSION VERSION_LESS 3.10
)
include
(
${
CMAKE_CURRENT_LIST_DIR
}
/upstream/GoogleTest.cmake
)
include
(
${
CMAKE_CURRENT_LIST_DIR
}
/upstream/GoogleTest.cmake
)
else
()
else
()
include
(
GoogleTest
)
include
(
${
CMAKE_ROOT
}
/Modules/
GoogleTest
.cmake
)
endif
()
endif
()
This diff is collapsed.
Click to expand it.
cmake/upstream/GoogleTest.cmake
+
35
−
33
View file @
f25085c9
...
@@ -19,7 +19,6 @@ This module defines functions to help use the Google Test infrastructure.
...
@@ -19,7 +19,6 @@ This module defines functions to help use the Google Test infrastructure.
[TEST_PREFIX prefix]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[TEST_SUFFIX suffix]
[SKIP_DEPENDENCY]
[SKIP_DEPENDENCY]
[INCLUDE_DISABLED]
[TEST_LIST outVar]
[TEST_LIST outVar]
)
)
...
@@ -57,13 +56,6 @@ This module defines functions to help use the Google Test infrastructure.
...
@@ -57,13 +56,6 @@ This module defines functions to help use the Google Test infrastructure.
desired (as may be the case while actually writing the test cases), this
desired (as may be the case while actually writing the test cases), this
option can be used to prevent the dependency from being added.
option can be used to prevent the dependency from being added.
``INCLUDE_DISABLED``
Normally disabled tests will be skipped. This option will force the tests
to be added anyways.
``VERBOSE``
Output tests as they are added or skipped.
``TEST_LIST outVar``
``TEST_LIST outVar``
The variable named by ``outVar`` will be populated in the calling scope
The variable named by ``outVar`` will be populated in the calling scope
with the list of discovered test cases. This allows the caller to do things
with the list of discovered test cases. This allows the caller to do things
...
@@ -117,8 +109,6 @@ function(gtest_add_tests)
...
@@ -117,8 +109,6 @@ function(gtest_add_tests)
set
(
options
set
(
options
SKIP_DEPENDENCY
SKIP_DEPENDENCY
INCLUDE_DISABLED
VERBOSE
)
)
set
(
oneValueArgs
set
(
oneValueArgs
TARGET
TARGET
...
@@ -182,38 +172,50 @@ function(gtest_add_tests)
...
@@ -182,38 +172,50 @@ function(gtest_add_tests)
# Parameterized tests have a different signature for the filter
# Parameterized tests have a different signature for the filter
if
(
"x
${
test_type
}
"
STREQUAL
"xTEST_P"
)
if
(
"x
${
test_type
}
"
STREQUAL
"xTEST_P"
)
string
(
REGEX REPLACE
${
gtest_case_name_regex
}
"*/
\\
1.
\\
2/*"
test_name
${
hit
}
)
string
(
REGEX REPLACE
${
gtest_case_name_regex
}
"*/
\\
1.
\\
2/*"
gtest_
test_name
${
hit
}
)
elseif
(
"x
${
test_type
}
"
STREQUAL
"xTEST_F"
OR
"x
${
test_type
}
"
STREQUAL
"xTEST"
)
elseif
(
"x
${
test_type
}
"
STREQUAL
"xTEST_F"
OR
"x
${
test_type
}
"
STREQUAL
"xTEST"
)
string
(
REGEX REPLACE
${
gtest_case_name_regex
}
"
\\
1.
\\
2"
test_name
${
hit
}
)
string
(
REGEX REPLACE
${
gtest_case_name_regex
}
"
\\
1.
\\
2"
gtest_
test_name
${
hit
}
)
elseif
(
"x
${
test_type
}
"
STREQUAL
"xTYPED_TEST"
)
elseif
(
"x
${
test_type
}
"
STREQUAL
"xTYPED_TEST"
)
string
(
REGEX REPLACE
${
gtest_case_name_regex
}
"
\\
1/*.
\\
2"
test_name
${
hit
}
)
string
(
REGEX REPLACE
${
gtest_case_name_regex
}
"
\\
1/*.
\\
2"
gtest_
test_name
${
hit
}
)
else
()
else
()
message
(
WARNING
"Could not parse GTest
${
hit
}
for adding to CTest."
)
message
(
WARNING
"Could not parse GTest
${
hit
}
for adding to CTest."
)
continue
()
continue
()
endif
()
endif
()
# Ignore the test case if it's disabled in GTest
# Make sure tests disabled in GTest get disabled in CTest
set
(
gtest_test_name
${
CMAKE_MATCH_1
}
)
if
(
gtest_test_name MATCHES
"(^|
\\
.)DISABLED_"
)
set
(
gtest_case_name
${
CMAKE_MATCH_2
}
)
# Add the disabled test if CMake is new enough
if
(
gtest_test_name MATCHES
"^DISABLED_"
OR
# Note that this check is to allow backwards compatibility so this
gtest_case_name MATCHES
"^DISABLED_"
)
# module can be copied locally in projects to use with older CMake
if
(
NOT ARGS_INCLUDE_DISABLED
)
# versions
if
(
ARGS_VERBOSE
)
if
(
CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.20170401
)
message
(
"GoogleTest: Skipping disabled test
${
test_name
}
"
)
string
(
REGEX REPLACE
endif
()
"(^|
\\
.)DISABLED_"
"
\\
1"
continue
()
orig_test_name
"
${
gtest_test_name
}
"
)
set
(
ctest_test_name
${
ARGS_TEST_PREFIX
}${
orig_test_name
}${
ARGS_TEST_SUFFIX
}
)
add_test
(
NAME
${
ctest_test_name
}
${
workDir
}
COMMAND
${
ARGS_TARGET
}
--gtest_also_run_disabled_tests
--gtest_filter=
${
gtest_test_name
}
${
ARGS_EXTRA_ARGS
}
)
set_tests_properties
(
${
ctest_test_name
}
PROPERTIES DISABLED TRUE
)
list
(
APPEND testList
${
ctest_test_name
}
)
endif
()
endif
()
else
()
set
(
ctest_test_name
${
ARGS_TEST_PREFIX
}${
gtest_test_name
}${
ARGS_TEST_SUFFIX
}
)
add_test
(
NAME
${
ctest_test_name
}
${
workDir
}
COMMAND
${
ARGS_TARGET
}
--gtest_filter=
${
gtest_test_name
}
${
ARGS_EXTRA_ARGS
}
)
list
(
APPEND testList
${
ctest_test_name
}
)
endif
()
endif
()
set
(
ctest_test_name
${
ARGS_TEST_PREFIX
}${
test_name
}${
ARGS_TEST_SUFFIX
}
)
if
(
ARGS_VERBOSE
)
message
(
"GoogleTest: Adding
${
ctest_test_name
}
"
)
endif
()
add_test
(
NAME
${
ctest_test_name
}
${
workDir
}
COMMAND
${
ARGS_TARGET
}
--gtest_also_run_disabled_tests --gtest_filter=
${
test_name
}
${
ARGS_EXTRA_ARGS
}
)
list
(
APPEND testList
${
ARGS_TEST_PREFIX
}${
test_name
}${
ARGS_TEST_SUFFIX
}
)
endforeach
()
endforeach
()
endforeach
()
endforeach
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment