Skip to content

Commit a7d7a21

Browse files
authored
STLSoft-1.11 (#45)
* ~ consistency * + added **test.unit.utility.cmdline** * made command-line handling more standard, incl recognition of '--' special flag * made command-line handling more standard, incl recognition of '--' special flag when handling '--help' * ~ consistency * + added `xtests_commandLine_parseHelpOrVerbosity()` / `XTESTS_COMMANDLINE_PARSE_HELP_OR_VERBOSITY()` * - removed hard dependency on **shwild** in new unit-test * ~ standardised example and test program entry-point source files * ~ updated requirement on `_STLSOFT_VER` to >= 0x010b015d * ~ boilerplate, version, ... * ~ boilerplate, version, ...
1 parent 3bf62cd commit a7d7a21

File tree

38 files changed

+1022
-252
lines changed

38 files changed

+1022
-252
lines changed

CHANGES.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ Updated: 23rd November 2024
1616
************************************
1717

1818

19-
23rd November 2024 - 0.26.0-alpha1
20-
==================================
19+
31st December 2024 - 0.26.0-beta1
20+
=================================
2121

2222
* now uses `stlsoft::integral_traits<>` for integer test macros (in C++) to allow for custom integral types to be tested;
23+
* added missing test macros `XTESTS_TEST_FLOATINGPOINT_GREATER()`, `XTESTS_TEST_FLOATINGPOINT_GREATER_OR_EQUAL()`, `XTESTS_TEST_FLOATINGPOINT_LESS()`, `XTESTS_TEST_FLOATINGPOINT_LESS_OR_EQUAL()`;
24+
* added macro `XTESTS_COMMANDLINE_PARSE_HELP_OR_VERBOSITY()`, which allows for a unified command-line parsing in test programs;
2325
* added terse forms of macros, available by including **xtests/terse-api.h**;
2426
* `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"`;
25-
* minor improvements to project boilerplate files;
27+
* added test programs **test.scratch.all_failure_messages**, **test.scratch.basics2**, **test.scratch.custom_integral_types**,
28+
* substantial internal refactoring;
2629
* minor tidying to CMake facilities;
30+
* minor improvements to examples;
31+
* minor improvements to project boilerplate files;
2732
* updated **STLSoft** constructs, incl. macros;
2833

2934

HISTORY.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# xTests - History
22

33

4-
23rd November 2024 - 0.26.0-alpha1
5-
----------------------------------
4+
31st December 2024 - 0.26.0-beta1
5+
---------------------------------
66

77
* now uses `stlsoft::integral_traits<>` for integer test macros (in C++) to allow for custom integral types to be tested;
8+
* added missing test macros `XTESTS_TEST_FLOATINGPOINT_GREATER()`, `XTESTS_TEST_FLOATINGPOINT_GREATER_OR_EQUAL()`, `XTESTS_TEST_FLOATINGPOINT_LESS()`, `XTESTS_TEST_FLOATINGPOINT_LESS_OR_EQUAL()`;
9+
* added macro `XTESTS_COMMANDLINE_PARSE_HELP_OR_VERBOSITY()`, which allows for a unified command-line parsing in test programs;
810
* added terse forms of macros, available by including **xtests/terse-api.h**;
911
* `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"`;
10-
* minor improvements to project boilerplate files;
12+
* added test programs **test.scratch.all_failure_messages**, **test.scratch.basics2**, **test.scratch.custom_integral_types**,
13+
* substantial internal refactoring;
1114
* minor tidying to CMake facilities;
15+
* minor improvements to examples;
16+
* minor improvements to project boilerplate files;
1217
* updated **STLSoft** constructs, incl. macros;
1318

1419

NEWS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Date | News Item |
44
| --------------------- | ------------------------------- |
5-
| 23rd November 2024 | xTests 0.26.0-alpha1 released |
5+
| 31st December 2024 | xTests 0.26.0-beta1 released |
66
| 18th November 2024 | xTests 0.25.4 released |
77
| 25th October 2024 | xTests 0.25.3 released |
88
| 22nd October 2024 | xTests 0.25.2 released |
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# SIS:AUTO_GENERATED: Remove this line if you edit the file, otherwise it will be overwritten
2-
define_example_program(example.c.factorial example.c.factorial.c)
2+
define_example_program(example.c.factorial main.c)

examples/c/example.c.factorial/example.c.factorial.c examples/c/example.c.factorial/main.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* /////////////////////////////////////////////////////////////////////////
2-
* File: examples/c/example.c.factorial/example.c.factorial.c
2+
* File: examples/c/example.c.factorial/main.c
33
*
44
* Purpose: Example of use of separate test-case function(s) and in-runner
55
* test case(s).
66
*
77
* Created: 7th December 2023
8-
* Updated: 4th December 2024
8+
* Updated: 31st December 2024
99
*
1010
* ////////////////////////////////////////////////////////////////////// */
1111

@@ -62,7 +62,7 @@ int main(int argc, char* argv[])
6262
int retCode = EXIT_SUCCESS;
6363
int verbosity;
6464

65-
XTESTS_COMMANDLINE_PARSE_VERBOSITY(argc, argv, &verbosity);
65+
XTESTS_COMMANDLINE_PARSE_HELP_OR_VERBOSITY(argc, argv, &verbosity);
6666

6767
if (XTESTS_START_RUNNER("example.factorial.factorial", verbosity))
6868
{
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# SIS:AUTO_GENERATED: Remove this line if you edit the file, otherwise it will be overwritten
2-
define_automated_test_program(example.c.runner example.c.runner.c)
2+
define_automated_test_program(example.c.runner main.c)

examples/c/example.c.runner/example.c.runner.c examples/c/example.c.runner/main.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* /////////////////////////////////////////////////////////////////////////
2-
* File: examples/c/example.c.runner/example.c.runner.c
2+
* File: examples/c/example.c.runner/main.c
33
*
44
* Purpose: Example of in-runner test cases.
55
*
66
* Created: 20th February 2008
7-
* Updated: 28th September 2024
7+
* Updated: 31st December 2024
88
*
99
* ////////////////////////////////////////////////////////////////////// */
1010

@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
3333
int retCode = EXIT_SUCCESS;
3434
int verbosity;
3535

36-
XTESTS_COMMANDLINE_PARSE_VERBOSITY(argc, argv, &verbosity);
36+
XTESTS_COMMANDLINE_PARSE_HELP_OR_VERBOSITY(argc, argv, &verbosity);
3737

3838
if (XTESTS_START_RUNNER("example.c.runner", verbosity))
3939
{
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# SIS:AUTO_GENERATED: Remove this line if you edit the file, otherwise it will be overwritten
2-
define_automated_test_program(example.c.tests example.c.tests.c)
2+
define_automated_test_program(example.c.tests main.c)

examples/c/example.c.tests/example.c.tests.c examples/c/example.c.tests/main.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* /////////////////////////////////////////////////////////////////////////
2-
* File: examples/c/example.c.tests/example.c.tests.c
2+
* File: examples/c/example.c.tests/entry.c
33
*
44
* Purpose: Example of use of separate test-case functions.
55
*
66
* Created: 20th February 2008
7-
* Updated: 28th September 2024
7+
* Updated: 31st December 2024
88
*
99
* ////////////////////////////////////////////////////////////////////// */
1010

@@ -43,7 +43,7 @@ int main(int argc, char* argv[])
4343
int retCode = EXIT_SUCCESS;
4444
int verbosity;
4545

46-
XTESTS_COMMANDLINE_PARSE_VERBOSITY(argc, argv, &verbosity);
46+
XTESTS_COMMANDLINE_PARSE_HELP_OR_VERBOSITY(argc, argv, &verbosity);
4747

4848
if (XTESTS_START_RUNNER("example.c.tests", verbosity))
4949
{

examples/cpp/example.cpp.temp_directory/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ if(MSVC)
55
list(APPEND X_MSVC_CUSTOM_WARNINGS_TO_BE_SUPPRESSED 4459)
66
endif()
77
endif(MSVC)
8-
define_automated_test_program(example.cpp.temp_directory example.cpp.temp_directory.cpp)
8+
define_automated_test_program(example.cpp.temp_directory main.cpp)

examples/cpp/example.cpp.temp_directory/example.cpp.temp_directory.cpp examples/cpp/example.cpp.temp_directory/main.cpp

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* /////////////////////////////////////////////////////////////////////////
2-
* File: examples/cpp/example.cpp.temp_directory/example.cpp.temp_directory.cpp
2+
* File: examples/cpp/example.cpp.temp_directory/main.cpp
33
*
44
* Purpose: Example use of `xtests::cpp::util::temp_directory`.
55
*
66
* Created: ... mid 2010s ...
7-
* Updated: 22nd October 2024
7+
* Updated: 31st December 2024
88
*
99
* ////////////////////////////////////////////////////////////////////// */
1010

@@ -33,9 +33,8 @@ namespace {
3333

3434
using xtests::cpp::util::temp_directory;
3535

36-
typedef platformstl::filesystem_traits<char> fs_traits_t;
37-
38-
} /* anonymous namespace */
36+
typedef platformstl::filesystem_traits<char> fs_traits_t;
37+
} // anonymous namespace
3938

4039

4140
/* /////////////////////////////////////////////////////////////////////////
@@ -44,7 +43,9 @@ typedef platformstl::filesystem_traits<char> fs_traits_t;
4443

4544
int main(int argc, char* argv[])
4645
{
47-
char const* const progran_name = platformstl::platformstl_C_get_executable_name_from_path(argv[0]).ptr;
46+
/* 1: command-line handling */
47+
48+
char const* const program_name = platformstl::platformstl_C_get_executable_name_from_path(argv[0]).ptr;
4849
char const* hint_dir;
4950

5051
{ for (int i = 1; i != argc; ++i)
@@ -53,7 +54,7 @@ int main(int argc, char* argv[])
5354
{
5455
std::cout
5556
<< "USAGE: "
56-
<< progran_name
57+
<< program_name
5758
<< " [ <hint-directory> ]"
5859
<< std::endl;
5960

@@ -74,15 +75,18 @@ int main(int argc, char* argv[])
7475
default:
7576

7677
std::cerr
77-
<< progran_name
78+
<< program_name
7879
<< ": too many arguments; use --help for usage"
7980
<< std::endl;
8081

8182
return EXIT_FAILURE;
8283
}
8384

85+
86+
/* 2: various uses of `xtests::cpp::util::temp_directory` */
87+
8488
{
85-
std::cout << "temp_directory::None : " << std::endl;
89+
std::cout << "temp_directory::None :" << std::endl;
8690

8791
temp_directory tf(temp_directory::None);
8892

@@ -93,7 +97,7 @@ int main(int argc, char* argv[])
9397
}
9498

9599
{
96-
std::cout << "temp_directory::RemoveOnClose : " << std::endl;
100+
std::cout << "temp_directory::RemoveOnClose :" << std::endl;
97101

98102
temp_directory tf(temp_directory::RemoveOnClose);
99103

@@ -104,7 +108,7 @@ int main(int argc, char* argv[])
104108
}
105109

106110
{
107-
std::cout << "temp_directory::RemoveOnOpen : " << std::endl;
111+
std::cout << "temp_directory::RemoveOnOpen :" << std::endl;
108112

109113
temp_directory tf(temp_directory::RemoveOnOpen);
110114

@@ -115,7 +119,7 @@ int main(int argc, char* argv[])
115119
}
116120

117121
{
118-
std::cout << "temp_directory::RemoveOnClose | temp_directory::RemoveOnOpen : " << std::endl;
122+
std::cout << "temp_directory::RemoveOnClose | temp_directory::RemoveOnOpen :" << std::endl;
119123

120124
temp_directory tf(temp_directory::RemoveOnClose | temp_directory::RemoveOnOpen);
121125

examples/cpp/example.cpp.temp_file/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ if(MSVC)
55
list(APPEND X_MSVC_CUSTOM_WARNINGS_TO_BE_SUPPRESSED 4459)
66
endif()
77
endif(MSVC)
8-
define_automated_test_program(example.cpp.temp_file example.cpp.temp_file.cpp)
8+
define_automated_test_program(example.cpp.temp_file main.cpp)

examples/cpp/example.cpp.temp_file/example.cpp.temp_file.cpp

-137
This file was deleted.

0 commit comments

Comments
 (0)