From patchwork Mon Jul 29 15:27:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 815036 Delivered-To: patch@linaro.org Received: by 2002:adf:b359:0:b0:367:895a:4699 with SMTP id k25csp1319116wrd; Mon, 29 Jul 2024 08:28:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUN77jeLKPEdBJLjF1Gg2Rnndi4SVPNXfSICRn8uGsFzD0im4aKQdi6UgrgTkLFMfUZtfAd/LtyiYaTxQq0Sfnp X-Google-Smtp-Source: AGHT+IHsu+E8Jn86o+7S9Okhrdt5JLFKVUBuwI3xUFJuw1Z1u/pjSKlZ6ou4MuvVWvxHm47O1RQl X-Received: by 2002:a05:6830:3707:b0:703:7821:d9e with SMTP id 46e09a7af769-70940c98bbemr10843662a34.30.1722266885594; Mon, 29 Jul 2024 08:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722266885; cv=none; d=google.com; s=arc-20160816; b=kqH3fkl9AEsGtfiIBQAWf9llVhvZlvuC152HTHvL8c7ka2uHqTnFz/J0Us3bBCf9hO zICFK5+KzmW5dfE+37yM68RBim8Ae6l5ErjO54sWGhYF/J5LJlzYqmIAAoShZAXWFmlB L+jaYBsRqogyjBCBEslzB29TdlykGTo2co9VUv/o7anjurd5gfwS7HzE35zjaD/1FhZl rKTl8qZxYEc6NMTw1whiyRa0Eb3sTIcbQdIHR6cp2JvJnHY4/zFqytsI5vS1yobASkAi abY5b9nRK80GTNLKd2wQcAR3PoTGfkn20QkhYEbPvfBnVkXEUR6cYWMOB4/YGXkx2LL5 +2uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8PomybOz3qZzuYIDD9gWq6wUwpi3wx9FNYbcCkKRftw=; fh=IBGKi66tyuZv6j+HlwNNom5hnQJyXZYPNb735jZBZjY=; b=h2qhat7A+NIeRzzfYBjxJvc11bjrFdN1oXnKGiKc/Zat0XVTXPih2tgDWk82Ax4RUW uMoo2fL6w0lrKDh/1NgG9fNP5phKFUDlAriKd7Zx8Q+JjrffbaseAP9826wrKCemkF1V d2wB06zTTx15c/nF6MQPwIktGMVjqM9UEYGOlh5/Qvvan1h0dYJrI1FcRBpw8msvJ+4y SqM1YihkJLJMjFUdngvkZwwgtGnvdy+Rg2eJIMaXKtoIQL+9Lp/llo/wC8P0BTYefUKB wQfZgkf0laoK5z39MlW+wA3skPSGLzjHUbrZi68amPpthmGjsLFCL+12aRSuvEarIS1T S0dQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLBRy+BC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a1d73998c1si1094358285a.53.2024.07.29.08.28.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jul 2024 08:28:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLBRy+BC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYSI2-0002XB-Vi; Mon, 29 Jul 2024 11:27:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYSI0-0002IH-Px for qemu-devel@nongnu.org; Mon, 29 Jul 2024 11:27:57 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYSHy-0008HY-UD for qemu-devel@nongnu.org; Mon, 29 Jul 2024 11:27:56 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-427ffae0b91so23137385e9.0 for ; Mon, 29 Jul 2024 08:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722266873; x=1722871673; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8PomybOz3qZzuYIDD9gWq6wUwpi3wx9FNYbcCkKRftw=; b=PLBRy+BCNiPaoGgO+Ue5aK/0LmvHunBVaaGrtNIXiv6hQ3/+m5czFc3y+ogjFohYTB EQdUT03eC4WN3gpzGt4Mln883y905rRRRM4Chs7ppgwfWuBqGcNtGLnNbv6ONSccM1MU Jvzti6mf8Tr3Z1DNzpqYC1FOJ8aYNcXgCfboIY8NRFSJBxl0AQSgdWoKaV4JvGlQAhdG g2HyAT52UUNkNrNCXqQ08TWtAodYxNaTxjYuc09dKfI2MLedc5QJWG1taiIsfBX6De42 kY806aVbTZV7jlkXjGb49j+eZfXJFOEBpU+SfF3obVPYM+rRIZUwgWKXgop0lllpkx/5 0H9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722266873; x=1722871673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8PomybOz3qZzuYIDD9gWq6wUwpi3wx9FNYbcCkKRftw=; b=qI0BgLzJ3WQP5zsgPW1Eq3J5vuom8yYFnxIC8ArXVZiKg/IC+UTlZ99+Nwp8+WQA1/ tkTSlj3TsD2ebC8Zq0WEr6yewR47G7EGUbw0lt5Geu4mSdGbwNawc55ClsfDIFOd0V53 Bw+uTBnbZuUmlbZi8QBC9/Hkr3O3cQK6fcUojB2marb0NTrLnuGq9gr22trp2U0sLL90 dzMd6Qo2BvY1V23eX9jEUA5x8t6cbq7zVdpgGCYqYdMtcuWrgEOoXBDb9GxdDt5daOco 9dLpo3JKPp0CkzcpZtL4c15xlBJNxaVtta4cr2JNo8x6/85Bxe17UmJBCeL3GxCNnPGj YWFw== X-Gm-Message-State: AOJu0YyJKjv9LSOEVgUX9F15GKTq/yIA4x0VggPxMvYCbTL6gnXGOnLu hZ40prONQBOhvdyaMqbTRars6LKujyRbs3WbYtzgpQvDF65U+60tvIe4L6d3LB25sxAmP51kovn r X-Received: by 2002:a05:600c:a08:b0:426:62c5:4731 with SMTP id 5b1f17b1804b1-42811dd43c9mr61447485e9.29.1722266873315; Mon, 29 Jul 2024 08:27:53 -0700 (PDT) Received: from localhost.localdomain ([176.176.173.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4281807f701sm68443285e9.22.2024.07.29.08.27.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Jul 2024 08:27:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Fabiano Rosas , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PULL 06/14] tests/functional: Prepare the meson build system for the functional tests Date: Mon, 29 Jul 2024 17:27:06 +0200 Message-ID: <20240729152714.10225-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729152714.10225-1-philmd@linaro.org> References: <20240729152714.10225-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth Provide a meson.build file for the upcoming python-based functional tests, and add some wrapper glue targets to the tests/Makefile.include file. We are going to use two "speed" modes for the functional tests: The "quick" tests can be run at any time (i.e. also during "make check"), while the "thorough" tests should only be run when running a "make check-functional" test run (since these tests might download additional assets from the internet). The changes to the meson.build files are partly based on an earlier patch by Ani Sinha. Signed-off-by: Thomas Huth Reviewed-by: Fabiano Rosas Reviewed-by: Daniel P. Berrangé Tested-by: Philippe Mathieu-Daudé Message-ID: <20240724175248.1389201-5-thuth@redhat.com> [PMD: Removed call to check-func target in check-functional rule] Signed-off-by: Philippe Mathieu-Daudé --- tests/Makefile.include | 11 ++++++ tests/functional/meson.build | 66 ++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 3 files changed, 78 insertions(+) create mode 100644 tests/functional/meson.build diff --git a/tests/Makefile.include b/tests/Makefile.include index 167d8f29a4..9077d5c6f0 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -9,6 +9,8 @@ check-help: @echo "Individual test suites:" @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target" @echo " $(MAKE) check-qtest Run qtest tests" + @echo " $(MAKE) check-functional Run python-based functional tests" + @echo " $(MAKE) check-functional-TARGET Run functional tests for a given target" @echo " $(MAKE) check-unit Run qobject tests" @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" @echo " $(MAKE) check-block Run block tests" @@ -152,6 +154,15 @@ check-acceptance-deprecated-warning: check-acceptance: check-acceptance-deprecated-warning | check-avocado +FUNCTIONAL_TARGETS=$(patsubst %-softmmu,check-functional-%, $(filter %-softmmu,$(TARGETS))) +.PHONY: $(FUNCTIONAL_TARGETS) +$(FUNCTIONAL_TARGETS): + @$(MAKE) SPEED=thorough $(subst -functional,-func,$@) + +.PHONY: check-functional +check-functional: + @$(MAKE) SPEED=thorough check-func-quick + # Consolidated targets .PHONY: check check-clean get-vm-images diff --git a/tests/functional/meson.build b/tests/functional/meson.build new file mode 100644 index 0000000000..7fc9c4e513 --- /dev/null +++ b/tests/functional/meson.build @@ -0,0 +1,66 @@ +# QEMU functional tests: +# Tests that are put in the 'quick' category are run by default during +# 'make check'. Everything that should not be run during 'make check' +# (e.g. tests that fetch assets from the internet) should be put into +# the 'thorough' category instead. + +# Most tests run too slow with TCI enabled, so skip the functional tests there +if get_option('tcg_interpreter') + subdir_done() +endif + +# Timeouts for individual tests that can be slow e.g. with debugging enabled +test_timeouts = { +} + +tests_generic = [ +] + +tests_x86_64_quick = [ +] + +tests_x86_64_thorough = [ +] + +foreach speed : ['quick', 'thorough'] + foreach dir : target_dirs + if not dir.endswith('-softmmu') + continue + endif + + target_base = dir.split('-')[0] + test_emulator = emulators['qemu-system-' + target_base] + + if speed == 'quick' + suites = ['func-quick', 'func-' + target_base] + target_tests = get_variable('tests_' + target_base + '_quick', []) + tests_generic + else + suites = ['func-' + speed, 'func-' + target_base + '-' + speed, speed] + target_tests = get_variable('tests_' + target_base + '_' + speed, []) + endif + + test_deps = roms + test_env = environment() + if have_tools + test_env.set('QEMU_TEST_QEMU_IMG', meson.global_build_root() / 'qemu-img') + test_deps += [qemu_img] + endif + test_env.set('QEMU_TEST_QEMU_BINARY', + meson.global_build_root() / 'qemu-system-' + target_base) + test_env.set('QEMU_BUILD_ROOT', meson.project_build_root()) + test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' + + meson.current_source_dir()) + + foreach test : target_tests + test('func-@0@/@1@'.format(target_base, test), + python, + depends: [test_deps, test_emulator, emulator_modules], + env: test_env, + args: [meson.current_source_dir() / 'test_' + test + '.py'], + protocol: 'tap', + timeout: test_timeouts.get(test, 60), + priority: test_timeouts.get(test, 60), + suite: suites) + endforeach + endforeach +endforeach diff --git a/tests/meson.build b/tests/meson.build index acb6807094..3345ad2098 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -85,3 +85,4 @@ subdir('unit') subdir('qapi-schema') subdir('qtest') subdir('migration') +subdir('functional')