static virBitmapPtr testBitmap;
char *progname;
+static char *perl;
bool virTestOOMActive(void)
{
char *script = NULL;
virCommandPtr cmd = NULL;
+ if (!perl) {
+ fprintf(stderr, "cannot rewrap %s: unable to find perl in path", filename);
+ return -1;
+ }
+
if (virAsprintf(&script, "%s/test-wrap-argv.pl", abs_srcdir) < 0)
goto cleanup;
- cmd = virCommandNewArgList(script, "--in-place", filename, NULL);
+ cmd = virCommandNewArgList(perl, script, "--in-place", filename, NULL);
if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
}
#endif /* TEST_OOM */
+ /* Find perl early because some tests override PATH */
+ perl = virFindFileInPath("perl");
+
ret = (func)();
virResetLastError();
fprintf(stderr, "%*s", 40 - (int)(testCounter % 40), "");
fprintf(stderr, " %-3zu %s\n", testCounter, ret == 0 ? "OK" : "FAIL");
}
+ VIR_FREE(perl);
return ret;
}