Page MenuHomeFreeBSD

lorder: skip tests if cc not available
AbandonedPublic

Authored by olivier on Mar 28 2024, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 3:50 AM
Unknown Object (File)
Mon, Nov 25, 6:08 AM
Unknown Object (File)
Thu, Nov 21, 12:50 AM
Unknown Object (File)
Wed, Nov 20, 9:16 PM
Unknown Object (File)
Fri, Nov 8, 1:45 AM
Unknown Object (File)
Thu, Nov 7, 11:00 PM
Unknown Object (File)
Thu, Nov 7, 10:03 PM
Unknown Object (File)
Thu, Nov 7, 1:49 PM
Subscribers
None

Details

Reviewers
des
Summary

On system without compilere installed the tests are failing:

 $ kyua test usr.bin/lorder/
usr.bin/lorder/lorder_test:noargs  ->  passed  [0.019s]
usr.bin/lorder/lorder_test:dashdash  ->  failed: atf-check failed; see the output of the test for details  [0.029s]
usr.bin/lorder/lorder_test:invalid  ->  passed  [0.029s]
usr.bin/lorder/lorder_test:nonexistent  ->  passed  [0.028s]
usr.bin/lorder/lorder_test:onearg  ->  failed: atf-check failed; see the output of the test for details  [0.028s]
usr.bin/lorder/lorder_test:objects  ->  failed: atf-check failed; see the output of the test for details  [0.030s]
usr.bin/lorder/lorder_test:archives  ->  failed: atf-check failed; see the output of the test for details  [0.045s]

3/7 passed (4 failed)

Add a check for cc on tests using it.

Test Plan

Skip if cc is missing:

# mv /usr/bin/cc /usr/bin/cc.bak
# kyua test usr.bin/lorder/
usr.bin/lorder/lorder_test:archives  ->  skipped: The required program cc could not be found in the PATH  [0.009s]
usr.bin/lorder/lorder_test:dashdash  ->  skipped: The required program cc could not be found in the PATH  [0.010s]
usr.bin/lorder/lorder_test:objects  ->  skipped: The required program cc could not be found in the PATH  [0.010s]
usr.bin/lorder/lorder_test:onearg  ->  skipped: The required program cc could not be found in the PATH  [0.010s]
usr.bin/lorder/lorder_test:noargs  ->  passed  [0.014s]
usr.bin/lorder/lorder_test:invalid  ->  passed  [0.020s]
usr.bin/lorder/lorder_test:nonexistent  ->  passed  [0.019s]

7/7 passed (0 failed)

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

olivier created this revision.

Why are you testing lorder, which is part of the toolchain, on a system without a toolchain?

In D44548#1015876, @des wrote:

Why are you testing lorder, which is part of the toolchain, on a system without a toolchain?

I’m just running the regression tests from a FreeBSD with a make.conf full of WITHOUT_
And since the introduction of those tests, I’m noticing those new tests are failing.
So one idea is too declare the requiere_prog to avoid that.

Now that I think of it, this isn't enough, because lorder itself uses nm, which is also conditional on MK_TOOLCHAIN. Also, the canonical way to do this is to add atf_set require.progs to the test case head, which allows Kyua to skip the test entirely, instead of trying to run it and then ignoring the failure.

In D44548#1016031, @des wrote:

I think D44558 is a better approach.

Yes: Thanks