mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00

Add a new command line option to allow selecting between running the full set of tests or a smaller set of tests. The default will be to run the small set (i.e. no comand line option provided) so we can reduce the amount of tests run by default. Only hosts which support KVM for the target architecture being tested will run the complete set of tests. Adjust the meson.build file to pass in the --full option when appropriate. (for now, set the option unconditionally until the next patch actually creates the small set) Use cases: configure --target-list=aarch64-softmmu,ppc64-softmmu,s390x-softmmu,x86_64-softmmu | before - 615s/244 tests | after - 244s/100 tests ------------------------+--------------------------+----------------------------- make check | full set for all archs | full set for the KVM arch, make check-qtest | | small set for the rest | | qemu-system-$ARCH | full set for $ARCH | small set for $ARCH, KVM or ./migration-test | | TCG automatically chosen | | qemu-system-$ARCH | N/A | full set for $ARCH, KVM or ./migration-test --full | | TCG automatically chosen | | migration-compat-x86_64 | full set for x86_64 | small set for x86_64 CI job | | ------------------------+--------------------------+----------------------------- Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Message-Id: <20250130184012.5711-2-farosas@suse.de> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20250207153112.3939799-9-alex.bennee@linaro.org>
67 lines
1.5 KiB
C
67 lines
1.5 KiB
C
/*
|
|
* QTest testcase for migration
|
|
*
|
|
* Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates
|
|
* based on the vhost-user-test.c that is:
|
|
* Copyright (c) 2014 Virtual Open Systems Sarl.
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "migration/framework.h"
|
|
#include "qemu/module.h"
|
|
|
|
static void parse_args(int *argc_p, char ***argv_p, bool *full_set)
|
|
{
|
|
int argc = *argc_p;
|
|
char **argv = *argv_p;
|
|
int i, j;
|
|
|
|
j = 1;
|
|
for (i = 1; i < argc; i++) {
|
|
if (g_str_equal(argv[i], "--full")) {
|
|
*full_set = true;
|
|
continue;
|
|
}
|
|
argv[j++] = argv[i];
|
|
if (i >= j) {
|
|
argv[i] = NULL;
|
|
}
|
|
}
|
|
*argc_p = j;
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
MigrationTestEnv *env;
|
|
int ret;
|
|
bool full_set = false;
|
|
|
|
/* strip the --full option if it's present */
|
|
parse_args(&argc, &argv, &full_set);
|
|
|
|
g_test_init(&argc, &argv, NULL);
|
|
env = migration_get_env();
|
|
env->full_set = full_set;
|
|
env->full_set = true; /* temporary */
|
|
module_call_init(MODULE_INIT_QOM);
|
|
|
|
migration_test_add_tls(env);
|
|
migration_test_add_compression(env);
|
|
migration_test_add_postcopy(env);
|
|
migration_test_add_file(env);
|
|
migration_test_add_precopy(env);
|
|
migration_test_add_cpr(env);
|
|
migration_test_add_misc(env);
|
|
|
|
ret = g_test_run();
|
|
|
|
g_assert_cmpint(ret, ==, 0);
|
|
|
|
ret = migration_env_clean(env);
|
|
|
|
return ret;
|
|
}
|