Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
5020dfdc
Commit
5020dfdc
authored
5 years ago
by
Matthias Grob
Browse files
Options
Downloads
Patches
Plain Diff
Testing: switch unit tests to BUILD_TESTING
parent
01e9b2cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+8
-8
8 additions, 8 deletions
CMakeLists.txt
Makefile
+9
-5
9 additions, 5 deletions
Makefile
cmake/gtest/px4_add_gtest.cmake
+1
-1
1 addition, 1 deletion
cmake/gtest/px4_add_gtest.cmake
platforms/posix/cmake/sitl_tests.cmake
+1
-0
1 addition, 0 deletions
platforms/posix/cmake/sitl_tests.cmake
with
19 additions
and
14 deletions
CMakeLists.txt
+
8
−
8
View file @
5020dfdc
...
...
@@ -299,10 +299,6 @@ if (${PX4_PLATFORM} STREQUAL "posix")
if
(
NOT CMAKE_INSTALL_PREFIX
)
set
(
CMAKE_INSTALL_PREFIX
"/usr"
CACHE PATH
"Install path prefix"
FORCE
)
endif
()
# cmake testing only on posix
enable_testing
()
include
(
CTest
)
endif
()
#=============================================================================
...
...
@@ -417,14 +413,18 @@ endif()
# Testing - Automatic unit and integration testing with CTest
#
option
(
unit_testing
"Configure unit test targets"
OFF
)
# optionally enable cmake testing (supported only on posix)
option
(
CMAKE_TESTING
"Configure test targets"
OFF
)
if
(
CMAKE_TESTING
)
include
(
CTest
)
endif
()
list
(
APPEND CMAKE_MODULE_PATH
${
PX4_SOURCE_DIR
}
/cmake/gtest/
)
include
(
px4_add_gtest
)
if
(
unit_testing
)
include
(
gtest
)
add_custom_target
(
unit_test COMMAND GTEST_COLOR=1
${
CMAKE_CTEST_COMMAND
}
-V -R UnitTest- USES_TERMINAL
)
if
(
BUILD_TESTING
)
include
(
gtest
)
add_custom_target
(
unit_test COMMAND GTEST_COLOR=1
${
CMAKE_CTEST_COMMAND
}
-V -R UnitTest- USES_TERMINAL
)
endif
()
#=============================================================================
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
9
−
5
View file @
5020dfdc
...
...
@@ -341,14 +341,18 @@ format:
.PHONY
:
rostest python_coverage
unit_test
:
$(
eval
CMAKE_ARGS +
=
-Dunit_testing
=
ON
)
$(
eval
CMAKE_ARGS +
=
-DCMAKE_TESTING
=
ON
)
$(
eval
CMAKE_ARGS +
=
-DCONFIG
=
px4_sitl_test
)
$(
eval
ARGS +
=
unit_test
)
$(
call cmake-build,px4_sitl_
defaul
t
)
$(
call cmake-build,px4_sitl_
tes
t
)
tests
:
@$(
MAKE
)
--no-print-directory
px4_sitl_test test_results
\
ASAN_OPTIONS
=
"color=always:check_initialization_order=1:detect_stack_use_after_return=1"
\
UBSAN_OPTIONS
=
"color=always"
$(
eval
CMAKE_ARGS +
=
-DCMAKE_TESTING
=
ON
)
$(
eval
CMAKE_ARGS +
=
-DCONFIG
=
px4_sitl_test
)
$(
eval
ARGS +
=
test_results
)
$(
eval
ASAN_OPTIONS +
=
color
=
always:check_initialization_order
=
1:detect_stack_use_after_return
=
1
)
$(
eval
UBSAN_OPTIONS +
=
color
=
always
)
$(
call cmake-build,px4_sitl_test
)
tests_coverage
:
@$(
MAKE
)
clean
...
...
This diff is collapsed.
Click to expand it.
cmake/gtest/px4_add_gtest.cmake
+
1
−
1
View file @
5020dfdc
...
...
@@ -41,7 +41,7 @@ include(px4_base)
#
function
(
px4_add_gtest
)
# skip if unit testing is not configured
if
(
unit_testing
)
if
(
BUILD_TESTING
)
# parse source file and library dependencies from arguments
px4_parse_function_args
(
NAME px4_add_gtest
...
...
This diff is collapsed.
Click to expand it.
platforms/posix/cmake/sitl_tests.cmake
+
1
−
0
View file @
5020dfdc
...
...
@@ -151,6 +151,7 @@ add_custom_target(test_results
px4
examples__dyn_hello
test_mixer_multirotor
unit_test
USES_TERMINAL
COMMENT
"Running tests in sitl"
WORKING_DIRECTORY
${
PX4_BINARY_DIR
}
)
...
...
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