Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
run: |
echo "Running for $GITHUB_EVENT_NAME event"
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
version=$(grep "set(_version " CMakeLists.txt | head -n1 | sed 's/^.* \([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/')
echo "::set-output name=tag::v$version"
echo "tag=v$version" >> $GITHUB_OUTPUT
fi
- name: Sanity check version
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update_standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
# Check if anything changed to avoid later failure.
# E.g. nothing changes if only CI files are modified which are removed by the above
if git diff --exit-code; then
echo "::set-output name=changed::false"
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "::set-output name=changed::true"
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push
if: steps.standalone.outputs.changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion doc/main.dox
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ If that happens unexpectatly watch the configuration check output for anything l
This means your compiler doesn't use C++11 (or higher), e.g. because it defaults to C++03.
You can pass `cxxstd=11` to `b2` to build in C++11 mode.

Experimental support for building with the Boost CMake build system is also available.
Support for building with the Boost CMake build system is also available.
For that run e.g. `cmake -DBOOST_INCLUDE_LIBRARIES=nowide <path-to-boost-root> <other options>`.

\subsection using_standard Standard Features
Expand Down
2 changes: 1 addition & 1 deletion test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ run test_fstream.cpp file_test_helpers ;
run test_fstream.cpp file_test_helpers : : : <define>BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT=1 <target-os>windows:<build>no : test_fstream_internal ;
run test_fstream_special.cpp file_test_helpers ;
run test_fstream_special.cpp file_test_helpers : : : <define>BOOST_NOWIDE_USE_FILEBUF_REPLACEMENT=1 <target-os>windows:<build>no : test_fstream_special_internal ;
run test_iostream.cpp file_test_helpers : : : <target-os>windows:<find-static-library>user32 ;
run test_iostream.cpp file_test_helpers : : : <target-os>windows:<find-static-library>user32 <test-info>always_show_run_output ;
if [ MATCH (--nowide-enable-cmake) : [ modules.peek : ARGV ] ]
{
# Use CMake as a cross-platform scripting language for this test
Expand Down
42 changes: 31 additions & 11 deletions test/test_iostream.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2015 Artyom Beilis (Tonkikh)
// Copyright (c) 2020 - 2021 Alexander Grund
// Copyright (c) 2020 - 2026 Alexander Grund
//
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
Expand All @@ -17,6 +17,7 @@
#include "test.hpp"
#include "test_sets.hpp"
#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <limits>
#include <queue>
Expand Down Expand Up @@ -457,10 +458,10 @@ class RedirectStdio
void setBufferData(const std::wstring& data)
{
std::vector<INPUT_RECORD> buffer;
buffer.reserve(data.size() * 2 + 2);
buffer.reserve(data.size() * 2);
for(const auto c : data)
{
INPUT_RECORD ev;
INPUT_RECORD ev{};
ev.EventType = KEY_EVENT;
ev.Event.KeyEvent.bKeyDown = TRUE;
ev.Event.KeyEvent.dwControlKeyState = 0;
Expand All @@ -472,14 +473,15 @@ class RedirectStdio
} else
{
ev.Event.KeyEvent.uChar.UnicodeChar = c;
ev.Event.KeyEvent.wVirtualKeyCode = VkKeyScanW(c);
ev.Event.KeyEvent.wVirtualKeyCode = 0;
}
ev.Event.KeyEvent.wVirtualScanCode =
static_cast<WORD>(MapVirtualKeyW(ev.Event.KeyEvent.wVirtualKeyCode, MAPVK_VK_TO_VSC));
ev.Event.KeyEvent.wVirtualScanCode = 0;
buffer.push_back(ev);
ev.Event.KeyEvent.bKeyDown = FALSE;
buffer.push_back(ev);
}
// Clear any previous contents
FlushConsoleInputBuffer(h);
DWORD dwWritten;
TEST(WriteConsoleInputW(h, buffer.data(), static_cast<DWORD>(buffer.size()), &dwWritten));
TEST_EQ(dwWritten, static_cast<DWORD>(buffer.size()));
Expand All @@ -489,6 +491,11 @@ class RedirectStdio
void test_console()
{
#ifndef BOOST_NOWIDE_DISABLE_CIN_TEST
#ifdef __MINGW32__
bool isMinGW_CI = std::getenv("CI");
#else
bool isMinGW_CI = false;
#endif
std::cout << "Test cin console: " << std::flush;
{
RedirectStdio stdinHandle(STD_INPUT_HANDLE);
Expand All @@ -506,10 +513,20 @@ void test_console()
std::string line;
TEST(std::getline(cin, line));
std::cout << "ASCII line read" << std::endl;
TEST_EQ(line, testStringIn1);
TEST(std::getline(cin, line));
std::cout << "UTF-8 line read" << std::endl;
TEST_EQ(line, testStringIn2);
// MinGW on CI sometimes swallows the (mocked) first line or returns it multiple times
if(isMinGW_CI && line == testStringIn2)
std::cout << "WARNING: MinGW CI issue detected, skipping part of test"; // LCOV_EXCL_LINE
else
{
TEST_EQ(line, testStringIn1);
std::cout << "UTF-8 line read" << std::endl;
line.clear();
TEST(std::getline(cin, line));
if(isMinGW_CI && line == testStringIn1)
std::cout << "WARNING: MinGW CI issue detected, skipping 1st part of test"; // LCOV_EXCL_LINE
else
TEST_EQ(line, testStringIn2);
}
}
#endif
std::cout << "Test cout console" << std::endl;
Expand All @@ -523,7 +540,10 @@ void test_console()
cout << testString << std::flush;

const auto data = stdoutHandle.getBufferData();
TEST_EQ(data, nw::widen(testString));
if(isMinGW_CI && data.empty())
std::cout << "WARNING: MinGW CI issue detected, skipping part of test"; // LCOV_EXCL_LINE
else
TEST_EQ(data, nw::widen(testString));
}
std::cout << "Test cerr console" << std::endl;
{
Expand Down
Loading