From nobody Fri May 17 10:44:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696345126; cv=none; d=zohomail.com; s=zohoarc; b=ZqBgcRpv0gpw5MYmMsM1SNk/3QXxI6gRfxASvJ9OG5XAuu4EReYXhNCRVqhOlHjwbNOl8+X+HjSBtniV4R1BT0qqteXnZBnQRt0FhS/mUlcfNr7F06qPMnavLs99RWA3u/EOD34HFnWIj2wXmxgplLZ3/TfWB5DtXlODJ1ANMmc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696345126; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SPuWYm+5GsSdPW0ZM1QJtVoxgAFAm2aJVnVtLxNgz8o=; b=mXjWh35oW9pS3Hzb0/Ayn21Cwe1TiZWltaTAcUxMvulYHgznFj05dMeoO6dD9qxxyUg4kU1S4ZMdEK72SwQH+30RfJSNd1E8HozLs3cqngegZ4Vt4EyVHdkAiCn0mzGVS3rUfBxo0uTeYQuDobBP4gqzJ2Xzgrf9GVjwCjBYdgA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1696345126185657.1553853873631; Tue, 3 Oct 2023 07:58:46 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-434-rHEP11rzOWemWj-e0wZvug-1; Tue, 03 Oct 2023 10:58:39 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF5F42802520; Tue, 3 Oct 2023 14:58:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B617F140273C; Tue, 3 Oct 2023 14:58:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A956D194735A; Tue, 3 Oct 2023 14:57:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 074B31946597 for ; Tue, 3 Oct 2023 14:56:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DD14E40103D; Tue, 3 Oct 2023 14:56:41 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5283C4A9B0C for ; Tue, 3 Oct 2023 14:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696345125; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SPuWYm+5GsSdPW0ZM1QJtVoxgAFAm2aJVnVtLxNgz8o=; b=gbeAcQbjzS0qVzu0BbLn/OCidrZJr+xqS7j59ZA5w1awYbZjnlYHqS80P7wsbtYZMeka6c 6URatSQh1hgYCcPI5SpopruUM+JXEvIElzdE+L7GhMFqz8EhfPsiPiv2lAPZvswdZLRv5G 5c5h4ccEb64XZWosBo6idZYnACk2nO0= X-MC-Unique: rHEP11rzOWemWj-e0wZvug-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 1/6] meson: Do less when not building from git Date: Tue, 3 Oct 2023 16:56:32 +0200 Message-ID: <20231003145637.379487-2-abologna@redhat.com> In-Reply-To: <20231003145637.379487-1-abologna@redhat.com> References: <20231003145637.379487-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696345126804100001 Content-Type: text/plain; charset="utf-8"; x-default="true" As explained in the comment, the syntax-check machinery uses git to figure out the list of files it should operate on, so we can only enable it when building from git. Despite only registering the various tests with meson in that case, however, we unconditionally perform a bunch of preparation that is only useful for the purpose of registering and running the tests. If we're not going to do that, we can skip a few steps and save a bit of time. Best viewed with 'git show -w'. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/meson.build | 99 +++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/build-aux/meson.build b/build-aux/meson.build index 16d085505d..b5d88a4c44 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -1,63 +1,62 @@ -flake8_path =3D '' -if flake8_prog.found() - flake8_path =3D flake8_prog.full_path() -endif +# Skip syntax-check if not building from git because we get the list of fi= les +# to check using git commands and it fails if we are not in git repository. +if git + flake8_path =3D '' + if flake8_prog.found() + flake8_path =3D flake8_prog.full_path() + endif =20 -if host_machine.system() =3D=3D 'freebsd' or host_machine.system() =3D=3D = 'darwin' - make_prog =3D find_program('gmake') - sed_prog =3D find_program('gsed') -else - make_prog =3D find_program('make') - sed_prog =3D find_program('sed') -endif + if host_machine.system() =3D=3D 'freebsd' or host_machine.system() =3D= =3D 'darwin' + make_prog =3D find_program('gmake') + sed_prog =3D find_program('gsed') + else + make_prog =3D find_program('make') + sed_prog =3D find_program('sed') + endif =20 -if host_machine.system() =3D=3D 'freebsd' - grep_prog =3D find_program('grep') - grep_cmd =3D run_command(grep_prog, '--version', check: true) - if grep_cmd.stdout().startswith('grep (BSD grep') - grep_prog =3D find_program('/usr/local/bin/grep', required: false) - if not grep_prog.found() - error('GNU grep not found') + if host_machine.system() =3D=3D 'freebsd' + grep_prog =3D find_program('grep') + grep_cmd =3D run_command(grep_prog, '--version', check: true) + if grep_cmd.stdout().startswith('grep (BSD grep') + grep_prog =3D find_program('/usr/local/bin/grep', required: false) + if not grep_prog.found() + error('GNU grep not found') + endif endif + elif host_machine.system() =3D=3D 'darwin' + grep_prog =3D find_program('ggrep') + else + grep_prog =3D find_program('grep') endif -elif host_machine.system() =3D=3D 'darwin' - grep_prog =3D find_program('ggrep') -else - grep_prog =3D find_program('grep') -endif - -awk_prog =3D find_program('awk') =20 -syntax_check_conf =3D configuration_data({ - 'top_srcdir': meson.project_source_root(), - 'top_builddir': meson.project_build_root(), - 'flake8_path': flake8_path, - 'runutf8': ' '.join(runutf8), - 'PYTHON3': python3_prog.full_path(), - 'GREP': grep_prog.full_path(), - 'SED': sed_prog.full_path(), - 'AWK': awk_prog.full_path(), -}) + awk_prog =3D find_program('awk') =20 -configure_file( - input: 'Makefile.in', - output: '@BASENAME@', - configuration: syntax_check_conf, -) + syntax_check_conf =3D configuration_data({ + 'top_srcdir': meson.project_source_root(), + 'top_builddir': meson.project_build_root(), + 'flake8_path': flake8_path, + 'runutf8': ' '.join(runutf8), + 'PYTHON3': python3_prog.full_path(), + 'GREP': grep_prog.full_path(), + 'SED': sed_prog.full_path(), + 'AWK': awk_prog.full_path(), + }) =20 -rc =3D run_command( - 'sed', '-n', - 's/^sc_\\([a-zA-Z0-9_-]*\\):.*/\\1/p', - meson.current_source_dir() / 'syntax-check.mk', - check: true, -) + configure_file( + input: 'Makefile.in', + output: '@BASENAME@', + configuration: syntax_check_conf, + ) =20 -sc_tests =3D rc.stdout().strip().split() + rc =3D run_command( + 'sed', '-n', + 's/^sc_\\([a-zA-Z0-9_-]*\\):.*/\\1/p', + meson.current_source_dir() / 'syntax-check.mk', + check: true, + ) =20 + sc_tests =3D rc.stdout().strip().split() =20 -# Skip syntax-check if not building from git because we get the list of fi= les -# to check using git commands and it fails if we are not in git repository. -if git foreach target : sc_tests test( target, --=20 2.41.0 From nobody Fri May 17 10:44:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696345034; cv=none; d=zohomail.com; s=zohoarc; b=iYOUkaaAAMx2svnSQIqQ9l1TT1KPBsZir9S/kCVXIZ7bfhsVKfLe2S0dg7P4bMiFlZrZx5tOG32lehB01DWND+Q7ABKHdq4t1FaeeKKV+AIrCz/SggDlz/ImRyg68PcQQK3ngRH3+tGWWFryQ7er2p1LiAbjNWjUkfT5ibUtqGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696345034; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bX7QRswzdfY2O1iqVw14FDb8EjqxLuLS4bkSPrf62Nw=; b=YHyb7oUYwR+lnzsDTT1xQAd6eSDhjYYNnIQlqjk+/Ms0HGWwvdzJSFez9N+lOusC83GuJ431JQhJsD+ZtgD0fuup1yGWIq/N9ZFy5lbifnfLO1nojE9TJsMGEm2JiJfNMEwo/VQB9t0WDDCbAkvF4y5Q2rDk+LkO5Y/ywfy8VTs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1696345034848790.4484334045416; Tue, 3 Oct 2023 07:57:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-364-z9KLPToEPJe8qI1bX9R41Q-1; Tue, 03 Oct 2023 10:57:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D0C943C1E9D1; Tue, 3 Oct 2023 14:57:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD27040C2013; Tue, 3 Oct 2023 14:57:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8016019465BC; Tue, 3 Oct 2023 14:56:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AAF14194658F for ; Tue, 3 Oct 2023 14:56:42 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 943A6493113; Tue, 3 Oct 2023 14:56:42 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AE6840103E for ; Tue, 3 Oct 2023 14:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696345033; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=bX7QRswzdfY2O1iqVw14FDb8EjqxLuLS4bkSPrf62Nw=; b=YSodsQWPoRzVYZ+9V8pyVfXzdDDdz2X0I80N9q3H4CL97hO9ucbSwEoWT+4cQaYYRdmOEO vWUQ9OWprrUopFQDdzZBi6maLLBRhgV4Md2ZEk0m7xRqwA6wplYPxjN/Yt8hLPjQ4rPBdI KmLKn62dpb7iMd1Rvj9Plz6sk3KaecY= X-MC-Unique: z9KLPToEPJe8qI1bX9R41Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/6] meson: Move all handling of test options together Date: Tue, 3 Oct 2023 16:56:33 +0200 Message-ID: <20231003145637.379487-3-abologna@redhat.com> In-Reply-To: <20231003145637.379487-1-abologna@redhat.com> References: <20231003145637.379487-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696345036806100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This will make future patches nicer. Note that we need to handle these somewhat late because of the dependency on information about the compiler and the flags it supports. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- meson.build | 57 +++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/meson.build b/meson.build index 6fa1f74670..ef0b5641de 100644 --- a/meson.build +++ b/meson.build @@ -151,23 +151,6 @@ if packager_version !=3D '' endif =20 =20 -# test options - -if get_option('expensive_tests').auto() - use_expensive_tests =3D not git -else - use_expensive_tests =3D get_option('expensive_tests').enabled() -endif - -coverage_flags =3D [] -if get_option('test_coverage') - coverage_flags =3D [ - '-fprofile-arcs', - '-ftest-coverage', - ] -endif - - # Add RPATH information when building for a non-standard prefix, or # when explicitly requested to do so =20 @@ -2028,6 +2011,35 @@ if conf.has('WITH_DECL_SYS_PIDFD_OPEN') conf.set('WITH_NBDKIT', 1) endif =20 + +# test options + +build_tests =3D [ not get_option('tests').disabled() ] +if build_tests[0] and \ + cc.get_id() =3D=3D 'clang' and \ + not supported_cc_flags.contains('-fsemantic-interposition') \ + and get_option('optimization') !=3D '0' + # If CLang doesn't support -fsemantic-interposition then our + # mocking doesn't work. The best we can do is to not run the + # test suite. + build_tests =3D [ false, '!!! Forcibly disabling tests because CLang la= cks -fsemantic-interposition. Update CLang or disable optimization !!!' ] +endif + +if get_option('expensive_tests').auto() + use_expensive_tests =3D not git +else + use_expensive_tests =3D get_option('expensive_tests').enabled() +endif + +coverage_flags =3D [] +if get_option('test_coverage') + coverage_flags =3D [ + '-fprofile-arcs', + '-ftest-coverage', + ] +endif + + # Various definitions =20 # Python3 < 3.7 treats the C locale as 7-bit only. We must force env vars = so @@ -2051,17 +2063,6 @@ subdir('src') =20 subdir('tools') =20 -build_tests =3D [ not get_option('tests').disabled() ] -if build_tests[0] and \ - cc.get_id() =3D=3D 'clang' and \ - not supported_cc_flags.contains('-fsemantic-interposition') \ - and get_option('optimization') !=3D '0' - # If CLang doesn't support -fsemantic-interposition then our - # mocking doesn't work. The best we can do is to not run the - # test suite. - build_tests =3D [ false, '!!! Forcibly disabling tests because CLang la= cks -fsemantic-interposition. Update CLang or disable optimization !!!' ] -endif - if build_tests[0] subdir('tests') endif --=20 2.41.0 From nobody Fri May 17 10:44:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696345078; cv=none; d=zohomail.com; s=zohoarc; b=WLS8RshUgMGkHQOvvFpQA6R86xt9e77ccToBIcALFGhWhyTXGoRS/GYL89ZIIW6iztED6FFq01ux9qD4Px+g31Lb5lZs9b/6GdGYFAz8wprPiCcOE/W6Cvh3Y6yi9rdgqbdlyL0IDtG3e3RcV+1u3ZRSQBPBBEu722e5flPzxEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696345078; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PwM47nqgpPfLYzmuu8q/EIyFazlh+ib1+S/jUMXcAJk=; b=CyGgae3/FrFD42tvKmtXiKXionjYWI6NR5Z6KwzvIOMAWrpb43/hG4Obetb4ZoGx8yWhvxbgmUeA/59OXXRoge9n63Hp773C9Xt/R4IbW+jRuLBSaWgRZNTsbERQb/UHcs9vsb1CChA906wTdXfiRTciDBkRZpxeolJEfL44tq4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 169634507834629.17031227274208; Tue, 3 Oct 2023 07:57:58 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-k48c-0gwPAaczm_PJ44i_Q-1; Tue, 03 Oct 2023 10:57:53 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23CD4895430; Tue, 3 Oct 2023 14:57:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F5EB40C6EC1; Tue, 3 Oct 2023 14:57:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 52F121946A6F; Tue, 3 Oct 2023 14:56:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8839E19466EB for ; Tue, 3 Oct 2023 14:56:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4BA584A9B0C; Tue, 3 Oct 2023 14:56:44 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6319493113 for ; Tue, 3 Oct 2023 14:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696345077; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PwM47nqgpPfLYzmuu8q/EIyFazlh+ib1+S/jUMXcAJk=; b=EQtfou6HwbbIim3OElsZ2cskce9VzYlpqr2qFLoc6EChFMHCQuLmkZjDAb64lVKF9KNZ5m rzFT5xMm8B+uVPA3Tdh7eLmr3hghCZ1NK7CGT7B8kgS4c3JGZXHo+VamzfgrM7e+/G+lPV +8pK4jsqjPgygfIwYceWERd13cCMb5Q= X-MC-Unique: k48c-0gwPAaczm_PJ44i_Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 3/6] meson: Handle -Dtests=enabled with Clang Date: Tue, 3 Oct 2023 16:56:34 +0200 Message-ID: <20231003145637.379487-4-abologna@redhat.com> In-Reply-To: <20231003145637.379487-1-abologna@redhat.com> References: <20231003145637.379487-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696345078944100001 Content-Type: text/plain; charset="utf-8"; x-default="true" There are some cases in which we automatically disable tests when using Clang as the compiler. If the user has explicitly asked for tests to be enabled, however, we should error out instead of silently disabling things. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ef0b5641de..ed9a07942d 100644 --- a/meson.build +++ b/meson.build @@ -2022,7 +2022,11 @@ if build_tests[0] and \ # If CLang doesn't support -fsemantic-interposition then our # mocking doesn't work. The best we can do is to not run the # test suite. - build_tests =3D [ false, '!!! Forcibly disabling tests because CLang la= cks -fsemantic-interposition. Update CLang or disable optimization !!!' ] + msg =3D 'Forcibly disabling tests because CLang lacks -fsemantic-interp= osition. Update CLang or disable optimization' + if get_option('tests').enabled() + error(msg) + endif + build_tests =3D [ false, '!!! @0@ !!!'.format(msg) ] endif =20 if get_option('expensive_tests').auto() --=20 2.41.0 From nobody Fri May 17 10:44:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696345050; cv=none; d=zohomail.com; s=zohoarc; b=lAuvDknYwxbdMFEK/Dr1kqhOq67JDq4Igb02i9tOZTl9eSjs2dGBq9WVV0zgTL7xpxz0q4WgYP9j0nzt9c8kOPoAXU3pa+et4dHR2lxSzmGJTbWKXeRGJkrKJlSEqru+ELLFmJbLqW9oyP4SwLPFJaNXUf6BDXN2xIPOEkhoZJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696345050; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cpORGOjL0kn/sO44H0jYW9Pd1lt+1CdxNy2iVLTnC/M=; b=doeH+ZmGB7zVqD3jinTfBet3dlNN+iP9UNXRhEJkGkuVWoyDpyTncO8L3qb8aOrdvGCnGC15xUlsRFZ6JOFRPrePXW6PrCD6P8r6REcyUpJcpymXwCDc9ksM/0clhDR2L2NsDiZ83bjyLuuznGRKMSmH0LpgGiLKiZpSJ5Arudc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1696345050807191.47360222757857; Tue, 3 Oct 2023 07:57:30 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-BWn3shG-PF6-atin0qLvXQ-1; Tue, 03 Oct 2023 10:57:27 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 54AD9858285; Tue, 3 Oct 2023 14:57:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F2FB140273C; Tue, 3 Oct 2023 14:57:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BA19919466FD; Tue, 3 Oct 2023 14:56:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 143C6194658F for ; Tue, 3 Oct 2023 14:56:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 01D05493113; Tue, 3 Oct 2023 14:56:46 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D16940103E for ; Tue, 3 Oct 2023 14:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696345049; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cpORGOjL0kn/sO44H0jYW9Pd1lt+1CdxNy2iVLTnC/M=; b=EbHH+K1gWsZKpJpD+D8lULmsTkUr93S1MA4J6XHRoAHAjI/J+UuUFN6DWTK8eEGneJ1Lwk 30TEZ7WodNfWXNZICc2LO0wz7Md2M9WMK3vXRn5GwWPYcQF+Wnc91RyvOZRrx3wqatPKOl YBzsozwJu0vNKloHuuBTMGJhPHhcUqw= X-MC-Unique: BWn3shG-PF6-atin0qLvXQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 4/6] meson: Make -Dexpensive_tests depend on -Dtests Date: Tue, 3 Oct 2023 16:56:35 +0200 Message-ID: <20231003145637.379487-5-abologna@redhat.com> In-Reply-To: <20231003145637.379487-1-abologna@redhat.com> References: <20231003145637.379487-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696345053022100001 Content-Type: text/plain; charset="utf-8"; x-default="true" It only makes sense to enable expensive tests when tests are enabled. Disallow invalid configurations. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ed9a07942d..7ec2a6fd1e 100644 --- a/meson.build +++ b/meson.build @@ -2030,9 +2030,12 @@ if build_tests[0] and \ endif =20 if get_option('expensive_tests').auto() - use_expensive_tests =3D not git + use_expensive_tests =3D not git and build_tests[0] else use_expensive_tests =3D get_option('expensive_tests').enabled() + if use_expensive_tests and not build_tests[0] + error('cannot enable expensive tests when tests are disabled') + endif endif =20 coverage_flags =3D [] --=20 2.41.0 From nobody Fri May 17 10:44:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696345081; cv=none; d=zohomail.com; s=zohoarc; b=SkcmYfpx3bp6Y5Rfgfg3j1iZ43Kx+704KqEdYlFoQLyEf+0+fHI2jWLJZi1+4meVNWrs79X3+XpnKj+s1qJFYJQRZnzqXVEs2ltNEb+w79p2nWxpyyCmYbvp6itpNjqXoz5WK6F7aeBHGpfl4sOoSBCukjHsR0cDRUbawskdOZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696345081; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wQr706vqdFihGpngRU96vGBbPS+JeHH1QX438GdNsQY=; b=ZTd74hQipEVm1nlxsaaGoBZ0iF0CpIpSrnXvzp1U3uGjgLLP/Gs/n7KmpkVfkDU/PQkVEKiTgcgsK8enydRcTcG6PcBK9EdX+X9hCRLS+cCZ9MrD61ljLaDNByEk9eggdPls5gym0LRRNrYxayfhYGSIO2Jj0aPeedGULHYSdJQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1696345081182563.1173563319796; Tue, 3 Oct 2023 07:58:01 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-444-IsNzjz5_MPO0oTqh-rG_mA-1; Tue, 03 Oct 2023 10:57:56 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D7BE21035A00; Tue, 3 Oct 2023 14:57:44 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7778D2026D4B; Tue, 3 Oct 2023 14:57:44 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F384619459E5; Tue, 3 Oct 2023 14:56:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BE14D19466FF for ; Tue, 3 Oct 2023 14:56:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id ADB5540103C; Tue, 3 Oct 2023 14:56:49 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 442F9493113 for ; Tue, 3 Oct 2023 14:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696345080; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wQr706vqdFihGpngRU96vGBbPS+JeHH1QX438GdNsQY=; b=fWGwkfaG3XCTZiTYT1Od09MqNaMvXGDT4+h3GVjZN9ylDcea1VKpU4/0rswTQyoFDtGOGH LVPjAUK/k5d1+UHyzOVRnoeNPNfxxEQPNITNe2JYP2G58bm/nXpDuMUT7iNKJwh8Cuj/BT 5ST2eR7qdIcotH5s+49lDeTCfdI2Xv0= X-MC-Unique: IsNzjz5_MPO0oTqh-rG_mA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 5/6] meson: Disable all tests when tests are disabled Date: Tue, 3 Oct 2023 16:56:36 +0200 Message-ID: <20231003145637.379487-6-abologna@redhat.com> In-Reply-To: <20231003145637.379487-1-abologna@redhat.com> References: <20231003145637.379487-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696345083032100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Currently, passing -Dtests=3Ddisabled only disables a subset of tests: those that are written in C and thus require compilation. Other tests, such as the syntax-check ones and those that are implemented as scripts, are always enabled. There's a potentially dangerous consequence of this behavior: when tests are disabled, 'meson test' will succeed as if they had been enabled. No indication of this will be shown, so the user will likely make the reasonable assumption that everything is fine when in fact the significantly reduced coverage might be hiding failures. To solve this issues, disable *all* tests when asked to do so, and inject an intentionally failing test to ensure that 'meson test' doesn't succeed. Best viewed with 'git show -w'. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/meson.build | 2 +- meson.build | 7 ++ src/access/meson.build | 16 ++-- src/meson.build | 204 +++++++++++++++++++++-------------------- 4 files changed, 120 insertions(+), 109 deletions(-) diff --git a/build-aux/meson.build b/build-aux/meson.build index b5d88a4c44..84405c5ec8 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -1,6 +1,6 @@ # Skip syntax-check if not building from git because we get the list of fi= les # to check using git commands and it fails if we are not in git repository. -if git +if git and build_tests[0] flake8_path =3D '' if flake8_prog.found() flake8_path =3D flake8_prog.full_path() diff --git a/meson.build b/meson.build index 7ec2a6fd1e..5a1a81d087 100644 --- a/meson.build +++ b/meson.build @@ -2072,6 +2072,13 @@ subdir('tools') =20 if build_tests[0] subdir('tests') +else + # Ensure that 'meson test' fails when tests are disabled, as opposed to + # misleadingly succeeding at doing absolutely nothing + test( + 'tests-are-disabled', + python3_prog, args: [ '-c', 'raise Exception("tests are disabled")' ], + ) endif =20 subdir('examples') diff --git a/src/access/meson.build b/src/access/meson.build index e65f17c0a2..6ca953c932 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -105,10 +105,12 @@ access_dep =3D declare_dependency( =20 generated_sym_files +=3D access_gen_sym =20 -test( - 'check-aclperms', - python3_prog, - args: [ check_aclperms_prog.full_path(), access_perm_h, files('viraccess= perm.c') ], - env: runutf8, - suite: 'script' -) +if build_tests[0] + test( + 'check-aclperms', + python3_prog, + args: [ check_aclperms_prog.full_path(), access_perm_h, files('viracce= ssperm.c') ], + env: runutf8, + suite: 'script' + ) +endif diff --git a/src/meson.build b/src/meson.build index 144f24e526..0c64cef04e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -942,121 +942,123 @@ meson.add_install_script( =20 # Check driver files =20 -if host_machine.system() =3D=3D 'linux' - test( - 'check-symfile', - python3_prog, - args: [ check_symfile_prog.full_path(), libvirt_syms, libvirt_lib ], - env: runutf8, - suite: 'script' - ) - - if conf.has('WITH_REMOTE') +if build_tests[0] + if host_machine.system() =3D=3D 'linux' test( - 'check-admin-symfile', + 'check-symfile', python3_prog, - args: [ check_symfile_prog.full_path(), libvirt_admin_syms, libvirt_= admin_lib ], + args: [ check_symfile_prog.full_path(), libvirt_syms, libvirt_lib ], env: runutf8, suite: 'script' ) + + if conf.has('WITH_REMOTE') + test( + 'check-admin-symfile', + python3_prog, + args: [ check_symfile_prog.full_path(), libvirt_admin_syms, libvir= t_admin_lib ], + env: runutf8, + suite: 'script' + ) + endif endif -endif =20 -test( - 'check-symsorting', - python3_prog, - args: [ - check_symsorting_prog.full_path(), - meson.current_source_dir(), - files(sym_files, used_sym_files), - ], - env: runutf8, - suite: 'script' -) + test( + 'check-symsorting', + python3_prog, + args: [ + check_symsorting_prog.full_path(), + meson.current_source_dir(), + files(sym_files, used_sym_files), + ], + env: runutf8, + suite: 'script' + ) =20 -test( - 'check-admin-symsorting', - python3_prog, - args: [ - check_symsorting_prog.full_path(), - meson.current_source_dir(), - libvirt_admin_private_syms, - ], - env: runutf8, - suite: 'script' -) + test( + 'check-admin-symsorting', + python3_prog, + args: [ + check_symsorting_prog.full_path(), + meson.current_source_dir(), + libvirt_admin_private_syms, + ], + env: runutf8, + suite: 'script' + ) =20 -test( - 'check-drivername', - python3_prog, - args: [ - check_drivername_prog.full_path(), files(driver_headers), - files('libvirt_public.syms'), libvirt_qemu_syms, libvirt_lxc_syms, - ], - env: runutf8, - suite: 'script' -) + test( + 'check-drivername', + python3_prog, + args: [ + check_drivername_prog.full_path(), files(driver_headers), + files('libvirt_public.syms'), libvirt_qemu_syms, libvirt_lxc_syms, + ], + env: runutf8, + suite: 'script' + ) =20 -test( - 'check-admin-drivername', - python3_prog, - args: [ - check_drivername_prog.full_path(), libvirt_admin_public_syms, - ], - env: runutf8, - suite: 'script' -) + test( + 'check-admin-drivername', + python3_prog, + args: [ + check_drivername_prog.full_path(), libvirt_admin_public_syms, + ], + env: runutf8, + suite: 'script' + ) =20 -test( - 'check-driverimpls', - python3_prog, - args: [ check_driverimpls_prog.full_path(), driver_source_files ], - env: runutf8, - suite: 'script' -) + test( + 'check-driverimpls', + python3_prog, + args: [ check_driverimpls_prog.full_path(), driver_source_files ], + env: runutf8, + suite: 'script' + ) =20 -test( - 'check-aclrules', - python3_prog, - args: [ check_aclrules_prog.full_path(), files('remote/remote_protocol.x= '), stateful_driver_source_files ], - env: runutf8, - suite: 'script' -) + test( + 'check-aclrules', + python3_prog, + args: [ check_aclrules_prog.full_path(), files('remote/remote_protocol= .x'), stateful_driver_source_files ], + env: runutf8, + suite: 'script' + ) =20 -if augparse_prog.found() - foreach data : augeas_test_data - test( - 'check-augeas-@0@'.format(data['name']), - augparse_prog, - args: [ - '-I', data['srcdir'], - '-I', data['builddir'], - data['file'].full_path(), - ], - suite: 'script' - ) - endforeach -endif + if augparse_prog.found() + foreach data : augeas_test_data + test( + 'check-augeas-@0@'.format(data['name']), + augparse_prog, + args: [ + '-I', data['srcdir'], + '-I', data['builddir'], + data['file'].full_path(), + ], + suite: 'script' + ) + endforeach + endif =20 -if pdwtags_prog.found() and cc.get_id() !=3D 'clang' - foreach proto : check_protocols - lib =3D proto['lib'] - test( - 'check-@0@'.format(proto['name']), - python3_prog, - args: [ - check_remote_protocol_prog.full_path(), - proto['name'], - lib.name(), - lib.full_path(), - pdwtags_prog.full_path(), - files('@0@-structs'.format(proto['name'])), - ], - env: runutf8, - depends: [ lib ], - suite: 'script' - ) - endforeach + if pdwtags_prog.found() and cc.get_id() !=3D 'clang' + foreach proto : check_protocols + lib =3D proto['lib'] + test( + 'check-@0@'.format(proto['name']), + python3_prog, + args: [ + check_remote_protocol_prog.full_path(), + proto['name'], + lib.name(), + lib.full_path(), + pdwtags_prog.full_path(), + files('@0@-structs'.format(proto['name'])), + ], + env: runutf8, + depends: [ lib ], + suite: 'script' + ) + endforeach + endif endif =20 # configure pkg-config files for run script --=20 2.41.0 From nobody Fri May 17 10:44:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696345084; cv=none; d=zohomail.com; s=zohoarc; b=gK7LaZ1U8RDRwlamyR1PXel4VOl6NCPJMQ6HQ+9qtvT4NMn8qd6nM1LNbSodWJuGCjop0H6kDgYW3APblsMtXJ8himORP3b7yzW0EoSSL2/FYkuNhZYDOQBEkvKf1Bd/eRSKXMHhBpr6fbMXpeGbc5Get92MHw4kUU6hwZBdtRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696345084; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4AUZqvMehzWR9NabISDfvuEXsX27vp/S89euUxn9IgY=; b=Fnzq5O+zGdZg59KdkfKIpLROVb+DrPteNVDB9SH1VVQKp/FcUmJccPecjnhOMnYWynrEtMGNAzJRHb86OpMp81lnxMXIpf5lZAnCBxjHiQ9CDp81xDsEvuwEmw9aeO4T3lIrj2LaI7BApiWO4qBAmTpcZay14zNXZ/YhDdWKuzI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1696345084953766.0209889837532; Tue, 3 Oct 2023 07:58:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-650-byLJS9zwOfKAesRagnOB0Q-1; Tue, 03 Oct 2023 10:57:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 83FC3280FED2; Tue, 3 Oct 2023 14:57:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D5B540C2013; Tue, 3 Oct 2023 14:57:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3A95519465A2; Tue, 3 Oct 2023 14:56:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 683D51946A77 for ; Tue, 3 Oct 2023 14:56:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 63DDF40103C; Tue, 3 Oct 2023 14:56:50 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF730493113 for ; Tue, 3 Oct 2023 14:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696345084; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4AUZqvMehzWR9NabISDfvuEXsX27vp/S89euUxn9IgY=; b=FtGYSpt7l1TVaG+sngZunJYlXe1s2znWK1WhWcMu5EgjiJBvn3R/Hs7sMSDqLdyC1HwbNo pAulYZg6qGnoGCys/vzKiZcSXElimc3Yn/Zjmok11dYKzRpt5foUge4+ubaYOmfIbzJR3T U5axv1zDr5rPJBef5MPhh1X1ygP+aaA= X-MC-Unique: byLJS9zwOfKAesRagnOB0Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 6/6] meson: Rename build_tests -> tests_enabled Date: Tue, 3 Oct 2023 16:56:37 +0200 Message-ID: <20231003145637.379487-7-abologna@redhat.com> In-Reply-To: <20231003145637.379487-1-abologna@redhat.com> References: <20231003145637.379487-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696345086709100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Given that this variable now controls not just whether C tests are built, but also whether any test at all is executed, the new name is more appropriate. Update the description for the corresponding meson option accordingly. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/meson.build | 2 +- meson.build | 14 +++++++------- meson_options.txt | 2 +- src/access/meson.build | 2 +- src/meson.build | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build-aux/meson.build b/build-aux/meson.build index 84405c5ec8..f96d46c445 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -1,6 +1,6 @@ # Skip syntax-check if not building from git because we get the list of fi= les # to check using git commands and it fails if we are not in git repository. -if git and build_tests[0] +if git and tests_enabled[0] flake8_path =3D '' if flake8_prog.found() flake8_path =3D flake8_prog.full_path() diff --git a/meson.build b/meson.build index 5a1a81d087..397315a77d 100644 --- a/meson.build +++ b/meson.build @@ -2014,8 +2014,8 @@ endif =20 # test options =20 -build_tests =3D [ not get_option('tests').disabled() ] -if build_tests[0] and \ +tests_enabled =3D [ not get_option('tests').disabled() ] +if tests_enabled[0] and \ cc.get_id() =3D=3D 'clang' and \ not supported_cc_flags.contains('-fsemantic-interposition') \ and get_option('optimization') !=3D '0' @@ -2026,14 +2026,14 @@ if build_tests[0] and \ if get_option('tests').enabled() error(msg) endif - build_tests =3D [ false, '!!! @0@ !!!'.format(msg) ] + tests_enabled =3D [ false, '!!! @0@ !!!'.format(msg) ] endif =20 if get_option('expensive_tests').auto() - use_expensive_tests =3D not git and build_tests[0] + use_expensive_tests =3D not git and tests_enabled[0] else use_expensive_tests =3D get_option('expensive_tests').enabled() - if use_expensive_tests and not build_tests[0] + if use_expensive_tests and not tests_enabled[0] error('cannot enable expensive tests when tests are disabled') endif endif @@ -2070,7 +2070,7 @@ subdir('src') =20 subdir('tools') =20 -if build_tests[0] +if tests_enabled[0] subdir('tests') else # Ensure that 'meson test' fails when tests are disabled, as opposed to @@ -2294,7 +2294,7 @@ endif misc_summary =3D { 'Warning Flags': supported_cc_flags, 'docs': gen_docs, - 'tests': build_tests, + 'tests': tests_enabled, 'DTrace': conf.has('WITH_DTRACE_PROBES'), 'firewalld': conf.has('WITH_FIREWALLD'), 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), diff --git a/meson_options.txt b/meson_options.txt index ba6e49afc5..16812f7ade 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,7 +10,7 @@ option('git_werror', type: 'feature', value: 'auto', desc= ription: 'use -Werror i option('rpath', type: 'feature', value: 'auto', description: 'whether to i= nclude rpath information in installed binaries and libraries') option('docdir', type: 'string', value: '', description: 'documentation in= stallation directory') option('docs', type: 'feature', value: 'auto', description: 'whether to ge= nerate documentation') -option('tests', type: 'feature', value: 'auto', description: 'whether to b= uild tests') +option('tests', type: 'feature', value: 'auto', description: 'whether to b= uild and run tests') =20 =20 # build dependencies options diff --git a/src/access/meson.build b/src/access/meson.build index 6ca953c932..fc5ba5b342 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -105,7 +105,7 @@ access_dep =3D declare_dependency( =20 generated_sym_files +=3D access_gen_sym =20 -if build_tests[0] +if tests_enabled[0] test( 'check-aclperms', python3_prog, diff --git a/src/meson.build b/src/meson.build index 0c64cef04e..14686065bf 100644 --- a/src/meson.build +++ b/src/meson.build @@ -942,7 +942,7 @@ meson.add_install_script( =20 # Check driver files =20 -if build_tests[0] +if tests_enabled[0] if host_machine.system() =3D=3D 'linux' test( 'check-symfile', --=20 2.41.0