<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/helper/test-example-tap.c, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2026-03-11T18:38:54Z</updated>
<entry>
<title>test-lib: print escape sequence names</title>
<updated>2026-03-11T18:38:54Z</updated>
<author>
<name>Pablo Sabater</name>
<email>pabloosabaterr@gmail.com</email>
</author>
<published>2026-03-11T03:14:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=e30e9442fd9b90d96dde2fad4a6b26d7a03dee5e'/>
<id>urn:sha1:e30e9442fd9b90d96dde2fad4a6b26d7a03dee5e</id>
<content type='text'>
When printing expected/actual characters in failed checks, use
their names (\a, \b, \n, ...) instead of their octal representation,
making it easier to read.

Add tests to test-example-tap.c
Update t0080-unit-test-output.sh to match the desired output

Teach 'print_one_char()' the equivalent name

Signed-off-by: Pablo Sabater &lt;pabloosabaterr@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/mark-unused-parameters'</title>
<updated>2024-08-26T18:32:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-08-26T18:32:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2b30d66c437b156762a0552d01e3825881080c23'/>
<id>urn:sha1:2b30d66c437b156762a0552d01e3825881080c23</id>
<content type='text'>
Mark unused parameters as UNUSED to squelch -Wunused warnings.

* jk/mark-unused-parameters:
  t-hashmap: stop calling setup() for t_intern() test
  scalar: mark unused parameters in dummy function
  daemon: mark unused parameters in non-posix fallbacks
  setup: mark unused parameter in config callback
  test-mergesort: mark unused parameters in trivial callback
  t-hashmap: mark unused parameters in callback function
  reftable: mark unused parameters in virtual functions
  reftable: drop obsolete test function declarations
  reftable: ignore unused argc/argv in test functions
  unit-tests: ignore unused argc/argv
  t/helper: mark more unused argv/argc arguments
  oss-fuzz: mark unused argv/argc argument
  refs: mark unused parameters in do_for_each_reflog_helper()
  refs: mark unused parameters in ref_store fsck callbacks
  update-ref: mark more unused parameters in parser callbacks
  imap-send: mark unused parameter in ssl_socket_connect() fallback
</content>
</entry>
<entry>
<title>t/helper: mark more unused argv/argc arguments</title>
<updated>2024-08-17T16:46:11Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-08-17T08:22:52Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7046c85cceb2d28124ce2229242e9fef7a63f4f0'/>
<id>urn:sha1:7046c85cceb2d28124ce2229242e9fef7a63f4f0</id>
<content type='text'>
This is a continuation of 126e3b3d2a (t/helper: mark unused argv/argc
arguments, 2023-03-28) to cover a few new cases:

 - test-example-tap was added since that commit

 - test-hashmap used to accept the "ignorecase" argument on the command
   line. But since most of its logic was moved to a unit-test in
   3469a23659 (t: port helper/test-hashmap.c to unit-tests/t-hashmap.c,
   2024-08-03), it now ignores its argv entirely.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>unit-tests: add if_test</title>
<updated>2024-07-30T20:32:43Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2024-07-30T14:08:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=96c6304c1866d8dd2f17208e906749f999df0911'/>
<id>urn:sha1:96c6304c1866d8dd2f17208e906749f999df0911</id>
<content type='text'>
The macro TEST only allows defining a test that consists of a single
expression.  Add a new macro, if_test, which provides a way to define
unit tests that are made up of one or more statements.

if_test allows defining self-contained tests en bloc, a bit like
test_expect_success does for regular tests.  It acts like a conditional;
the test body is executed if test_skip_all() had not been called before.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>unit-tests: show location of checks outside of tests</title>
<updated>2024-07-30T20:32:43Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2024-07-30T14:07:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1f452d6c6835e41d25e163616d8ee75aa91b5b17'/>
<id>urn:sha1:1f452d6c6835e41d25e163616d8ee75aa91b5b17</id>
<content type='text'>
Checks outside of tests are caught at runtime and reported like this:

 Assertion failed: (ctx.running), function test_assert, file test-lib.c, line 267.

The assert() call aborts the unit test and doesn't reveal the location
or even the type of the offending check, as test_assert() is called by
all of them.

Handle it like the opposite case, a test without any checks: Don't
abort, but report the location of the actual check, along with a message
explaining the situation.  The output for example above becomes:

 # BUG: check outside of test at t/helper/test-example-tap.c:75

... and the unit test program continues and indicates the error in its
exit code at the end.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t0080: turn t-basic unit test into a helper</title>
<updated>2024-05-06T21:06:34Z</updated>
<author>
<name>Josh Steadmon</name>
<email>steadmon@google.com</email>
</author>
<published>2024-05-06T19:57:31Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=80bb227e41f462bb04f07991cb2bb531453820a5'/>
<id>urn:sha1:80bb227e41f462bb04f07991cb2bb531453820a5</id>
<content type='text'>
While t/unit-tests/t-basic.c uses the unit-test framework added in
e137fe3b29 (unit tests: add TAP unit test framework, 2023-11-09), it is
not a true unit test in that it intentionally fails in order to exercise
various codepaths in the unit-test framework. Thus, we intentionally
exclude it when running unit tests through the various t/Makefile
targets. Instead, it is executed by t0080-unit-test-output.sh, which
verifies its output follows the TAP format expected for the various
pass, skip, or fail cases.

As such, it makes more sense for t-basic to be a helper item for
t0080-unit-test-output.sh, so let's move it to
t/helper/test-example-tap.c and adjust Makefiles as necessary.

Signed-off-by: Josh Steadmon &lt;steadmon@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
