diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76a926d..1296c4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Coverage run: | lcov --directory ./build --capture --output-file ./build/coverage_all.info - lcov --remove ./build/coverage_all.info -o ./build/coverage.info '/usr/include/*' "$PWD/src/utf_view/tests/*" + lcov --remove ./build/coverage_all.info -o ./build/coverage.info '/usr/include/*' "$PWD/tests/utf_view/*" - name: Coveralls uses: coverallsapp/github-action@master with: diff --git a/CMakeLists.txt b/CMakeLists.txt index a7224af..3cce0b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,3 +40,7 @@ add_subdirectory(src/utf_view) if (UTF_VIEW_BUILD_PAPER) add_subdirectory(paper) endif() + +if(UTF_VIEW_BUILD_TESTING) + add_subdirectory(tests/utf_view) +endif() diff --git a/src/utf_view/CMakeLists.txt b/src/utf_view/CMakeLists.txt index 775cfd3..35920c2 100644 --- a/src/utf_view/CMakeLists.txt +++ b/src/utf_view/CMakeLists.txt @@ -8,7 +8,6 @@ add_library(utf_view INTERFACE) include(GNUInstallDirs) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories( utf_view @@ -29,8 +28,3 @@ install( DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME} FILES_MATCHING PATTERN "*.hpp") - -# Tests -if(UTF_VIEW_BUILD_TESTING) - add_subdirectory(tests) -endif() diff --git a/src/utf_view/tests/CMakeLists.txt b/tests/utf_view/CMakeLists.txt similarity index 93% rename from src/utf_view/tests/CMakeLists.txt rename to tests/utf_view/CMakeLists.txt index 03de6c6..27f3718 100644 --- a/src/utf_view/tests/CMakeLists.txt +++ b/tests/utf_view/CMakeLists.txt @@ -5,6 +5,8 @@ # (See accompanying file LICENSE.txt or copy at # https://www.boost.org/LICENSE_1_0.txt) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + add_library( utf_view_test_lib STATIC diff --git a/src/utf_view/tests/code_unit_view.t.cpp b/tests/utf_view/code_unit_view.t.cpp similarity index 97% rename from src/utf_view/tests/code_unit_view.t.cpp rename to tests/utf_view/code_unit_view.t.cpp index 083c1dd..fec61a0 100644 --- a/src/utf_view/tests/code_unit_view.t.cpp +++ b/tests/utf_view/code_unit_view.t.cpp @@ -7,10 +7,10 @@ #include #include +#include +#include #include #include -#include -#include namespace utf_view::tests { diff --git a/src/utf_view/tests/detail/concepts.t.cpp b/tests/utf_view/detail/concepts.t.cpp similarity index 95% rename from src/utf_view/tests/detail/concepts.t.cpp rename to tests/utf_view/detail/concepts.t.cpp index 8094d2e..ac8f89e 100644 --- a/src/utf_view/tests/detail/concepts.t.cpp +++ b/tests/utf_view/detail/concepts.t.cpp @@ -6,7 +6,7 @@ // https://www.boost.org/LICENSE_1_0.txt) #include -#include +#include namespace utf_view::tests { diff --git a/src/utf_view/tests/framework.cpp b/tests/utf_view/framework.cpp similarity index 100% rename from src/utf_view/tests/framework.cpp rename to tests/utf_view/framework.cpp diff --git a/src/utf_view/tests/framework.hpp b/tests/utf_view/framework.hpp similarity index 100% rename from src/utf_view/tests/framework.hpp rename to tests/utf_view/framework.hpp diff --git a/src/utf_view/tests/main.t.cpp b/tests/utf_view/main.t.cpp similarity index 94% rename from src/utf_view/tests/main.t.cpp rename to tests/utf_view/main.t.cpp index f7988fc..1ce82ea 100644 --- a/src/utf_view/tests/main.t.cpp +++ b/tests/utf_view/main.t.cpp @@ -5,9 +5,9 @@ // (See accompanying file LICENSE.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) +#include #include #include -#include int main() { for (auto& [test_name, test] : utf_view::tests::framework::tests()) { diff --git a/src/utf_view/tests/null_term.t.cpp b/tests/utf_view/null_term.t.cpp similarity index 97% rename from src/utf_view/tests/null_term.t.cpp rename to tests/utf_view/null_term.t.cpp index c7bada2..7cc9c00 100644 --- a/src/utf_view/tests/null_term.t.cpp +++ b/tests/utf_view/null_term.t.cpp @@ -6,12 +6,12 @@ // https://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include #include #include #include -#include #include namespace utf_view::tests { diff --git a/src/utf_view/tests/readme_examples.t.cpp b/tests/utf_view/readme_examples.t.cpp similarity index 99% rename from src/utf_view/tests/readme_examples.t.cpp rename to tests/utf_view/readme_examples.t.cpp index 8bccdca..fe366ec 100644 --- a/src/utf_view/tests/readme_examples.t.cpp +++ b/tests/utf_view/readme_examples.t.cpp @@ -5,6 +5,7 @@ // (See accompanying file LICENSE.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) +#include #include #include #include @@ -15,7 +16,6 @@ #include #include #include -#include #include namespace utf_view::tests { diff --git a/src/utf_view/tests/std_archetypes/exposition_only.hpp b/tests/utf_view/std_archetypes/exposition_only.hpp similarity index 100% rename from src/utf_view/tests/std_archetypes/exposition_only.hpp rename to tests/utf_view/std_archetypes/exposition_only.hpp diff --git a/src/utf_view/tests/std_archetypes/exposition_only.t.cpp b/tests/utf_view/std_archetypes/exposition_only.t.cpp similarity index 91% rename from src/utf_view/tests/std_archetypes/exposition_only.t.cpp rename to tests/utf_view/std_archetypes/exposition_only.t.cpp index 5d4bf66..f2708de 100644 --- a/src/utf_view/tests/std_archetypes/exposition_only.t.cpp +++ b/tests/utf_view/std_archetypes/exposition_only.t.cpp @@ -5,7 +5,7 @@ // (See accompanying file LICENSE.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) -#include +#include namespace utf_view::tests::std_archetypes { diff --git a/src/utf_view/tests/std_archetypes/iterator.hpp b/tests/utf_view/std_archetypes/iterator.hpp similarity index 99% rename from src/utf_view/tests/std_archetypes/iterator.hpp rename to tests/utf_view/std_archetypes/iterator.hpp index bd921bf..da3cb46 100644 --- a/src/utf_view/tests/std_archetypes/iterator.hpp +++ b/tests/utf_view/std_archetypes/iterator.hpp @@ -8,11 +8,11 @@ #ifndef UTF_VIEW_TESTS_STD_ARCHETYPES_ITERATOR_HPP #define UTF_VIEW_TESTS_STD_ARCHETYPES_ITERATOR_HPP +#include #include #include #include #include -#include namespace utf_view::tests::std_archetypes { diff --git a/src/utf_view/tests/std_archetypes/iterator.t.cpp b/tests/utf_view/std_archetypes/iterator.t.cpp similarity index 94% rename from src/utf_view/tests/std_archetypes/iterator.t.cpp rename to tests/utf_view/std_archetypes/iterator.t.cpp index 24c31bb..09f8043 100644 --- a/src/utf_view/tests/std_archetypes/iterator.t.cpp +++ b/tests/utf_view/std_archetypes/iterator.t.cpp @@ -5,8 +5,8 @@ // (See accompanying file LICENSE.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) +#include #include -#include namespace utf_view::tests::std_archetypes { diff --git a/src/utf_view/tests/test_iterators.hpp b/tests/utf_view/test_iterators.hpp similarity index 100% rename from src/utf_view/tests/test_iterators.hpp rename to tests/utf_view/test_iterators.hpp diff --git a/src/utf_view/tests/to_utf_view.t.cpp b/tests/utf_view/to_utf_view.t.cpp similarity index 99% rename from src/utf_view/tests/to_utf_view.t.cpp rename to tests/utf_view/to_utf_view.t.cpp index 3979595..4dd7365 100644 --- a/src/utf_view/tests/to_utf_view.t.cpp +++ b/tests/utf_view/to_utf_view.t.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include @@ -17,8 +19,6 @@ #include #include #include -#include -#include #include #include