mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-02 13:43:52 +00:00
Testing for duplicate symbol errors
This commit is contained in:
parent
d3be57804f
commit
9a526377ea
@ -40,3 +40,10 @@ foreach(T ${CLI_SINGLE_TESTS})
|
||||
|
||||
endforeach()
|
||||
|
||||
|
||||
# Link test (build error if inlines missing)
|
||||
add_library(link_test_1 link_test_1.cpp)
|
||||
target_link_libraries(link_test_1 PUBLIC CLI11)
|
||||
add_executable(link_test_2 link_test_2.cpp)
|
||||
target_link_libraries(link_test_2 PUBLIC CLI11 link_test_1)
|
||||
add_gtest(link_test_2)
|
||||
|
6
tests/link_test_1.cpp
Normal file
6
tests/link_test_1.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "CLI/CLI.hpp"
|
||||
#include "CLI/Timer.hpp"
|
||||
|
||||
int do_nothing() {
|
||||
return 7;
|
||||
}
|
12
tests/link_test_2.cpp
Normal file
12
tests/link_test_2.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "CLI/CLI.hpp"
|
||||
#include "CLI/Timer.hpp"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
int do_nothing();
|
||||
|
||||
// Verifies there are no ungarded inlines
|
||||
TEST(Link, DoNothing) {
|
||||
int a = do_nothing();
|
||||
EXPECT_EQ(7, a);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user