Introduce clar testing framework
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v8 Latest14 patches 3 repliesIn review
- v714 patches 7 repliesSuperseded
- v613 patches 12 repliesSuperseded
Earlier versions · 5
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v5 | 9 patches | 17 replies | Superseded | |
| v4 | 7 patches | 2 replies | Superseded | |
| v3 RFC | 7 patches | 12 replies | Superseded | |
| v2 RFC | 7 patches | 4 replies | Superseded | |
| v1 RFC | 3 patches | 33 replies | Superseded |
Changes in v8 from the cover letter
- Properly wire up the "--immediate" flag.
- Give a hint for the syntax to run only specific suites or tests for the "--run" and "--exclude" options.
Patches in v8 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | t: do not pass GIT_TEST_OPTS to unit tests with provet/ t/ | +3 | 0 replies | |
| 2/14 | t: import the clar unit testing frameworkDocumentation/ Makefile t/ +17 more | +2943 | 0 replies | |
| 3/14 | t/clar: fix compatibility with NonStopt/ | +6 | 0 replies | |
| 4/14 | clar: avoid compile error with mingw-w64t/ | +1 | 0 replies | |
| 5/14 | clar(win32): avoid compile error due to unused `fs_copy()`t/ | +2 | 0 replies | |
| 6/14 | clar: stop including `shellapi.h` unnecessarilyt/ | +1 | 0 replies | |
| 7/14 | Makefile: fix sparse dependency on GENERATED_HMakefile | +2 | 0 replies | |
| 8/14 | Makefile: make hdr-check depend on generated headersMakefile | +1 | 0 replies | |
| 9/14 | Makefile: do not use sparse on third-party sourcesMakefile | +2 | 0 replies | |
| 10/14 | Makefile: wire up the clar unit testing framework.gitignore Makefile t/ +4 more | +95 | 2 replies | |
| 11/14 | t/unit-tests: implement test drivert/ | +43 | 0 replies | |
| 12/14 | t/unit-tests: convert strvec tests to use clarMakefile t/ t/ | +242 | 0 replies | |
| 13/14 | t/unit-tests: convert ctype tests to use clarMakefile t/ t/ | +69 | 0 replies | |
| 14/14 | clar: add CMake supportcontrib/ | +53 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.
Cover letter [PATCH v8 00/14] Introduce clar testing framework
Hi,
this is the 8th version of my patch series that introduces the clar testing framework.
Changes compared to v7:
- Properly wire up the "--immediate" flag.
- Give a hint for the syntax to run only specific suites or tests for the "--run" and "--exclude" options.
Thanks!
Patrick
Johannes Schindelin (4):
clar: avoid compile error with mingw-w64 clar(win32): avoid compile error due to unused fs_copy()
clar: stop including shellapi.h unnecessarily
clar: add CMake support
Patrick Steinhardt (10):
t: do not pass GIT_TEST_OPTS to unit tests with prove
t: import the clar unit testing framework t/clar: fix compatibility with NonStop
Makefile: fix sparse dependency on GENERATED_H
Makefile: make hdr-check depend on generated headers
Makefile: do not use sparse on third-party sources
Makefile: wire up the clar unit testing framework t/unit-tests: implement test driver t/unit-tests: convert strvec tests to use clar t/unit-tests: convert ctype tests to use clar
.gitignore | 1 +
Documentation/technical/unit-tests.txt | 2 +
Makefile | 53 +-
contrib/buildsystems/CMakeLists.txt | 53 ++
t/Makefile | 4 +-
t/run-test.sh | 2 +-
t/unit-tests/.gitignore | 2 +
t/unit-tests/clar-generate.awk | 50 ++
t/unit-tests/clar/.github/workflows/ci.yml | 23 +
t/unit-tests/clar/COPYING | 15 +
t/unit-tests/clar/README.md | 329 ++++++++
t/unit-tests/clar/clar.c | 842 +++++++++++++++++++++
t/unit-tests/clar/clar.h | 173 +++++
t/unit-tests/clar/clar/fixtures.h | 50 ++
t/unit-tests/clar/clar/fs.h | 524 +++++++++++++
t/unit-tests/clar/clar/print.h | 211 ++++++
t/unit-tests/clar/clar/sandbox.h | 159 ++++
t/unit-tests/clar/clar/summary.h | 143 ++++
t/unit-tests/clar/generate.py | 266 +++++++
t/unit-tests/clar/test/.gitignore | 4 +
t/unit-tests/clar/test/Makefile | 39 +
t/unit-tests/clar/test/clar_test.h | 16 +
t/unit-tests/clar/test/main.c | 40 +
t/unit-tests/clar/test/main.c.sample | 27 +
t/unit-tests/clar/test/resources/test/file | 1 +
t/unit-tests/clar/test/sample.c | 84 ++
t/unit-tests/{t-ctype.c => ctype.c} | 71 +-
t/unit-tests/strvec.c | 241 ++++++
t/unit-tests/t-strvec.c | 211 ------
t/unit-tests/unit-test.c | 47 ++
t/unit-tests/unit-test.h | 10 +
31 files changed, 3459 insertions(+), 234 deletions(-)
create mode 100644 t/unit-tests/clar-generate.awk
create mode 100644 t/unit-tests/clar/.github/workflows/ci.yml
create mode 100644 t/unit-tests/clar/COPYING
create mode 100644 t/unit-tests/clar/README.md
create mode 100644 t/unit-tests/clar/clar.c
create mode 100644 t/unit-tests/clar/clar.h
create mode 100644 t/unit-tests/clar/clar/fixtures.h
create mode 100644 t/unit-tests/clar/clar/fs.h
create mode 100644 t/unit-tests/clar/clar/print.h
create mode 100644 t/unit-tests/clar/clar/sandbox.h
create mode 100644 t/unit-tests/clar/clar/summary.h
create mode 100755 t/unit-tests/clar/generate.py
create mode 100644 t/unit-tests/clar/test/.gitignore
create mode 100644 t/unit-tests/clar/test/Makefile
create mode 100644 t/unit-tests/clar/test/clar_test.h
create mode 100644 t/unit-tests/clar/test/main.c
create mode 100644 t/unit-tests/clar/test/main.c.sample
create mode 100644 t/unit-tests/clar/test/resources/test/file
create mode 100644 t/unit-tests/clar/test/sample.c
rename t/unit-tests/{t-ctype.c => ctype.c} (68%)
create mode 100644 t/unit-tests/strvec.c
delete mode 100644 t/unit-tests/t-strvec.c
create mode 100644 t/unit-tests/unit-test.c
create mode 100644 t/unit-tests/unit-test.hRange-diff against v7:
1: b67f10ec0b0 = 1: b67f10ec0b0 t: do not pass GIT_TEST_OPTS to unit tests with prove
2: 55a9b46e65f = 2: 55a9b46e65f t: import the clar unit testing framework
3: f24401f0a87 = 3: f24401f0a87 t/clar: fix compatibility with NonStop
4: 658a601c541 = 4: 658a601c541 clar: avoid compile error with mingw-w64
5: 0b8a6ac5fed = 5: 0b8a6ac5fed clar(win32): avoid compile error due to unused `fs_copy()`
6: c50e7a0ea68 = 6: c50e7a0ea68 clar: stop including `shellapi.h` unnecessarily
7: b8f3f16dd27 = 7: b8f3f16dd27 Makefile: fix sparse dependency on GENERATED_H
8: 3d3fe443b9a = 8: 3d3fe443b9a Makefile: make hdr-check depend on generated headers
9: 7d0f494850a = 9: 7d0f494850a Makefile: do not use sparse on third-party sources
10: 9c74c5ae019 = 10: 9c74c5ae019 Makefile: wire up the clar unit testing framework
11: 8bd5b3e2b29 ! 11: 81d932bfa33 t/unit-tests: implement test driver
@@ t/unit-tests/unit-test.c
+ struct string_list exclude_args = STRING_LIST_INIT_NODUP;
+ int immediate = 0;
+ struct option options[] = {
-+ OPT_BOOL('i', "--immediate", &immediate,
++ OPT_BOOL('i', "immediate", &immediate,
+ N_("immediately exit upon the first failed test")),
-+ OPT_STRING_LIST('r', "run", &run_args, N_("name"),
-+ N_("run only test suite or individual test <name>")),
-+ OPT_STRING_LIST('x', "exclude", &exclude_args, N_("name"),
-+ N_("exclude test suite <name>")),
++ OPT_STRING_LIST('r', "run", &run_args, N_("suite[::test]"),
++ N_("run only test suite or individual test <suite[::test]>")),
++ OPT_STRING_LIST('x', "exclude", &exclude_args, N_("suite"),
++ N_("exclude test suite <suite>")),
+ OPT_END(),
+ };
+ struct strvec args = STRVEC_INIT;
@@ t/unit-tests/unit-test.c
+
+ strvec_push(&args, argv[0]);
+ strvec_push(&args, "-t");
++ if (immediate)
++ strvec_push(&args, "-Q");
+ for (size_t i = 0; i < run_args.nr; i++)
+ strvec_pushf(&args, "-s%s", run_args.items[i].string);
+ for (size_t i = 0; i < exclude_args.nr; i++)
12: 3c3b9eacdfb = 12: 604303e31aa t/unit-tests: convert strvec tests to use clar
13: c8360db2f86 = 13: ba05b9f1eef t/unit-tests: convert ctype tests to use clar
14: d51c146cd9d = 14: 8441d29daa8 clar: add CMake supportSignature · 1 line
2.46.0.519.g2e7b89e038.dirty