Commit 0b267183 authored by Avi Kivity's avatar Avi Kivity
Browse files

vmexit: add support for running a selected set of tests



  qemu -device testdev,chardev=log -chardev stdio,id=log \
       -kernel vmexit.flat -append 'test1 test2 test3'

will run test1, test2, and test3, and skip all others.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 69da6c87
......@@ -148,7 +148,21 @@ static void enable_nx(void *junk)
wrmsr(MSR_EFER, rdmsr(MSR_EFER) | EFER_NX_MASK);
}
int main(void)
bool test_wanted(struct test *test, char *wanted[], int nwanted)
{
int i;
if (!nwanted)
return true;
for (i = 0; i < nwanted; ++i)
if (strcmp(wanted[i], test->name) == 0)
return true;
return false;
}
int main(int ac, char **av)
{
int i;
......@@ -158,7 +172,8 @@ int main(void)
on_cpu(i-1, enable_nx, 0);
for (i = 0; i < ARRAY_SIZE(tests); ++i)
do_test(&tests[i]);
if (test_wanted(&tests[i], av + 1, ac - 1))
do_test(&tests[i]);
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment