tests/clar.c


Log

Author Commit Date CI Message
Edward Thomson c708e5e5 2020-06-05T14:11:34 Merge pull request #5541 from libgit2/ethomson/clar_tap clar: add tap output option
Edward Thomson cad7a1ba 2020-06-05T08:42:38 clar: include the function name
Edward Thomson f7250cc3 2020-06-04T07:23:15 clar: add tap output
Edward Thomson 691315e6 2020-06-03T15:47:42 clar: add an output abstraction layer Add an output abstraction layer, with a single output format, "clap", the clar protocol, which is the current output format for clar.
Edward Thomson 0187f36a 2020-06-03T15:22:44 clar: parse arguments before printing the header We want to parse arguments before we start printing any output; the arguments themselves may impact the way we display that output.
Edward Thomson 0d3ce2ac 2020-06-02T10:23:41 offer exact name matching with a `$` suffix When using `-s` to specify a particular test, it will do a prefix match. Thus, `-sapply::both::rename_a_to_b_to_c` will match both a test named `test_apply_both__rename_a_to_b_to_c` and a test that begins with that name, like `test_apply_both__rename_a_to_b_to_c_exact`. Permit a trailing `$` to `-s` syntax. This allows a user to specify `-sapply::both::rename_a_to_b_to_c$` to match _only_ the `test_apply_both__rename_a_to_b_to_c` function. We already filter to ensure that the given prefix matches the current test name. Also ensure that the length of the test name matches the length of the filter, sans trailing `$`.
Patrick Steinhardt fe3b5da3 2019-07-19T12:43:55 clar: provide ability to set summary file via environment As different test suites for our CI are mostly defined via CMake, it's hard to run those tests with a summary file path as that'd require us to add another parameter to all unit tests. As we do not want to unconditionally run unit tests with a summary file, we would have to add another CMake build parameter for test execution, which is ugly. Instead, implement a way to provide a summary file path via the environment.
Patrick Steinhardt 77d7e5eb 2019-06-27T15:29:36 clar: use `size_t` to keep track of current line number We use the `__LINE__` macro in several places throughout clar to allow easier traceability when e.g. a test fails. While `__LINE__` is of type `size_t`, the clar functions all accept an integer and thus may loose precision. While unlikely that any file in our codebase will exceed a linecount of `INT_MAX`, let's convert it anyway to silence any compiler warnings.
Edward Thomson 38e6b287 2019-06-15T22:25:10 mingw: use `struct stat`
Edward Thomson d17e67d0 2018-09-08T18:54:21 clar: iterate errors in report_all / report_errors Instead of trying to have a clever iterator pattern that increments the error number, just iterate over errors in the report errors or report all functions as it's easier to reason about in this fashion.
Edward Thomson b67a93ff 2018-09-04T14:00:49 clar: remove globals; error-check fprintf/fclose Remove the global summary filename and file pointer; pass them in to the summary functions as needed. Error check the results of buffered I/O calls.
Edward Thomson baa5c20d 2018-08-26T15:31:14 clar: accept a value for the summary filename Accept an (optional) value for the summary filename. Continues to default to summary.xml.
Etienne Samson 59f1e477 2018-07-27T23:00:09 Barebones JUnit XML output
Etienne Samson bf9fc126 2018-07-26T23:02:20 Isolate test reports This makes it possible to keep track of every test status (even successful ones), and their errors, if any.
Edward Thomson 90753a96 2018-08-26T15:11:21 clar: refactor explicitly run test behavior Previously, supplying `-s` to explicitly enable some test(s) would run the tests immediately from the argument parser. This forces us to set up the entire clar environment (for example: sandboxing) before argument parsing takes place. Refactor the behavior of `-s` to add the explicitly chosen tests to a list that is executed later. This untangles the argument parsing from the setup lifecycle, allowing us to use the arguments to perform the setup.
Yoney 32758631 2017-11-11T15:38:27 clar: verify command line arguments before execute When executing `libgit2_clar -smerge -invalid_option`, it will first execute the merge test suite and afterwards output help because of the invalid option. With this changa, it verifies all options before execute. If there are any invalid options, it will output help and exit without actually executing the test suites.
Patrick Steinhardt f2cab0a6 2016-08-04T11:49:39 clar: fix parsing of test suite prefixes When passing in a specific suite which should be executed by clar via `-stest::suite`, we try to parse this string and then include all tests contained in this suite. This also includes all tests in sub-suites, e.g. 'test::suite::foo'. In the case where multiple suites start with the same _string_, for example 'test::foo' and 'test::foobar', we fail to distinguish this correctly. When passing in `-stest::foobar`, we wrongly determine that 'test::foo' is a prefix and try to execute all of its matching functions. But as no function will now match 'test::foobar', we simply execute nothing. To fix this, we instead have to check if the prefix is an actual suite prefix as opposed to a simple string prefix. We do so by by inspecting if the first two characters trailing the prefix are our suite delimiters '::', and only consider the filter as matching in this case.
Patrick Steinhardt 8fd74c08 2016-02-09T12:18:28 Avoid old-style function definitions Avoid declaring old-style functions without any parameters. Functions not accepting any parameters should be declared with `void fn(void)`. See ISO C89 $3.5.4.3.
Edward Thomson 08c29c44 2015-03-17T19:04:48 clar: update to 08f434d
Edward Thomson cfcb346d 2015-02-27T00:30:50 Update to clar 2b73f5e
Edward Thomson 83276dcc 2015-02-05T13:24:38 Update clar to d17c7f6
Edward Thomson 09debe12 2014-12-01T13:06:11 clar: wide character comparisons
Vicent Marti 0f65733b 2014-04-02T18:50:47 Clar: skip tests
Edward Thomson ed38bff1 2014-03-28T17:54:43 Update clar to 4b75388
Edward Thomson 10be94e9 2014-03-28T10:09:13 Update clar to 587f88a
Edward Thomson dd954a37 2014-03-07T10:53:00 Update clar to e1990d6
Edward Thomson 806571f3 2014-03-07T00:28:18 Update clar to a0b00f0
Ben Straub 17820381 2013-11-14T14:05:52 Rename tests-clar to tests