2
0
mirror of https://github.com/boostorg/nowide.git synced 2026-01-20 16:52:12 +00:00

55 Commits

Author SHA1 Message Date
Alexander Grund
015be201a5 Fix test for coverage 2024-10-19 14:02:15 +02:00
Alexander Grund
00c8a9af2e Enhance buffering and target stream handling of iostreams
buffering may be independent of tied streams, so make it an extra param
2024-10-19 14:02:15 +02:00
Alexander Grund
64ae4e0c28 Add test for buffering behavior of iostreams
Closes #186
2024-10-19 14:02:15 +02:00
Alexander Grund
a0327e0b74 Update license headers
Use the more concise format omitting the reference to the license file
and refer to the URL only.
2022-07-13 12:35:54 +02:00
Alexander Grund
993deff3ca Coverity: Remove space in supression comments
Seemingly the correct syntax is without that space.
2022-06-14 12:50:04 +02:00
Alexander Grund
b8cb76291d CI: Skip flaky test-part on affected Appveyor images
Creating console input events fails sporadically on recent Appveyor images when using CMake/CTest.
Add an option to disable that and use it for the recent Appveyor image
2022-03-18 11:22:19 +01:00
Alexander Grund
fe2c27917e SetConsoleMode for StdIn in iostream integration test
Some modes seem to be incompatible with certain CI environments, e.g. newer Appveyor images making test fail sometimes.
Set a known "good" mode to avoid this.
2022-03-18 11:22:19 +01:00
Alexander Grund
5c46488d7a Add more status messages to test_iostream
Help to debug random timeouts on Appveyor
2022-03-09 18:55:33 +01:00
Alexander Grund
e82c2aced2 Use std::cout for test status data 2022-03-09 10:49:05 +01:00
Alexander Grund
8d259f16b3 Enhance CTRL+Z iostream test
Output random seed and progress indicator to be able to reproduce failures
2022-03-08 22:13:03 +01:00
Alexander Grund
3178dc17ff Fixup coverity comments
They seemingly need to be above the line they refer to
2021-12-20 14:21:05 +01:00
Alexander Grund
924864a694 Exclude some more lines on Windows 2021-12-15 21:41:34 +01:00
Alexander Grund
c5f43cfecf Fix failure on newer Appveyor images
To read the console output it seems to be required to set the console buffer as active
2021-12-14 16:21:59 +01:00
Alexander Grund
e5f4451aff Enhance test debugging of iostream tests
Use TEST_EQ and add method to print wstring
2021-12-13 22:14:31 +01:00
Alexander Grund
16263aabda Add integration test for Windows consoles
Use redirected buffers and faked inputs
2021-12-12 21:06:25 +01:00
Alexander Grund
e2d4e95bca Add exclusions for Windows coverage builds 2021-11-30 21:02:16 +01:00
Alexander Grund
ee17695de1 Suppress false positives from coverity 2021-11-19 13:25:05 +01:00
Alexander Grund
71f749c8ef Use TEST_EQ where possible
Better output on failing tests
2021-11-18 13:26:39 +01:00
Alexander Grund
49fb36ab53 Test coverage exclusion macros 2021-11-18 13:26:38 +01:00
Alexander Grund
2b12d65dfa Move passthrough test to CMake 2021-05-01 17:22:21 +02:00
Alexander Grund
97a8c0adf5 Don't (ab)use cerr for status output
This raises an error on PowerShell
2021-04-30 21:48:38 +02:00
Alexander Grund
04cbbe56ef Test entering empty line (mocked) 2021-04-30 13:06:14 +02:00
Alexander Grund
9999aea4c6 Increase coverage by testing the test function and exclude unreachable lines (on CI) 2021-04-30 11:54:18 +02:00
Alexander Grund
b70a77f12b Add test with invalid UTF-16 input 2021-04-29 15:39:13 +02:00
Alexander Grund
826e783fd7 Test read from cin after putback 2021-04-29 15:32:34 +02:00
Alexander Grund
bf6bfe0e1f Test cin::unget and fix reading NULL chars if going past front of putback-ed chars 2021-04-29 15:24:44 +02:00
Alexander Grund
efe75ee205 Silence MSVC warning for copy_n 2021-04-29 12:51:50 +02:00
Alexander Grund
b8d0650371 Test iostreams using mocked buffers 2021-04-23 15:07:26 +02:00
Alexander Grund
95e4577a4c Run test_iostream directly in PowerShell to let it use the nowide streambufs
This only happens when stdout/stdin is not redirected so also assert that
2021-04-23 15:03:38 +02:00
Alexander Grund
769b565746 Ensure initialization of std::cout/cerr/cin in nw::cout/cerr/cin
Otherwise we might not get their rdbuf when falling back to that.
This happens when input/ouput is redirected
2021-04-23 15:03:38 +02:00
Alexander Grund
4ac0ca57b1 Refactor iostream and test
- Init cin/cout/clog as early as possible using compiler specific attributes
- Set unitbuf for cerr as required by standard
- Move the streambuf out into own header and make the read/write function (to console) mockable
- Split test into small, named functions
2021-04-23 15:03:38 +02:00
Alexander Grund
c8a9cb0fc2 Suppress some coverity false positives 2021-04-22 11:20:55 +02:00
Alexander Grund
fc3cec8bf9 Use namespace in test_iostream 2021-04-20 20:23:57 +02:00
Alexander Grund
c896185347 Reformat
Put nowide headers at top, to test for self-containment
Then custom headers (i.e. "" style includes)
then boost headers (semi-standard)
then standard headers (all other <> style includes)
2021-04-13 12:16:50 +02:00
Alexander Grund
63295d0052 Make UTF conversion functions public 2020-06-15 16:22:42 +02:00
Alexander Grund
20385d4a3c Fix name of license file 2020-05-22 12:20:11 +02:00
Alexander Grund
ec63209351 Ignore CR in cin
Fixes #94
2020-05-04 20:40:36 +02:00
Alexander Grund
c246a24d27 Support cin.sync
Call FlushConsoleInputBuffer and test that (manually)
2020-05-04 20:32:29 +02:00
Alexander Grund
6afb3f15ab Deduplicate tests and improve coverage
Every test had the same pattern of a main catching exceptions and
returning 0 or 1 based on that. Factor that into test.hpp.
As most code in test.hpp is only executed on failure and those should
not occur this file is excluded from coverage.

Finally test.hpp is included last and the header to test first
consistently to check for self-sufficient includes.
2020-04-03 16:28:28 +02:00
Alexander Grund
7854435d8e Switch pointer alignment to left
Consistency with rest of boost
2020-01-07 21:27:26 +01:00
Alexander Grund
bb2487351f Use west-const
Almost all of boost does, so be nice stay consistent
2020-01-07 21:26:12 +01:00
Alexander Grund
1bff7b670c Remove usage of Boost.LightweightTest
Tests assume TEST terminates execution on failure which is not how BLWT behaves
2020-01-02 18:47:46 +01:00
Flamefire
3bd6eed183 Enforce uniform formatting via clang-format 2019-12-28 16:02:31 +01:00
Flamefire
f95ef16706 Remove dependency on Boost.Locale
Copy utf.hpp from Boost.Locale
2019-12-27 14:26:31 +01:00
Flamefire
1d50c27dce Fix some warnings 2019-12-18 14:47:14 +01:00
Flamefire
f2e95fc899 Remove trailing whitespace 2019-12-14 15:47:01 +01:00
Flamefire
872c8eb37f Fix iostream test
The standard guarantees only a putback of 1 char on stdin, our implementation has support for more
Also test that the values read on stdin are indeed UTF-8
2019-12-13 21:14:35 +01:00
Flamefire
f213fd90f4 Fix exception path of tests
Even in case of exceptions boost::report_errors has to be called
2019-12-13 19:24:44 +01:00
Peter Dimov
ddb2794705 Merge branch 'feature/temp-review-fixes' into feature/merge-review-fixes
Conflicts:
	include/boost/nowide/utf8_codecvt.hpp
	test/test_codecvt.cpp
	test/test_convert.cpp
	test/test_fs.cpp
2019-12-04 19:50:59 +02:00
Peter Dimov
6df39fc829 Switch back to using test.hpp in tests 2019-12-04 16:29:56 +02:00