Move test headers to subfolder

Gets rid of the `test_` prefix in the filenames and avoids confusing those with the actual tests especially by renaming the test framework file from `test_locale.hpp` to `unit_test.hpp`
This commit is contained in:
Alexander Grund 2022-09-12 11:11:38 +02:00
parent 5888146aa6
commit fadb2190ce
No known key found for this signature in database
GPG Key ID: AA48A0760367A42B
27 changed files with 52 additions and 47 deletions

View File

@ -4,9 +4,13 @@
include(BoostTestJamfile)
# Library config as determined by configure tests
add_library(boost_locale_test INTERFACE)
# Add test folder to include directories, especially for systems
# where the current folder is not automatically added to the search path
target_include_directories(boost_locale_test INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
set(BOOST_TEST_COMPILE_DEFINITIONS "")
set(BOOST_TEST_LINK_LIBRARIES "Boost::locale")
set(BOOST_TEST_LINK_LIBRARIES Boost::locale boost_locale_test)
set(BOOST_TEST_COMPILE_OPTIONS ${BOOST_LOCALE_WARNING_OPTIONS})
if(MSVC OR
(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11)
@ -14,6 +18,7 @@ if(MSVC OR
list(APPEND BOOST_TEST_COMPILE_OPTIONS -Wall -Werror)
endif()
# Library config as determined by configure tests
if(BOOST_LOCALE_ENABLE_ICONV)
list(APPEND BOOST_TEST_COMPILE_DEFINITIONS BOOST_LOCALE_WITH_ICONV=1)
endif()

View File

@ -4,8 +4,8 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_LOCLAE_TEST_LOCALE_POSIX_TOOLS_HPP
#define BOOST_LOCLAE_TEST_LOCALE_POSIX_TOOLS_HPP
#ifndef BOOST_LOCALE_TEST_POSIX_TOOLS_HPP
#define BOOST_LOCALE_TEST_POSIX_TOOLS_HPP
#include <clocale>
#include <string>

View File

@ -4,14 +4,14 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_LOCLAE_TEST_LOCALE_TOOLS_HPP
#define BOOST_LOCLAE_TEST_LOCALE_TOOLS_HPP
#ifndef BOOST_LOCALE_TEST_TOOLS_HPP
#define BOOST_LOCALE_TEST_TOOLS_HPP
#include <boost/locale/encoding.hpp>
#include <fstream>
#ifndef BOOST_LOCALE_NO_POSIX_BACKEND
#include "test_posix_tools.hpp"
#include "boostLocale/test/posix_tools.hpp"
#endif
#if defined(BOOST_MSVC) && BOOST_MSVC < 1700

View File

@ -4,8 +4,8 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_LOCALE_TEST_H
#define BOOST_LOCALE_TEST_H
#ifndef BOOST_LOCALE_UNIT_TEST_HPP
#define BOOST_LOCALE_UNIT_TEST_HPP
#include <boost/locale/config.hpp>
#include <stdexcept>

View File

@ -16,8 +16,8 @@ int main()
#include <boost/locale/boundary.hpp>
#include <boost/locale/generator.hpp>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
#include <list>
#include <unicode/uversion.h>
#include <vector>

View File

@ -12,7 +12,7 @@
#include <memory.h>
#include <wchar.h>
#define BOOST_LOCALE_ERROR_LIMIT -1
#include "test_locale.hpp"
#include "boostLocale/test/unit_test.hpp"
#if defined(BOOST_MSVC) && BOOST_MSVC < 1700
#pragma warning(disable : 4428) // universal-character-name encountered in source

View File

@ -25,8 +25,8 @@
#include <windows.h>
#endif
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
bool test_iso;
bool test_iso_8859_8 = true;

View File

@ -16,8 +16,8 @@
#endif
#include <cstring>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
static const unsigned illegal=0xFFFFFFFF;
static const unsigned incomplete=0xFFFFFFFE;

View File

@ -15,7 +15,7 @@ int main()
#include <boost/locale/collator.hpp>
#include <boost/locale/generator.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "boostLocale/test/unit_test.hpp"
template<typename Char>

View File

@ -21,7 +21,7 @@
#include <unicode/uversion.h>
#endif
#include "test_locale_tools.hpp"
#include "boostLocale/test/tools.hpp"
char const *env(char const *s)
{

View File

@ -16,7 +16,7 @@ int main()
#include <boost/locale/generator.hpp>
#include <boost/locale/info.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "boostLocale/test/unit_test.hpp"
template<typename Char>

View File

@ -9,7 +9,7 @@
#include <boost/locale/formatting.hpp>
#include <boost/locale/localization_backend.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "boostLocale/test/unit_test.hpp"
#ifdef BOOST_LOCALE_WITH_ICU
#include <unicode/uversion.h>

View File

@ -27,8 +27,8 @@ int main()
#include <sstream>
#include <unicode/uversion.h>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
using namespace boost::locale;

View File

@ -8,7 +8,7 @@
#include <boost/locale/info.hpp>
#include <boost/locale/message.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "boostLocale/test/unit_test.hpp"
bool has_message(std::locale const &l)

View File

@ -25,8 +25,8 @@ int main()
#include <iomanip>
#include <sstream>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
void test_main(int /*argc*/, char** /*argv*/)
{

View File

@ -4,7 +4,7 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include "test_locale.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "../src/boost/locale/shared/ios_prop.hpp"
#include <sstream>
#include <locale>

View File

@ -9,8 +9,8 @@
#include <boost/locale/message.hpp>
#include <boost/locale/gnu_gettext.hpp>
#include <boost/locale/encoding.hpp>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
#include <fstream>
#include <vector>

View File

@ -17,8 +17,8 @@ int main()
#include <boost/locale/generator.hpp>
#include <boost/locale/info.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
#include <iostream>
int get_sign(int x)

View File

@ -16,8 +16,8 @@ int main()
#include <boost/locale/generator.hpp>
#include <boost/locale/info.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
#include <iostream>
#include <wctype.h>

View File

@ -22,8 +22,8 @@ int main()
#include <monetary.h>
#include <langinfo.h>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
//#define DEBUG_FMT

View File

@ -18,8 +18,8 @@ int main()
#include <boost/locale/generator.hpp>
#include <boost/locale/info.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
#include <iostream>
int get_sign(int x)

View File

@ -17,8 +17,8 @@ int main()
#include <boost/locale/generator.hpp>
#include <boost/locale/info.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
#include <iostream>
template<typename CharType>

View File

@ -19,8 +19,8 @@ int main()
#include <iomanip>
#include <iostream>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
//#define DEBUG_FMT

View File

@ -8,8 +8,8 @@
#include <boost/detail/workaround.hpp>
#include <boost/static_assert.hpp>
#include <cstring>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
using namespace boost::locale::utf;

View File

@ -16,7 +16,7 @@ int main()
#include <boost/locale/generator.hpp>
#include <boost/locale/localization_backend.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "boostLocale/test/unit_test.hpp"
template<typename Char>

View File

@ -17,8 +17,8 @@ int main()
#include <boost/locale/generator.hpp>
#include <boost/locale/info.hpp>
#include <iomanip>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
#include <iostream>
template<typename CharType>

View File

@ -26,8 +26,8 @@ int main()
#endif
#include <windows.h>
#include "test_locale.hpp"
#include "test_locale_tools.hpp"
#include "boostLocale/test/unit_test.hpp"
#include "boostLocale/test/tools.hpp"
#include "../src/boost/locale/win32/lcid.hpp"
#define DEBUG_FMT