mirror of
https://github.com/boostorg/locale.git
synced 2026-01-19 04:22:08 +00:00
Merge pull request #269 from boostorg/coverage
This commit is contained in:
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@@ -439,7 +439,22 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup ICU
|
- name: Setup ICU
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: 'Add-Content $Env:BOOST_ROOT/project-config.jam "path-constant ICU_PATH : `"$($pwd.Path)\ICU`" ;"'
|
run: |
|
||||||
|
$icuPath = (Join-Path $pwd "ICU") -replace '\\', '/'
|
||||||
|
|
||||||
|
if (-not (Test-Path $icuPath)) {
|
||||||
|
Write-Error "ICU directory not found at $icuPath"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Get-ChildItem $icuPath | ForEach-Object { Write-Host " $_" }
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
$jamPath = Join-Path $env:BOOST_ROOT "project-config.jam"
|
||||||
|
Add-Content $jamPath "path-constant ICU_PATH : `"$icuPath`" ;"
|
||||||
|
|
||||||
|
Write-Host "Contents of project-config.jam:"
|
||||||
|
Get-Content $jamPath | ForEach-Object { Write-Host " $_" }
|
||||||
|
|
||||||
- name: Run tests (WinAPI, without coverage)
|
- name: Run tests (WinAPI, without coverage)
|
||||||
if: '!matrix.coverage'
|
if: '!matrix.coverage'
|
||||||
@@ -478,8 +493,12 @@ jobs:
|
|||||||
- name: Show config before collecting coverage
|
- name: Show config before collecting coverage
|
||||||
if: matrix.coverage
|
if: matrix.coverage
|
||||||
run: |
|
run: |
|
||||||
|
type %BOOST_ROOT%\project-config.jam
|
||||||
set B2_TARGETS=libs/%SELF%/test//show_config --verbose-test
|
set B2_TARGETS=libs/%SELF%/test//show_config --verbose-test
|
||||||
ci\build.bat
|
set B2_FLAGS=--debug-configuration
|
||||||
|
ci\build.bat || exit /b 1
|
||||||
|
echo Config log:
|
||||||
|
type %BOOST_ROOT%/bin.v2/config.log
|
||||||
env:
|
env:
|
||||||
B2_TOOLSET: ${{matrix.toolset}}
|
B2_TOOLSET: ${{matrix.toolset}}
|
||||||
B2_CXXSTD: ${{matrix.cxxstd}}
|
B2_CXXSTD: ${{matrix.cxxstd}}
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ const char* env(const char* s)
|
|||||||
# pragma warning(pop)
|
# pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
if(r)
|
if(r)
|
||||||
return r;
|
return r; // LCOV_EXCL_LINE
|
||||||
return "";
|
return ""; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_locales(const std::vector<const char*>& names)
|
void check_locales(const std::vector<const char*>& names)
|
||||||
@@ -59,12 +59,18 @@ void check_locales(const std::vector<const char*>& names)
|
|||||||
|
|
||||||
void test_main(int /*argc*/, char** /*argv*/)
|
void test_main(int /*argc*/, char** /*argv*/)
|
||||||
{
|
{
|
||||||
std::cerr << "- char8_t: ";
|
std::cerr << "- Character support: ";
|
||||||
|
std::cerr << (sizeof(wchar_t) * 8) << "bit-wchar_t ";
|
||||||
#ifdef __cpp_char8_t
|
#ifdef __cpp_char8_t
|
||||||
std::cerr << "yes\n";
|
std::cerr << "char8_t ";
|
||||||
#else
|
|
||||||
std::cerr << "no\n";
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef BOOST_LOCALE_ENABLE_CHAR16_T
|
||||||
|
std::cerr << "char16_t ";
|
||||||
|
#endif
|
||||||
|
#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
|
||||||
|
std::cerr << "char32_t ";
|
||||||
|
#endif
|
||||||
|
std::cerr << std::endl;
|
||||||
std::cerr << "- std::basic_string<char8_t>: ";
|
std::cerr << "- std::basic_string<char8_t>: ";
|
||||||
#ifdef __cpp_lib_char8_t
|
#ifdef __cpp_lib_char8_t
|
||||||
std::cerr << "yes\n";
|
std::cerr << "yes\n";
|
||||||
@@ -90,6 +96,7 @@ void test_main(int /*argc*/, char** /*argv*/)
|
|||||||
#else
|
#else
|
||||||
std::cerr << "- Without iconv\n";
|
std::cerr << "- Without iconv\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::cerr << "- Environment \n";
|
std::cerr << "- Environment \n";
|
||||||
std::cerr << " LANG=" << env("LANG") << std::endl;
|
std::cerr << " LANG=" << env("LANG") << std::endl;
|
||||||
std::cerr << " LC_ALL=" << env("LC_ALL") << std::endl;
|
std::cerr << " LC_ALL=" << env("LC_ALL") << std::endl;
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ struct utfutf<wchar_t, 4> {
|
|||||||
if(iConvUsesWTF8()) {
|
if(iConvUsesWTF8()) {
|
||||||
static char buf[16] = "\x67\x72\xF9\x80\x80\x80\x80"
|
static char buf[16] = "\x67\x72\xF9\x80\x80\x80\x80"
|
||||||
"üßen";
|
"üßen";
|
||||||
return buf;
|
return buf; // LCOV_EXCL_LINE
|
||||||
} else {
|
} else {
|
||||||
return utfutf<char>::ok();
|
return utfutf<char>::ok();
|
||||||
}
|
}
|
||||||
@@ -464,8 +464,8 @@ void test_utf_for()
|
|||||||
if(iConvUsesWTF8() && utfutf<Char>::bad_decoded_to_utf8() != utfutf<char>::ok()) {
|
if(iConvUsesWTF8() && utfutf<Char>::bad_decoded_to_utf8() != utfutf<char>::ok()) {
|
||||||
// Run just this one test, as there won't be an error reported so the "stop" tests will fail.
|
// Run just this one test, as there won't be an error reported so the "stop" tests will fail.
|
||||||
// Other backends might do it correctly but we can't pass multiple expected results here.
|
// Other backends might do it correctly but we can't pass multiple expected results here.
|
||||||
TEST_EQ(boost::locale::conv::from_utf<Char>(utfutf<Char>::bad(), "UTF-8"),
|
TEST_EQ(boost::locale::conv::from_utf<Char>(utfutf<Char>::bad(), "UTF-8"), // LCOV_EXCL_LINE
|
||||||
utfutf<Char>::bad_decoded_to_utf8());
|
utfutf<Char>::bad_decoded_to_utf8()); // LCOV_EXCL_LINE
|
||||||
} else
|
} else
|
||||||
test_error_from_utf<Char>(utfutf<Char>::bad(), utfutf<Char>::bad_decoded_to_utf8(), "UTF-8");
|
test_error_from_utf<Char>(utfutf<Char>::bad(), utfutf<Char>::bad_decoded_to_utf8(), "UTF-8");
|
||||||
std::cout << "-- Error for decoding to Latin1" << std::endl;
|
std::cout << "-- Error for decoding to Latin1" << std::endl;
|
||||||
@@ -476,7 +476,7 @@ void test_utf_for()
|
|||||||
std::string expected = utfutf<Char>::bad_char_decoded_to_utf8();
|
std::string expected = utfutf<Char>::bad_char_decoded_to_utf8();
|
||||||
expected += expected; // 2 bad chars
|
expected += expected; // 2 bad chars
|
||||||
if(iConvUsesWTF8() && utfutf<Char>::bad_decoded_to_utf8() != utfutf<char>::ok())
|
if(iConvUsesWTF8() && utfutf<Char>::bad_decoded_to_utf8() != utfutf<char>::ok())
|
||||||
TEST_EQ(boost::locale::conv::from_utf<Char>(onlyInvalidUtf, "UTF-8"), expected);
|
TEST_EQ(boost::locale::conv::from_utf<Char>(onlyInvalidUtf, "UTF-8"), expected); // LCOV_EXCL_LINE
|
||||||
else
|
else
|
||||||
test_error_from_utf<Char>(onlyInvalidUtf, expected, "UTF-8");
|
test_error_from_utf<Char>(onlyInvalidUtf, expected, "UTF-8");
|
||||||
std::cout << "-- Error decoding string of only invalid chars to Latin1" << std::endl;
|
std::cout << "-- Error decoding string of only invalid chars to Latin1" << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user