@@ -11,53 +11,59 @@ option (HEADER_SUB_TEST "")
1111
1212file (WRITE "${HEADER_TARGET_SOURCE} " "" ) # write empty file
1313
14+ # cmake-format: off
15+
1416if (HEADER_SUB_TEST STREQUAL "no-self-include" )
1517 # this test ensures that a header will not be included by itself later
1618 file (READ "${HEADER_FILE_ABSOLUTE} " header_content)
1719
1820 string (REPLACE "#pragma once" "" header_content "${header_content} " )
1921
20- file (APPEND "${HEADER_TARGET_SOURCE} " "${header_content} \n " )
22+ file (APPEND "${HEADER_TARGET_SOURCE} "
23+ "// seqan3-header-test-no-self-include-start\n "
24+ "${header_content} \n "
25+ "// seqan3-header-test-no-self-include-end\n\n " )
2126else ()
2227 # this test ensures that a header guard is in place
2328 file (APPEND "${HEADER_TARGET_SOURCE} " #
29+ "// seqan3-header-test-header-guard-start\n "
2430 "#include <${HEADER_FILE_INCLUDE} >\n " #
25- "#include <${HEADER_FILE_INCLUDE} >\n " )
31+ "#include <${HEADER_FILE_INCLUDE} >\n "
32+ "// seqan3-header-test-header-guard-end\n\n " )
2633endif ()
2734
2835# these includes are required by some headers (note that they follow)
2936file (APPEND "${HEADER_TARGET_SOURCE} " #
37+ "// seqan3-header-test-dependencies-start\n "
3038 "#include <gtest/gtest.h>\n " #
3139 "#include <benchmark/benchmark.h>\n " #
32- "TEST(${HEADER_TEST_NAME_SAFE} ) {}\n " )
40+ "TEST(${HEADER_TEST_NAME_SAFE} ) {}\n "
41+ "// seqan3-header-test-dependencies-end\n\n " )
3342
3443# test that seqan3 headers include platform.hpp
3544if ("${HEADER_COMPONENT} " MATCHES "seqan3" )
3645
3746 # exclude seqan3/std/* and seqan3/contrib/* from platform test
3847 if (NOT HEADER_FILE_INCLUDE MATCHES "seqan3/(std|contrib)/" )
3948 file (APPEND "${HEADER_TARGET_SOURCE} " #
49+ "// seqan3-header-test-platform-start\n "
4050 "#ifndef SEQAN3_DOXYGEN_ONLY\n " #
4151 "#error \" Your header '${HEADER_FILE_INCLUDE} ' file is missing #include <seqan3/core/platform.hpp>\"\n " #
42- "#endif\n " )
52+ "#endif\n "
53+ "// seqan3-header-test-platform-end\n\n " )
4354 endif ()
4455
4556 # seqan3/std/* must not include platform.hpp (and therefore any other seqan3 header)
4657 # See https://github.com/seqan/product_backlog/issues/135
4758 if (HEADER_FILE_INCLUDE MATCHES "seqan3/std/" )
4859 file (APPEND "${HEADER_TARGET_SOURCE} " #
60+ "// seqan3-header-test-no-platform-start\n "
4961 "#ifdef SEQAN3_DOXYGEN_ONLY" #
5062 "#error \" The standard header '${HEADER_FILE_INCLUDE} ' file MUST NOT include any other " #
5163 "seqan3 header (except for seqan3/contrib)\"\n " #
52- "#endif\n " )
64+ "#endif\n "
65+ "// seqan3-header-test-no-platform-end\n\n " )
5366 endif ()
54-
55- # test whether seqan3 has the visibility bug on lower gcc versions
56- # https://github.com/seqan/seqan3/issues/1317
57- file (APPEND "${HEADER_TARGET_SOURCE} " #
58- "#include <seqan3/core/platform.hpp>\n\n " #
59- "class A{ int i{5}; };\n\n " #
60- "template <typename t>\n " #
61- "concept private_bug = requires(t a){a.i;};\n\n " #
62- "static_assert(!private_bug<A>, \" See https://github.com/seqan/seqan3/issues/1317\" );\n " )
6367endif ()
68+
69+ # cmake-format: on
0 commit comments