summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 09:53:51 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 09:53:51 +0100
commit4585b0bbceb3ff73fcf2fbee554000b135297c19 (patch)
tree115579ce3ec3e84a3a02a0f4c107724e242a4bf4 /src
parent72caee07a5f4f2d7e34c954dba500ffbdbc27207 (diff)
downloadlibguestfs-4585b0bbceb3ff73fcf2fbee554000b135297c19.tar.gz
libguestfs-4585b0bbceb3ff73fcf2fbee554000b135297c19.tar.xz
libguestfs-4585b0bbceb3ff73fcf2fbee554000b135297c19.zip
Implement TEST_ONLY environment variable to run selected tests only.
To run just selected tests, do: TEST_ONLY="hexdump mkfs" make -C capitests check
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/generator.ml b/src/generator.ml
index 7905c367..cd2f2a1e 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -4160,6 +4160,9 @@ static int %s_skip (void)
{
const char *str;
+ str = getenv (\"TEST_ONLY\");
+ if (str)
+ return strstr (str, \"%s\") == NULL;
str = getenv (\"SKIP_%s\");
if (str && strcmp (str, \"1\") == 0) return 1;
str = getenv (\"SKIP_TEST_%s\");
@@ -4167,7 +4170,7 @@ static int %s_skip (void)
return 0;
}
-" test_name (String.uppercase test_name) (String.uppercase name);
+" test_name name (String.uppercase test_name) (String.uppercase name);
(match prereq with
| Disabled | Always -> ()
@@ -4183,7 +4186,7 @@ static int %s_skip (void)
static int %s (void)
{
if (%s_skip ()) {
- printf (\"%%s skipped (reason: SKIP_TEST_* variable set)\\n\", \"%s\");
+ printf (\"%%s skipped (reason: environment variable set)\\n\", \"%s\");
return 0;
}