Skip to content

make check: Add KYUADEBUG to target specific kyua tests#1976

Open
patmaddox wants to merge 1 commit intofreebsd:mainfrom
patmaddox:patmaddox/sytutkylpull
Open

make check: Add KYUADEBUG to target specific kyua tests#1976
patmaddox wants to merge 1 commit intofreebsd:mainfrom
patmaddox:patmaddox/sytutkylpull

Conversation

@patmaddox
Copy link
Contributor

@patmaddox patmaddox commented Jan 17, 2026

make check: Add make vars to list and debug kyua test cases

kyua supports listing tests, optionally including metadata. It also supports targeting a specific test in debug mode. It shows the commands that were run, stdout / stderr, and details of the checks that failed.

Examples:

make -C bin/ls check -DKYUALIST
make -C bin/ls check -DKYUALIST_V
make -C bin/ls check KYUADEBUG=ls_tests:T_flag

(looks like I'm unable to edit the PR subject)

@patmaddox patmaddox requested review from bapt and bsdimp as code owners January 17, 2026 11:19
@github-actions
Copy link

github-actions bot commented Jan 17, 2026

Thank you for taking the time to contribute to FreeBSD!

Some of files have special handling:

Important

@concussious wants to review changes to share/man/

Important

@bsdimp @bapt @bdrewery @brooksdavis @emaste wants to review changes to share/mk

@patmaddox patmaddox force-pushed the patmaddox/sytutkylpull branch from 3666c87 to c5d99cc Compare January 17, 2026 13:18
@concussious concussious requested a review from ngie-eign January 17, 2026 15:14
@kevans91 kevans91 requested a review from ihoro February 5, 2026 04:07

KYUA?= kyua

KYUA_CMD= ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile
Copy link
Contributor

@kevans91 kevans91 Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be tempted to move this to an .else branch, or construct it differently to highlight the differences better. Something like:

if !empty(KYUADEBUG)
KYUA_CMD_VERB=debug
KYUA_CMD_ARGS=${KYUADEBUG}
.endif

KYUA_CMD= ${KYUA} ${KYUA_CMD_VERB:Utest} -k ${DESTDIR}${TESTSDIR}/Kyuafile ${KYUA_CMD_ARGS}

Maybe that's not really an improvement, though.

Copy link
Contributor Author

@patmaddox patmaddox Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it. I wanted to communicate that test was default and I think yours does that more clearly. It also opens up more of kyua API. I added list and list -v.

Not sure when it makes sense to move from make vars to separate targets... but I get good mileage out of KYUADEBUG, and now KYUALIST_V looks nice.

Though these sorts of changes make me wonder: how do other people typically debug tests? I guess they must make install and then kyua debug from there?

kyua supports listing tests, optionally including metadata. It also
supports targeting a specific test in debug mode. It shows the
commands that were run, stdout / stderr, and details of the checks
that failed.

Examples:

    make -C bin/ls check -DKYUALIST
    make -C bin/ls check -DKYUALIST_V
    make -C bin/ls check KYUADEBUG=ls_tests:T_flag

Signed-off-by: Pat Maddox <pat@patmaddox.com>
@patmaddox patmaddox force-pushed the patmaddox/sytutkylpull branch from c5d99cc to 2aeb894 Compare February 6, 2026 01:22
@patmaddox patmaddox requested a review from kevans91 February 6, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants