Skip to content

Commit c8614b6

Browse files
committed
[C] Add a dummy source to check compliance.
Since the tests are still C++ sources, the C headers are compiled with a C++ compiler. This makes it difficult to notice breaking C compatibility.
1 parent 221ee6a commit c8614b6

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <code_generation_test/car.h>
2+
#include <code_generation_test/messageHeader.h>
3+
4+
#include <group_with_data/testMessage1.h>
5+
#include <group_with_data/testMessage2.h>
6+
#include <group_with_data/testMessage3.h>
7+
#include <group_with_data/testMessage4.h>
8+
9+
int main() {
10+
}

sbe-tool/src/test/c/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,12 @@ add_custom_target(c_codecs DEPENDS ${GENERATED_CODECS})
5555
sbe_test(BoundsCheckTest c_codecs)
5656
sbe_test(CodeGenTest c_codecs)
5757
sbe_test(GroupWithDataTest c_codecs)
58+
59+
# Compile a dummy C source to test C compliance of generated headers.
60+
add_executable(CComplianceTest CComplianceTest.c)
61+
62+
target_include_directories(CComplianceTest
63+
PRIVATE ${C_CODEC_TARGET_DIR}
64+
)
65+
66+
add_dependencies(CComplianceTest c_codecs)

0 commit comments

Comments
 (0)