Skip to content

Commit

Permalink
[MISC] automatic linting
Browse files Browse the repository at this point in the history
  • Loading branch information
seqan-actions committed Feb 13, 2025
1 parent 83db51b commit cf10b6a
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions test/header/generate_header_source.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,30 @@ if (HEADER_SUB_TEST STREQUAL "no-self-include")

string (REPLACE "#pragma once" "" header_content "${header_content}")

file (APPEND "${HEADER_TARGET_SOURCE}"
"// seqan3-header-test-no-self-include-start\n"
"${header_content}\n"
"// seqan3-header-test-no-self-include-end\n\n")
file (APPEND "${HEADER_TARGET_SOURCE}" "// seqan3-header-test-no-self-include-start\n" "${header_content}\n"
"// seqan3-header-test-no-self-include-end\n\n")
else ()
# this test ensures that a header guard is in place
file (APPEND "${HEADER_TARGET_SOURCE}" #
"// seqan3-header-test-header-guard-start\n"
"#include <${HEADER_FILE_INCLUDE}>\n" #
"#include <${HEADER_FILE_INCLUDE}>\n"
"// seqan3-header-test-header-guard-end\n\n")
"// seqan3-header-test-header-guard-start\n" "#include <${HEADER_FILE_INCLUDE}>\n" #
"#include <${HEADER_FILE_INCLUDE}>\n" "// seqan3-header-test-header-guard-end\n\n")
endif ()

# these includes are required by some headers (note that they follow)
file (APPEND "${HEADER_TARGET_SOURCE}" #
"// seqan3-header-test-dependencies-start\n"
"#include <gtest/gtest.h>\n" #
"// seqan3-header-test-dependencies-start\n" "#include <gtest/gtest.h>\n" #
"#include <benchmark/benchmark.h>\n" #
"TEST(${HEADER_TEST_NAME_SAFE}) {}\n"
"// seqan3-header-test-dependencies-end\n\n")
"TEST(${HEADER_TEST_NAME_SAFE}) {}\n" "// seqan3-header-test-dependencies-end\n\n")

# test that seqan3 headers include platform.hpp
if ("${HEADER_COMPONENT}" MATCHES "seqan3")

# exclude seqan3/std/* and seqan3/contrib/* from platform test
if (NOT HEADER_FILE_INCLUDE MATCHES "seqan3/(std|contrib)/")
file (APPEND "${HEADER_TARGET_SOURCE}" #
"// seqan3-header-test-platform-start\n"
"#ifndef SEQAN3_DOXYGEN_ONLY\n" #
"// seqan3-header-test-platform-start\n" "#ifndef SEQAN3_DOXYGEN_ONLY\n" #
"#error \"Your header '${HEADER_FILE_INCLUDE}' file is missing #include <seqan3/core/platform.hpp>\"\n" #
"#endif\n"
"// seqan3-header-test-platform-end\n\n")
"#endif\n" "// seqan3-header-test-platform-end\n\n")
endif ()

# seqan3/std/* must not include platform.hpp (and therefore any other seqan3 header)
Expand Down

0 comments on commit cf10b6a

Please sign in to comment.