Skip to content

Commit 17bb677

Browse files
committed
Use gtest instead of check for C tests
1 parent 017cd6d commit 17bb677

File tree

496 files changed

+113300
-131277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

496 files changed

+113300
-131277
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "c/cmake/common"]
22
path = c/cmake/common
33
url = https://github.com/swift-nav/cmake.git
4-
[submodule "c/third_party/check"]
5-
path = c/third_party/check
6-
url = https://github.com/swift-nav/check.git
74
[submodule "c/third_party/googletest"]
85
path = c/third_party/googletest
96
url = https://github.com/google/googletest.git

WORKSPACE.bazel

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,3 @@ local_repository(
5757
name = "googletest",
5858
path = "c/third_party/googletest",
5959
)
60-
61-
new_local_repository(
62-
name = "check",
63-
build_file = "@rules_swiftnav//third_party:check.BUILD",
64-
path = "c/third_party/check",
65-
)

c/BUILD.bazel

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,21 @@ filegroup(
6060
visibility = ["//visibility:public"],
6161
)
6262

63-
SBP_C_SOURCES = glob(["test/auto*.c"])
63+
SBP_C_SOURCES = glob(["test/auto*.cc"])
6464

6565
swift_c_test(
6666
name = "sbp-test",
6767
srcs = [
68-
"test/check_main.c",
69-
"test/check_edc.c",
70-
"test/check_sbp.c",
71-
"test/check_bitfield_macros.c",
72-
"test/check_suites.h",
68+
"test/test_edc.cc",
69+
"test/test_sbp.cc",
70+
"test/test_bitfield_macros.cc",
71+
"test/test_utils.cc",
72+
"test/test_utils.h",
7373
] + SBP_C_SOURCES,
7474
includes = ["include/libsbp"],
7575
type = UNIT,
7676
deps = [
7777
":sbp",
78-
"@check",
7978
],
8079
)
8180

c/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ include(ClangTidy)
1515
swift_create_project_options(
1616
HAS_TESTS
1717
HAS_DOCS
18-
TEST_PACKAGES "Check"
18+
TEST_PACKAGES "Googletest"
1919
)
2020
include(CodeCoverage)
2121
include(SwiftTargets)
2222
include(TestTargets)
2323
add_code_coverage_all_targets()
2424
# TODO: Reformatting is limited to generated files; it should be expanded to cover all files
25-
swift_setup_clang_format(PATTERNS 'include/*.h' 'test/*.c' 'test/*.h' 'test/cpp/*.cc')
25+
swift_setup_clang_format(PATTERNS 'include/*.h' 'test/*.cc' 'test/*.h' 'test/cpp/*.cc')
2626

2727
if(libsbp_BUILD_TESTS)
2828
find_package(Googletest)

c/scripts/clang-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ set -e -x
88
GENERATED_HEADERS=$(grep -rl --include="*.h" "Automatically generated" include/libsbp/* src/)
99
GENERATED_C_SOURCES=$(grep -rl --include="*.c" "Automatically generated" src/)
1010
CLANG_FORMAT=clang-format-11
11-
$CLANG_FORMAT -i $GENERATED_HEADERS $GENERATED_C_SOURCES test/*.c test/*.h test/auto* test/cpp/auto*
11+
$CLANG_FORMAT -i $GENERATED_HEADERS $GENERATED_C_SOURCES test/*.cc test/*.h test/auto* test/cpp/auto*

c/test/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
find_package(Threads)
2-
set(TEST_LIBS ${TEST_LIBS} check Threads::Threads swiftnav::sbp)
2+
set(TEST_LIBS ${TEST_LIBS} gtest gtest_main Threads::Threads swiftnav::sbp)
33

44
# Check needs to be linked against Librt on Linux
55
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
66
set(TEST_LIBS ${TEST_LIBS} rt)
77
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
88

9-
FILE(GLOB generated_c_sources auto*.c)
9+
FILE(GLOB generated_c_sources auto*.cc)
1010

1111
set(TEST_INCLUDES ${PROJECT_SOURCE_DIR}/include/libsbp)
1212

@@ -26,10 +26,10 @@ endif()
2626
swift_add_test(test-libsbp
2727
UNIT_TEST
2828
SRCS
29-
check_main.c
30-
check_edc.c
31-
check_sbp.c
32-
check_bitfield_macros.c
29+
test_edc.cc
30+
test_sbp.cc
31+
test_bitfield_macros.cc
32+
test_utils.cc
3333
${generated_c_sources}
3434
INCLUDE
3535
${TEST_INCLUDES}

c/test/auto_check_sbp_acquisition_MsgAcqResult.c

Lines changed: 0 additions & 178 deletions
This file was deleted.

0 commit comments

Comments
 (0)