Skip to content

Commit 0cc8671

Browse files
Merged 'dev' into 'master'
Squashed commit of the following: commit 39fe8fcc723d954d6f19a4fac1dd5f78ce67788c Author: Matt Wilson <[email protected]> Date: Tue Dec 31 12:55:20 2024 +1100 boilerplate commit e4c3bcd Author: Matt Wilson <[email protected]> Date: Tue Dec 31 12:49:43 2024 +1100 Hint directory support (`temp_file`) (synesissoftware#46) * ~ preparatory refactoring * `xtests::cpp::util::temp_file` : + now supports `hint_dir` parameter, to allow caller to specify temporary directory * ~ VC++ compatibility * `xtests::cpp::util::temp_file` : + now supports `hint_dir` parameter on Windows, to allow caller to specify temporary directory * ~ tidying commit 1bf1274 Merge: a7d7a21 dae3603 Author: synesissoftware <[email protected]> Date: Tue Dec 31 10:34:24 2024 +1100 Merge pull request synesissoftware#47 from synesissoftware/tests-ignore-env Ensure environment variables cannot disrupt tests commit dae3603 Author: Matt Wilson <[email protected]> Date: Tue Dec 31 10:30:49 2024 +1100 **test.unit.utility.cmdline** : ~ ensuring that definition of `"TEST_VERBOSITY"` or `"XTESTS_VERBOSITY"` environment variables cannot disrupt tests commit a7d7a21 Author: Matt Wilson <[email protected]> Date: Tue Dec 31 09:03:55 2024 +1100 STLSoft-1.11 (synesissoftware#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, ... commit 3bf62cd Author: Matt Wilson <[email protected]> Date: Tue Dec 17 08:03:44 2024 +1100 Substantial refactoring and minor feature enhancements (synesissoftware#44) * ~ preparatory refactoring * + added very short test macro names, such as `TEST_INT_EQ()`; + added scratch test **test.scratch.all_failure_messages**, which illustrates most/all failure messages * + added floating-point test macros `XTESTS_TEST_FLOATINGPOINT_GREATER`, `XTESTS_TEST_FLOATINGPOINT_GREATER_OR_EQUAL`, `XTESTS_TEST_FLOATINGPOINT_LESS`, `XTESTS_TEST_FLOATINGPOINT_LESS_OR_EQUAL` ; + added floating-point test macros `TEST_FLOATINGPOINT_GREATER`, `TEST_FLOATINGPOINT_GREATER_OR_EQUAL`, `TEST_FLOATINGPOINT_LESS`, `TEST_FLOATINGPOINT_LESS_OR_EQUAL` ; + added floating-point test macros `TEST_FP_GT`, `TEST_FP_GE`, `TEST_FP_LT`, `TEST_FP_LE` ; * ~ defect fix (for wide character tests) * ~ preparatory refactoring for failure messages * ~ preparatory work * ~ refactoring (`switch` statements) * ~ refactoring (`case` clauses) * ~ preparatory refactoring * ~ -preparatory refactoring * ~ tidying * ~ preparatory refactoring * + added colour for individual elements of failure statements (including expected value, actual value, relation, function) * ~ preparatory refactoring * + applied colour changes throught all parts (save for defect reporting elements) * ~ STLSoft version simplifications * **test.scratch.all_failure_messages** : choosing pointer values (for ease of before/after comparison) * - removed old non-colour implementations * ~ refactoring-to-function `relation_equals_()` * ~ refactoring-to-function `relation_contains_()` * ~ refactoring-to-function `colorise_()` * - removed old colour implementation(s) * ~ temporary renaming of field to help with imminent refactoring * ~ dealing with Windows' `min()` and `max()` macros * + added and applied `XTESTS_CALL_NORETURN()` macro * ~ tidying * ~ whitespace --------- Co-authored-by: Matt Wilson <[email protected]> commit e74a0b8 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 17:10:48 2024 +1100 Integral types (synesissoftware#43) * ~ simplified and separated (C++) implementation of `bool` tests * ~ simplified and separated (C++) implementation of `bool` tests * ~ updated **STLSoft** constructs, incl. macros * ~ layout * - dead code * Merged 'msq' into 'int-types' Squashed commit of the following: commit 1083e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:40:31 2024 +1100 ~ commit commit cf1e7e3 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:37:33 2024 +1100 Environment variable (for verbosity) (synesissoftware#41) * Merged 'env-edits' into 'env' Squashed commit of the following: commit c536d64742d96df26887394185d625ac029a306c Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:20:56 2024 +1100 ~ updated **STLSoft** constructs, incl. macros commit 2a4a1636607aefc948ecd708ba48dac84dfe2e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:25:09 2024 +1100 ~ layout * ~ preparatory changes * `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"` commit 6620ce6 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:35:44 2024 +1100 ~ improved boilerplate (synesissoftware#39) * ~ now uses `stlsoft::integral_traits<>` for integer test macros (in C++) to allow for custom integral types to be tested * Merged 'dev' into 'int-types' Squashed commit of the following: commit 97fc966 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 17:00:52 2024 +1100 Terse macros (synesissoftware#42) * ~ ignores * ~ all scratch-test entry-point source file names standardised * + added terse forms of macros, available by including **xtests/terse-api.h** * Merged 'env-edits' into 'env' Squashed commit of the following: commit c536d64742d96df26887394185d625ac029a306c Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:20:56 2024 +1100 ~ updated **STLSoft** constructs, incl. macros commit 2a4a1636607aefc948ecd708ba48dac84dfe2e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:25:09 2024 +1100 ~ layout * ~ preparatory changes * ~ boilerplate * Merged 'dev' into 'terse-macros' Squashed commit of the following: commit 1083e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:40:31 2024 +1100 ~ commit commit cf1e7e3 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:37:33 2024 +1100 Environment variable (for verbosity) (synesissoftware#41) * Merged 'env-edits' into 'env' Squashed commit of the following: commit c536d64742d96df26887394185d625ac029a306c Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:20:56 2024 +1100 ~ updated **STLSoft** constructs, incl. macros commit 2a4a1636607aefc948ecd708ba48dac84dfe2e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:25:09 2024 +1100 ~ layout * ~ preparatory changes * `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"` commit 6620ce6 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:35:44 2024 +1100 ~ improved boilerplate (synesissoftware#39) --------- Co-authored-by: Matt Wilson <[email protected]> commit 1083e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:40:31 2024 +1100 ~ commit commit cf1e7e3 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:37:33 2024 +1100 Environment variable (for verbosity) (synesissoftware#41) * Merged 'env-edits' into 'env' Squashed commit of the following: commit c536d64742d96df26887394185d625ac029a306c Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:20:56 2024 +1100 ~ updated **STLSoft** constructs, incl. macros commit 2a4a1636607aefc948ecd708ba48dac84dfe2e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:25:09 2024 +1100 ~ layout * ~ preparatory changes * `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"` commit 6620ce6 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:35:44 2024 +1100 ~ improved boilerplate (synesissoftware#39) --------- Co-authored-by: Matt Wilson <[email protected]> commit 97fc966 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 17:00:52 2024 +1100 Terse macros (synesissoftware#42) * ~ ignores * ~ all scratch-test entry-point source file names standardised * + added terse forms of macros, available by including **xtests/terse-api.h** * Merged 'env-edits' into 'env' Squashed commit of the following: commit c536d64742d96df26887394185d625ac029a306c Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:20:56 2024 +1100 ~ updated **STLSoft** constructs, incl. macros commit 2a4a1636607aefc948ecd708ba48dac84dfe2e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:25:09 2024 +1100 ~ layout * ~ preparatory changes * ~ boilerplate * Merged 'dev' into 'terse-macros' Squashed commit of the following: commit 1083e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:40:31 2024 +1100 ~ commit commit cf1e7e3 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:37:33 2024 +1100 Environment variable (for verbosity) (synesissoftware#41) * Merged 'env-edits' into 'env' Squashed commit of the following: commit c536d64742d96df26887394185d625ac029a306c Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:20:56 2024 +1100 ~ updated **STLSoft** constructs, incl. macros commit 2a4a1636607aefc948ecd708ba48dac84dfe2e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:25:09 2024 +1100 ~ layout * ~ preparatory changes * `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"` commit 6620ce6 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:35:44 2024 +1100 ~ improved boilerplate (synesissoftware#39) --------- Co-authored-by: Matt Wilson <[email protected]> commit 1083e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:40:31 2024 +1100 ~ commit commit cf1e7e3 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:37:33 2024 +1100 Environment variable (for verbosity) (synesissoftware#41) * Merged 'env-edits' into 'env' Squashed commit of the following: commit c536d64742d96df26887394185d625ac029a306c Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:20:56 2024 +1100 ~ updated **STLSoft** constructs, incl. macros commit 2a4a1636607aefc948ecd708ba48dac84dfe2e94 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 10:25:09 2024 +1100 ~ layout * ~ preparatory changes * `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"` commit 6620ce6 Author: Matt Wilson <[email protected]> Date: Sat Nov 23 16:35:44 2024 +1100 ~ improved boilerplate (synesissoftware#39)
1 parent 2e3571f commit 0cc8671

File tree

59 files changed

+5178
-2048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5178
-2048
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@
2424
/include/shwild/
2525
/include/xcontract/
2626
/include/xcover/
27-
/include/xtests/
2827

2928
/src/b64/
3029
/src/cstring/
3130
/src/recls/
3231
/src/shwild/
3332
/src/xcontract/
3433
/src/xcover/
35-
/src/xtests/
3634

3735
Debug Multithreaded DLL/
3836
Debug Multithreaded Dll/

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
"xloctime": "cpp",
137137
"xmemory": "cpp",
138138
"xstring": "cpp",
139+
"xtests.internal.string.c": "cpp",
139140
"xtr1common": "cpp",
140141
"xtree": "cpp",
141142
"xutility": "cpp",

CHANGES.txt

+18-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ xTests - Changes
22
================
33

44
Created: 22nd February 2008
5-
Updated: 14th July 2024
5+
Updated: 23rd November 2024
66

77

88
************************************
@@ -16,6 +16,23 @@ Updated: 14th July 2024
1616
************************************
1717

1818

19+
31st December 2024 - 0.26.0-beta1
20+
=================================
21+
22+
* now uses `stlsoft::integral_traits<>` for integer test macros (in C++) to allow for custom integral types to be tested;
23+
* `temp_file` now takes a `hint_dir` parameter to allow specification of directory for (temporary) file;
24+
* added missing test macros `XTESTS_TEST_FLOATINGPOINT_GREATER()`, `XTESTS_TEST_FLOATINGPOINT_GREATER_OR_EQUAL()`, `XTESTS_TEST_FLOATINGPOINT_LESS()`, `XTESTS_TEST_FLOATINGPOINT_LESS_OR_EQUAL()`;
25+
* added macro `XTESTS_COMMANDLINE_PARSE_HELP_OR_VERBOSITY()`, which allows for a unified command-line parsing in test programs;
26+
* added terse forms of macros, available by including **xtests/terse-api.h**;
27+
* `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"`;
28+
* added test programs **test.scratch.all_failure_messages**, **test.scratch.basics2**, **test.scratch.custom_integral_types**,
29+
* substantial internal refactoring;
30+
* minor tidying to CMake facilities;
31+
* minor improvements to examples;
32+
* minor improvements to project boilerplate files;
33+
* updated **STLSoft** constructs, incl. macros;
34+
35+
1936
18th November 2024 - 0.25.4
2037
===========================
2138

CMakeLists.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Purpose: Top-level CMake lists file for xTests
66
#
77
# Created: 9th October 2019
8-
# Updated: 17th November 2024
8+
# Updated: 23rd November 2024
99
#
1010
# ######################################################################## #
1111

@@ -76,6 +76,13 @@ if(MSVC)
7676

7777
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
7878
endif(MSVC_USE_MT)
79+
else(MSVC)
80+
81+
if(MSVC_USE_MT)
82+
83+
# this here just to absorb warning about not using `MSVC_USE_MT` (to
84+
# enable **prepare_cmake.sh** to be simple)
85+
endif(MSVC_USE_MT)
7986
endif(MSVC)
8087

8188

HISTORY.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
# xTests - History
22

33

4+
31st December 2024 - 0.26.0-beta1
5+
---------------------------------
6+
7+
* now uses `stlsoft::integral_traits<>` for integer test macros (in C++) to allow for custom integral types to be tested;
8+
* `temp_file` now takes a `hint_dir` parameter to allow specification of directory for (temporary) file;
9+
* added missing test macros `XTESTS_TEST_FLOATINGPOINT_GREATER()`, `XTESTS_TEST_FLOATINGPOINT_GREATER_OR_EQUAL()`, `XTESTS_TEST_FLOATINGPOINT_LESS()`, `XTESTS_TEST_FLOATINGPOINT_LESS_OR_EQUAL()`;
10+
* added macro `XTESTS_COMMANDLINE_PARSE_HELP_OR_VERBOSITY()`, which allows for a unified command-line parsing in test programs;
11+
* added terse forms of macros, available by including **xtests/terse-api.h**;
12+
* `XTESTS_COMMANDLINE_PARSE_VERBOSITY()` now also recognises, if the command-line argument `"--verbosity= . . ."` is not found, the enviroment variables `"XTESTS_VERBOSITY"` and `"TEST_VERBOSITY"`;
13+
* added test programs **test.scratch.all_failure_messages**, **test.scratch.basics2**, **test.scratch.custom_integral_types**,
14+
* substantial internal refactoring;
15+
* minor tidying to CMake facilities;
16+
* minor improvements to examples;
17+
* minor improvements to project boilerplate files;
18+
* updated **STLSoft** constructs, incl. macros;
19+
20+
421
18th November 2024 - 0.25.4
522
---------------------------
623

INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ The primary choice for installation is by use of **CMake**.
103103

104104

105105
```bash
106-
$ sudo cmake --install ./_build --config Release
106+
$ sudo cmake --install ${SIS_CMAKE_BUILD_DIR:-./_build} --config Release
107107
```
108108

109109
7. Then to use the library, it is a simple matter as follows:

NEWS.md

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

33
| Date | News Item |
44
| --------------------- | ------------------------------- |
5+
| 31st December 2024 | xTests 0.26.0-beta1 released |
56
| 18th November 2024 | xTests 0.25.4 released |
67
| 25th October 2024 | xTests 0.25.3 released |
78
| 22nd October 2024 | xTests 0.25.2 released |

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,13 @@ int factorial(int v)
295295

296296
switch (v)
297297
{
298-
case 0:
299-
case 1:
300-
return 1;
301-
default:
302-
return v * factorial(v - 1);
298+
case 0:
299+
case 1:
300+
301+
return 1;
302+
default:
303+
304+
return v * factorial(v - 1);
303305
}
304306
}
305307

@@ -341,7 +343,7 @@ int main(int argc, char* argv[])
341343
}
342344
```
343345
344-
**NOTE**: the language shown in **C**, but a **C++** version of this example program would be very similar. **C++** test programs have additiona support for facilities such as the throwing of exceptions.
346+
**NOTE**: the language shown is **C**, but a **C++** version of this example program would be very similar. **C++** test programs have additiona support for facilities such as the throwing of exceptions.
345347
346348
347349
## Project Information
@@ -364,23 +366,23 @@ If you'd like to help out with the project, please raise an issue via [GitHub Pa
364366
365367
#### STLSoft <!-- omit in toc -->
366368
367-
**xTests** depends on the **STLSoft** libraries, version 1.9.136 (or later). Version 1.10.6 (or later) is recommended.
369+
**xTests** depends on the **STLSoft** libraries, version 1.11.1 (or later):
368370
369-
* [STLSoft 1.9](http://github.com/synesissoftware/STLSoft-1.9/)
370-
* [STLSoft 1.10](http://github.com/synesissoftware/STLSoft-1.10/) (Recommended)
371+
* [STLSoft 1.11](http://github.com/synesissoftware/STLSoft-1.11/);
371372
372373
373374
### Related projects
374375
375376
Projects in which **xTests** is used for testing include:
376377
377378
* [**b64**](https://github.com/synesissoftware/b64)
379+
* [**CLASP**](https://github.com/synesissoftware/CLASP)
378380
* [**cstring**](https://github.com/synesissoftware/cstring)
379381
* [**FastFormat**](https://github.com/synesissoftware/FastFormat)
382+
* [**libCLImate**](https://github.com/synesissoftware/libCLImate)
380383
* [**libpath**](https://github.com/synesissoftware/libpath)
381384
* [**Pantheios**](https://github.com/synesissoftware/Pantheios)
382385
* [**recls**](https://github.com/synesissoftware/recls)
383-
* [**shwild**](https://github.com/synesissoftware/shwild)
384386
* [**UNIXem**](https://github.com/synesissoftware/UNIXem)
385387
386388
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

+8-8
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: 13th October 2024
8+
* Updated: 31st December 2024
99
*
1010
* ////////////////////////////////////////////////////////////////////// */
1111

@@ -32,13 +32,13 @@ int factorial(int v)
3232

3333
switch (v)
3434
{
35-
case 0:
36-
case 1:
35+
case 0:
36+
case 1:
3737

38-
return 1;
39-
default:
38+
return 1;
39+
default:
4040

41-
return v * factorial(v - 1);
41+
return v * factorial(v - 1);
4242
}
4343
}
4444

@@ -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)

0 commit comments

Comments
 (0)