forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ps/clar-unit-test' into seen
* ps/clar-unit-test: clar: add CMake support t/unit-tests: convert ctype tests to use clar t/unit-tests: convert strvec tests to use clar Makefile: wire up the clar unit testing framework Makefile: do not use sparse on third-party sources Makefile: make hdr-check depend on generated headers Makefile: fix sparse dependency on GENERATED_H clar: stop including `shellapi.h` unnecessarily clar(win32): avoid compile error due to unused `fs_copy()` clar: avoid compile error with mingw-w64 t/clar: fix compatibility with NonStop t: import the clar unit testing framework t: do not pass GIT_TEST_OPTS to unit tests with prove
- Loading branch information
Showing
31 changed files
with
3,409 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/bin | ||
/clar.suite | ||
/clar-decls.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
function add_suite(suite, initialize, cleanup, count) { | ||
if (!suite) return | ||
suite_count++ | ||
callback_count += count | ||
suites = suites " {\n" | ||
suites = suites " \"" suite "\",\n" | ||
suites = suites " " initialize ",\n" | ||
suites = suites " " cleanup ",\n" | ||
suites = suites " _clar_cb_" suite ", " count ", 1\n" | ||
suites = suites " },\n" | ||
} | ||
|
||
BEGIN { | ||
suites = "static struct clar_suite _clar_suites[] = {\n" | ||
} | ||
|
||
{ | ||
name = $3; sub(/\(.*$/, "", name) | ||
suite = name; sub(/^test_/, "", suite); sub(/__.*$/, "", suite) | ||
short_name = name; sub(/^.*__/, "", short_name) | ||
cb = "{ \"" short_name "\", &" name " }" | ||
if (suite != prev_suite) { | ||
add_suite(prev_suite, initialize, cleanup, count) | ||
if (callbacks) callbacks = callbacks "};\n" | ||
callbacks = callbacks "static const struct clar_func _clar_cb_" suite "[] = {\n" | ||
initialize = "{ NULL, NULL }" | ||
cleanup = "{ NULL, NULL }" | ||
count = 0 | ||
prev_suite = suite | ||
} | ||
if (short_name == "initialize") { | ||
initialize = cb | ||
} else if (short_name == "cleanup") { | ||
cleanup = cb | ||
} else { | ||
callbacks = callbacks " " cb ",\n" | ||
count++ | ||
} | ||
} | ||
|
||
END { | ||
add_suite(suite, initialize, cleanup, count) | ||
suites = suites "};" | ||
if (callbacks) callbacks = callbacks "};" | ||
print callbacks | ||
print suites | ||
print "static const size_t _clar_suite_count = " suite_count ";" | ||
print "static const size_t _clar_callback_count = " callback_count ";" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v2 | ||
- name: Build | ||
run: | | ||
cd test | ||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ISC License | ||
|
||
Copyright (c) 2011-2015 Vicent Marti | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Oops, something went wrong.