mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
tests: add helper to determine when to skip expensive tests
The logic set up in previous patch for exposing VIR_TEST_EXPENSIVE
to individual tests is as follows:
make check VIR_TEST_EXPENSIVE=0 => getenv("VIR_TEST_EXPENSIVE") sees "0"
make check VIR_TEST_EXPENSIVE=1 => getenv("VIR_TEST_EXPENSIVE") sees "1"
make check => getenv("VIR_TEST_EXPENSIVE") sees
either "0" or "1", based on configure options
cd tests; ./FOOtest => getenv("VIR_TEST_EXPENSIVE") sees
whatever is in your environment (usually NULL, but possibly garbage)
Merely checking if VIR_TEST_EXPENSIVE is set in the environment
does the wrong thing; likewise, it is unsafe to assume the
variable will always contain a valid number.
As such, it helps to have helper functions, instead of making each
expensive test repeat the probe of the environment.
* tests/testutils.h (virTestGetExpensive): New prototype.
* tests/testutils.c (virTestGetExpensive): Implement it.
* tests/test-lib.sh (very_expensive_): Rename...
(test_expensive): ...and tweak to use VIR_TEST_EXPENSIVE.
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
1 parent
70363ea9ff
commit
38d4bf49a0
3 files changed
+31
-7
No files matched your search
@@ -65,6 +65,7 @@ int virtTestDifferenceBin(FILE *stream,
|
||||
|
||||
unsigned int virTestGetDebug(void);
|
||||
unsigned int virTestGetVerbose(void);
|
||||
unsigned int virTestGetExpensive(void);
|
||||
|
||||
char *virtTestLogContentAndReset(void);
|
||||
|
||||
|
||||
Reference in new issue
Block a user