Page MenuHomeFreeBSD

Generate a default TESTSDIR
AbandonedPublic

Authored by ngie on Oct 28 2014, 11:33 PM.
Tags
None
Referenced Files
F141156469: D1022.diff
Thu, Jan 1, 3:36 PM
Unknown Object (File)
Thu, Dec 4, 7:20 AM
Unknown Object (File)
Dec 1 2025, 6:44 PM
Unknown Object (File)
Nov 25 2025, 11:57 PM
Unknown Object (File)
Nov 20 2025, 9:05 PM
Unknown Object (File)
Nov 20 2025, 9:03 PM
Unknown Object (File)
Nov 20 2025, 9:02 PM
Unknown Object (File)
Nov 20 2025, 9:02 PM
Subscribers

Details

Summary

Generate a default TESTSDIR while still providing the ability to overwrite it

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 695
Build 695: arc lint + arc unit

Event Timeline

bapt retitled this revision from to Generate a default TESTSDIR.
bapt updated this object.
bapt edited the test plan for this revision. (Show Details)
bapt added reviewers: imp, ngie, jmmv.
ngie requested changes to this revision.Oct 28 2014, 11:42 PM
ngie edited edge metadata.

I disagree with this because it will break if bsd.test.mk is not in share/mk , and it's trying to resolve a bigger problem in the build system.

We need SRCTOP (and other relevant variables) added to FreeBSD (sjg@ has it in the bmake branch). It needs to be used here and elsewhere.

This revision now requires changes to proceed.Oct 28 2014, 11:42 PM
imp edited edge metadata.

This is fine.

SRCTOP is a much bigger kettle of fish, and shouldn't block this fix.

jmmv requested changes to this revision.Oct 29 2014, 11:59 AM
jmmv edited edge metadata.

This is misplaced. TESTSDIR is defined in suite.test.mk, so the change has to be made there.

I don't object to having a sane default for TESTSDIR, though the syntax to make this happen in make hurts my eyes. Actually, I don't even understand what this is intending to compute, and a few local tests show results that don't make sense to me. Could you explain and update the change description accordingly? "Generate a default TESTSDIR" is not very descriptive...

bapt edited edge metadata.

Move definition to suite.test.mk and try to right an understandable description

emaste added inline comments.
share/mk/suite.test.mk
12–13 ↗(On Diff #2147)

One of these seems more natural to me:

  • It is derived from TESTSBASE and the relative path to the Makefile.
  • It is derived from TESTSBASE and the relative directory containing the Makefile.
jmmv requested changes to this revision.Oct 30 2014, 4:36 PM
jmmv edited edge metadata.

OK, now I understand the value of the new setting.

share/mk/suite.test.mk
12–13 ↗(On Diff #2147)

Indeed. And make that a complete sentence:

The default value of TESTSDIR is TESTSBASE plus the relative path to the directory containing the Makefile.

This revision now requires changes to proceed.Oct 30 2014, 4:36 PM
ngie requested changes to this revision.May 23 2015, 4:50 AM
ngie edited edge metadata.
ngie added inline comments.
share/mk/suite.test.mk
14 ↗(On Diff #2147)

This unfortunately won't work in all cases (I know because I ran into one of these cases recently at $work). Sometimes the path to suite.test.mk will be relative (e.g. when computed from share/mk), which will make TESTSDIR -> ${TESTSBASE}/. :(...

Again, we need SRCTOP in order to determine this information properly...

ngie edited reviewers, added: bapt; removed: ngie.

projects/bmake makes this a lot simpler now. Commandeering the revision.

ngie edited edge metadata.

Default TESTSDIR to ${TESTSBASE}/${RELDIR:H}

The assumption is that the snippet is run out of the tests/ subdirectory

There are exceptions to the rule, hence the need for the override

bapt edited edge metadata.

Change has been committed, but closing this revision out by abandoning it because I don't have another option.