Discussion:
How to run tests without installing?
(too old to reply)
Christian Weisgerber
2024-04-29 10:34:51 UTC
Permalink
How can I run the regression tests on my work-in-progress without
installing it first?

Say I'm changing something in sh. Can I run the tests on the
compiled sh in /usr/obj, without having to install my potentially
broken work into the system? Running "make tests" in src/bin/sh
doesn't seem to actually test anything.
--
Christian "naddy" Weisgerber ***@mips.inka.de


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Brooks Davis
2024-04-29 20:47:46 UTC
Permalink
Post by Christian Weisgerber
How can I run the regression tests on my work-in-progress without
installing it first?
Say I'm changing something in sh. Can I run the tests on the
compiled sh in /usr/obj, without having to install my potentially
broken work into the system? Running "make tests" in src/bin/sh
doesn't seem to actually test anything.
Generally speaking you can't. This is one of the problematic things
about the current test framework. The best you can do for something
like sh where you really don't want to install a broken one is probably
installing in a jail and running tests there.

-- Brooks


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Warner Losh
2024-04-29 22:16:58 UTC
Permalink
Post by Brooks Davis
Post by Christian Weisgerber
How can I run the regression tests on my work-in-progress without
installing it first?
Say I'm changing something in sh. Can I run the tests on the
compiled sh in /usr/obj, without having to install my potentially
broken work into the system? Running "make tests" in src/bin/sh
doesn't seem to actually test anything.
Generally speaking you can't. This is one of the problematic things
about the current test framework. The best you can do for something
like sh where you really don't want to install a broken one is probably
installing in a jail and running tests there.
For library tests, though, you can run the individual test just like kyua
would, but all bets are off if it relies on anything other than the code in
the binary (and associated shared libraries). Even then, it's a royal
pain.

I usually stop one step short of a jail when I've needed to do this:
I just make installworld DESTDIR=$HOME/mumble and then do
sudo chroot $HOME/mumble. Though it doesn't work at all well
for some tests (they hate being run in a chroot), but they tend to
be networking tests anyway... But the same tests that don't work
well in a chroot work even less well in a jail. There's a crazy lot
of them that require different /dev/ entries, which is why I don't do
the chroot thing that often...

tl;dr: It's easier not to test, and that's actually a problem.

Warner
Enji Cooper
2024-05-15 00:18:39 UTC
Permalink
Post by Brooks Davis
Post by Christian Weisgerber
How can I run the regression tests on my work-in-progress without
installing it first?
Say I'm changing something in sh. Can I run the tests on the
compiled sh in /usr/obj, without having to install my potentially
broken work into the system? Running "make tests" in src/bin/sh
doesn't seem to actually test anything.
Generally speaking you can't. This is one of the problematic things
about the current test framework. The best you can do for something
like sh where you really don't want to install a broken one is probably
installing in a jail and running tests there.
Try “make check MK_MAKE_CHECK_USE_SANDBOX=yes -DNO_ROOT” It’s not perfect, but it might do what you want without breaking your system.
Cheers,
-Enji

Loading...