@@ -13,61 +13,57 @@ option (HEADER_SUB_TEST "")
1313
1414file (WRITE "${HEADER_TARGET_SOURCE} " "" ) # write empty file
1515
16+ # cmake-format: off
17+
1618if (HEADER_SUB_TEST STREQUAL "no-self-include" )
1719 # this test ensures that a header will not be included by itself later
1820 file (READ "${HEADER_FILE_ABSOLUTE} " header_content)
1921
2022 string (REPLACE "#pragma once" "" header_content "${header_content} " )
2123
22- file (APPEND "${HEADER_TARGET_SOURCE} " "${header_content} " )
24+ file (APPEND "${HEADER_TARGET_SOURCE} "
25+ "// sharg-header-test-no-self-include-start\n "
26+ "${header_content} \n "
27+ "// sharg-header-test-no-self-include-end\n\n " )
2328else ()
2429 # this test ensures that a header guard is in place
2530 file (APPEND "${HEADER_TARGET_SOURCE} "
26- "
27- #include <${HEADER_FILE_INCLUDE} >
28- #include <${HEADER_FILE_INCLUDE} >" )
31+ "// sharg-header-test-header-guard-start\n "
32+ "#include <${HEADER_FILE_INCLUDE} >\n "
33+ "#include <${HEADER_FILE_INCLUDE} >\n "
34+ "// sharg-header-test-header-guard-end\n\n " )
2935endif ()
3036
3137# these includes are required by some headers (note that they follow)
3238file (APPEND "${HEADER_TARGET_SOURCE} "
33- "
34- #include <gtest/gtest.h>
35- TEST(${HEADER_TEST_NAME_SAFE} ) {}" )
39+ "// sharg-header-test-dependencies-start\n "
40+ "#include <gtest/gtest.h>\n "
41+ "TEST(${HEADER_TEST_NAME_SAFE} ) {}\n "
42+ "// sharg-header-test-dependencies-end\n\n " )
3643
3744# test that sharg headers include platform.hpp
3845if ("${HEADER_COMPONENT} " MATCHES "sharg" )
3946
4047 # exclude sharg/std/* and sharg/version.hpp from platform test
4148 if (NOT HEADER_FILE_INCLUDE MATCHES "sharg/(std/|version.hpp)" )
4249 file (APPEND "${HEADER_TARGET_SOURCE} "
43- "
44- #ifndef SHARG_DOXYGEN_ONLY
45- #error \" Your header '${HEADER_FILE_INCLUDE} ' file is missing #include <sharg/platform.hpp>\"
46- #endif" )
50+ "// sharg-header-test-platform-start\n "
51+ "#ifndef SHARG_DOXYGEN_ONLY\n "
52+ "#error \" Your header '${HEADER_FILE_INCLUDE} ' file is missing #include <sharg/platform.hpp>\"\n "
53+ "#endif\n "
54+ "// sharg-header-test-platform-end\n\n " )
4755 endif ()
4856
4957 # sharg/std/* must not include platform.hpp (and therefore any other sharg header)
5058 # See https://github.com/seqan/product_backlog/issues/135
5159 if (HEADER_FILE_INCLUDE MATCHES "sharg/std/" )
5260 file (APPEND "${HEADER_TARGET_SOURCE} "
53- "
54- #ifdef SHARG_DOXYGEN_ONLY
55- #error \" The standard header '${HEADER_FILE_INCLUDE} ' file MUST NOT include any other sharg header\"
56- #endif" )
61+ "// sharg-header-test-no-platform-start\n "
62+ "#ifdef SHARG_DOXYGEN_ONLY\n "
63+ "#error \" The standard header '${HEADER_FILE_INCLUDE} ' file MUST NOT include any other sharg header\"\n "
64+ "#endif\n "
65+ "// sharg-header-test-no-platform-end\n\n " )
5766 endif ()
58-
59- # test whether sharg has the visibility bug on lower gcc versions
60- # https://github.com/seqan/seqan3/issues/1317
61- if (NOT HEADER_FILE_INCLUDE MATCHES "sharg/version.hpp" )
62- file (APPEND "${HEADER_TARGET_SOURCE} "
63- "
64- #include <sharg/platform.hpp>
65- class A{ int i{5}; };
66-
67- template <typename t>
68- concept private_bug = requires(t a){a.i;};
69-
70- static_assert(!private_bug<A>, \" See https://github.com/seqan/seqan3/issues/1317\" );" )
71- endif ()
72-
7367endif ()
68+
69+ # cmake-format: on
0 commit comments