-
Notifications
You must be signed in to change notification settings - Fork 0
Integrity unit tests framework #111
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,23 @@ | ||
| # | ||
| # Copyright (C) 2022 Swift Navigation Inc. | ||
| # Contact: Swift Navigation <dev@swift-nav.com> | ||
| # | ||
| # This source is subject to the license found in the file 'LICENSE' which must | ||
| # be be distributed together with this source. All other rights reserved. | ||
| # | ||
| # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
| # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | ||
| # WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| # | ||
|
|
||
| include("GenericFindDependency") | ||
|
|
||
| option(albatross_ENABLE_DOCS "" false) | ||
| option(albatross_ENABLE_EXAMPLES "" false) | ||
| option(albatross_ENABLE_TESTS "" false) | ||
| option(albatross_ENABLE_TEST_LIBS "" false) | ||
|
|
||
| GenericFindDependency( | ||
| TARGET albatross | ||
| SYSTEM_INCLUDES | ||
| ) | ||
This file contains hidden or 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,24 @@ | ||
| # | ||
| # Copyright (C) 2022 Swift Navigation Inc. | ||
| # Contact: Swift Navigation <dev@swift-nav.com> | ||
| # | ||
| # This source is subject to the license found in the file 'LICENSE' which must | ||
| # be be distributed together with this source. All other rights reserved. | ||
| # | ||
| # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
| # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | ||
| # WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| # | ||
|
|
||
| include("GenericFindDependency") | ||
|
|
||
| option(orion-engine_ENABLE_DOCS "" false) | ||
| option(orion-engine_ENABLE_EXAMPLES "" false) | ||
| option(orion-engine_ENABLE_TESTS "" false) | ||
| option(orion-engine_ENABLE_TEST_LIBS "" false) | ||
|
|
||
| GenericFindDependency( | ||
| TARGET orion_engine | ||
| SOURCE_DIR orion-engine | ||
| SYSTEM_INCLUDES | ||
| ) |
This file contains hidden or 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 hidden or 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,24 @@ | ||
| # | ||
| # Copyright (C) 2022 Swift Navigation Inc. | ||
| # Contact: Swift Navigation <dev@swift-nav.com> | ||
| # | ||
| # This source is subject to the license found in the file 'LICENSE' which must | ||
| # be be distributed together with this source. All other rights reserved. | ||
| # | ||
| # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
| # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | ||
| # WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
| # | ||
|
|
||
| include("GenericFindDependency") | ||
|
|
||
| option(sip_ENABLE_DOCS "" false) | ||
| option(sip_ENABLE_EXAMPLES "" false) | ||
| option(sip_ENABLE_TESTS "" false) | ||
| option(sip_ENABLE_TEST_LIBS "" false) | ||
|
|
||
| GenericFindDependency( | ||
| TARGET sip | ||
| SOURCE_DIR sip | ||
| SYSTEM_INCLUDES | ||
| ) |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -197,8 +197,6 @@ function(swift_add_test_runner target) | |
| message(FATAL_ERROR "swift_add_test_runner unparsed arguments - ${x_UNPARSED_ARGUMENTS}") | ||
| endif() | ||
|
|
||
| swift_create_test_targets() | ||
|
|
||
| if(NOT x_COMMENT) | ||
| set(x_COMMENT "test ${target}") | ||
| endif() | ||
|
|
@@ -213,6 +211,12 @@ function(swift_add_test_runner target) | |
| message(FATAL_ERROR "Both INTEGRATION_TEST and UNIT_TEST option were specified, you can only specify one") | ||
| endif() | ||
|
|
||
| if (NOT ${PROJECT_NAME}_BUILD_TESTS) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was moved after the |
||
| return() | ||
| endif() | ||
|
|
||
| swift_create_test_targets() | ||
|
|
||
| add_custom_target( | ||
| do-${target} | ||
| COMMAND ${x_COMMAND} | ||
|
|
@@ -266,8 +270,6 @@ function(swift_add_test target) | |
| message(FATAL_ERROR "swift_add_test unparsed arguments - ${x_UNPARSED_ARGUMENTS}") | ||
| endif() | ||
|
|
||
| swift_create_test_targets() | ||
|
|
||
| if(NOT x_SRCS) | ||
| message(FATAL_ERROR "swift_add_test must be passed at least one source file") | ||
| endif() | ||
|
|
@@ -291,21 +293,27 @@ function(swift_add_test target) | |
| add_executable(${target} EXCLUDE_FROM_ALL ${x_SRCS}) | ||
| set_target_properties(${target} PROPERTIES SWIFT_TYPE "test") | ||
| swift_set_language_standards(${target} C_EXTENSIONS_ON) | ||
| target_code_coverage(${target} AUTO ALL) | ||
| if(x_INCLUDE) | ||
| target_include_directories(${target} PRIVATE ${x_INCLUDE}) | ||
| endif() | ||
| if(x_LINK) | ||
| target_link_libraries(${target} PRIVATE ${x_LINK}) | ||
| endif() | ||
|
|
||
| if (NOT ${PROJECT_NAME}_BUILD_TESTS) | ||
| return() | ||
| endif() | ||
|
|
||
| swift_create_test_targets() | ||
|
|
||
| add_custom_target( | ||
| do-${target} | ||
| COMMAND ${target} | ||
| ${wd} | ||
| COMMENT "Running ${x_COMMENT}" | ||
| ) | ||
| add_dependencies(do-${target} ${target}) | ||
| target_code_coverage(${target} AUTO ALL) | ||
|
|
||
| if(x_PARALLEL) | ||
| add_custom_target(parallel-${target} | ||
|
|
||
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.
these have been included in the customer scripts, I'm not in favor of doing this since this is our code and we should be linting, but I'm not going to attempt to open that can of worms right now
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.
A little unclear what you mean here. We shouldn't be setting the options in our find scripts?
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.
@isaactorz We should only be using
SYSTEM_INCLUDEfor code that doesn't comply with our coding standards. For example, the optional library (see here) is something that we've imported into our code base from an external source and it might not comply with our strict coding guidelines. Swiftlets on the other hand is something that we internally developed (see here) and therefore must comply.Internally this
SYSTEM_INCLUDESflag makes sure that all header files public from these third party targets are included with-isystemwhen compiling with GCC and Clang rather than the standard-I. So for example, if we wanted to linkoptional, it would compile it with something like this:rather than the usual
Any warnings from header files under
-isystemwould be ignored rather than cause an error during compilation. Likewise theclang-tidywould ignore any issues under-isystem.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.
Gotcha, thanks for clarifying.