Discussion:
Running tests for a single program in src/bin, src/usr.bin, etc
(too old to reply)
h***@tuta.io
2024-03-05 00:55:24 UTC
Permalink
Hi everyone,

Not sure if this is the best list for this. Maybe hackers@ would be better?

I wanted to tinker with utilities in /usr/src/bin and /usrsrc/usr.bin. I noticed that rmdir exits 1 for usage, which is a pet peeve of mine. I updated it to exit 2 and then wanted to alter the tests to ensure it's exiting 2.

At this point, I'm unsure of how to run tests for this single component. Is there a way I can be in /usr/src/bin/rmdir and just run a succesful `make test` (or equivalent) without some combination of `make install` + kyua out of /usr/tests? Seems like for self-contained tests, simple testing should be possible.

I did find `make check`, but I'm having issues with checkdir sticking around.

Thank you!

-Henrich


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Alan Somers
2024-03-05 14:06:06 UTC
Permalink
Post by h***@tuta.io
Hi everyone,
I wanted to tinker with utilities in /usr/src/bin and /usrsrc/usr.bin. I noticed that rmdir exits 1 for usage, which is a pet peeve of mine. I updated it to exit 2 and then wanted to alter the tests to ensure it's exiting 2.
At this point, I'm unsure of how to run tests for this single component. Is there a way I can be in /usr/src/bin/rmdir and just run a succesful `make test` (or equivalent) without some combination of `make install` + kyua out of /usr/tests? Seems like for self-contained tests, simple testing should be possible.
I did find `make check`, but I'm having issues with checkdir sticking around.
Thank you!
-Henrich
If you don't like the fact that checkdir disappears, then you'll have
to do "make install". But you don't need to run Kyua on the entire
test suite. You can do it just on a subdir, like this:

sudo kyua test --kyuafile /usr/tests/bin/rmdir/Kyuafile


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
h***@tuta.io
2024-03-13 22:40:42 UTC
Permalink
Hi Alan,

That worked. Thank you!

I do still think it would be nice to be able to run tests in isolation, like `make test`. It seems like ideally you could test the individual binary without installing it to the system, in case there are issues.

-Henrich
Post by Alan Somers
Post by h***@tuta.io
Hi everyone,
I wanted to tinker with utilities in /usr/src/bin and /usrsrc/usr.bin. I noticed that rmdir exits 1 for usage, which is a pet peeve of mine. I updated it to exit 2 and then wanted to alter the tests to ensure it's exiting 2.
At this point, I'm unsure of how to run tests for this single component. Is there a way I can be in /usr/src/bin/rmdir and just run a succesful `make test` (or equivalent) without some combination of `make install` + kyua out of /usr/tests? Seems like for self-contained tests, simple testing should be possible.
I did find `make check`, but I'm having issues with checkdir sticking around.
Thank you!
-Henrich
If you don't like the fact that checkdir disappears, then you'll have
to do "make install". But you don't need to run Kyua on the entire
sudo kyua test --kyuafile /usr/tests/bin/rmdir/Kyuafile
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Alan Somers
2024-03-13 23:09:14 UTC
Permalink
You aren't the first person to request that. And such a feature would
work well for most programs. But there are many exceptions. For
example, some programs' tests need to read a file stored in a
different program's test directory. For such reasons you're required
to install the tests before running them.
-Alan
Post by h***@tuta.io
Hi Alan,
That worked. Thank you!
I do still think it would be nice to be able to run tests in isolation, like `make test`. It seems like ideally you could test the individual binary without installing it to the system, in case there are issues.
-Henrich
Post by Alan Somers
Post by h***@tuta.io
Hi everyone,
I wanted to tinker with utilities in /usr/src/bin and /usrsrc/usr.bin. I noticed that rmdir exits 1 for usage, which is a pet peeve of mine. I updated it to exit 2 and then wanted to alter the tests to ensure it's exiting 2.
At this point, I'm unsure of how to run tests for this single component. Is there a way I can be in /usr/src/bin/rmdir and just run a succesful `make test` (or equivalent) without some combination of `make install` + kyua out of /usr/tests? Seems like for self-contained tests, simple testing should be possible.
I did find `make check`, but I'm having issues with checkdir sticking around.
Thank you!
-Henrich
If you don't like the fact that checkdir disappears, then you'll have
to do "make install". But you don't need to run Kyua on the entire
sudo kyua test --kyuafile /usr/tests/bin/rmdir/Kyuafile
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...