Commit 9a526377ea52d4844f17aa91871a34fc1b5c6d78

Authored by Henry Fredrick Schreiner
1 parent d3be5780

Testing for duplicate symbol errors

tests/CMakeLists.txt
... ... @@ -40,3 +40,10 @@ foreach(T ${CLI_SINGLE_TESTS})
40 40  
41 41 endforeach()
42 42  
  43 +
  44 +# Link test (build error if inlines missing)
  45 +add_library(link_test_1 link_test_1.cpp)
  46 +target_link_libraries(link_test_1 PUBLIC CLI11)
  47 +add_executable(link_test_2 link_test_2.cpp)
  48 +target_link_libraries(link_test_2 PUBLIC CLI11 link_test_1)
  49 +add_gtest(link_test_2)
... ...
tests/link_test_1.cpp 0 → 100644
  1 +#include "CLI/CLI.hpp"
  2 +#include "CLI/Timer.hpp"
  3 +
  4 +int do_nothing() {
  5 + return 7;
  6 +}
... ...
tests/link_test_2.cpp 0 → 100644
  1 +#include "CLI/CLI.hpp"
  2 +#include "CLI/Timer.hpp"
  3 +#include <gtest/gtest.h>
  4 +
  5 +int do_nothing();
  6 +
  7 +// Verifies there are no ungarded inlines
  8 +TEST(Link, DoNothing) {
  9 + int a = do_nothing();
  10 + EXPECT_EQ(7, a);
  11 +}
  12 +
... ...