From nobody Sun Feb 8 13:32:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1594894564; cv=none; d=zohomail.com; s=zohoarc; b=bBjrXz7YFYX9XQZWJBx03RgTfLtzNr8szPN3oaTdt8BtfCJvB1YU4EpJ5W5TbFVwamcjcFrSP5o2twlC5+EjnlXW4sTVUqr5ARzPROr3GyjDkX+TyKgWj8btEmWzsvdZE3ZW69hb1kvDu4JZI24ej1bGw/alpgjfeI4uaFHMXww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594894564; 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=2PnfVT3a5obknAphFSp9UuL9oniu8r42/k8iA6NdAqo=; b=neUQv2/GNmQQMY89bn5J49FjWFf9dBr/1oP1OxjfB+RgADD6kC45L4jA9R5/pyfWZJ7ZOadirAkGoAtOXyb+zVKuD13gOfDph/+07A18uLQdzLmd9saBtsM6JPLyRxTRlkNX/T5DqgWsReuTIbBFlFkKbm1SFJCBm6fkIYJ7wxM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1594894564539126.81295011831446; Thu, 16 Jul 2020 03:16:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-J77Q0EfTMXes-F2zV6Qmug-1; Thu, 16 Jul 2020 06:14:20 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E9BA1080; Thu, 16 Jul 2020 10:14:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5063A78483; Thu, 16 Jul 2020 10:14:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1F875181D0AE; Thu, 16 Jul 2020 10:14:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA6fm4019813 for ; Thu, 16 Jul 2020 06:06:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 817C22B6DC; Thu, 16 Jul 2020 10:06:41 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id F007D2B6DB for ; Thu, 16 Jul 2020 10:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594894563; 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=2PnfVT3a5obknAphFSp9UuL9oniu8r42/k8iA6NdAqo=; b=ifNfiGWpmOkyXBSMZj5YfNlQqk8v4chT1DJeLxC2/pPgoYaFwj310EiTprCIhXHOA5RGLK X/JdUD1YUmihMxMrLy/CquHlCbTF7XtyzTbbxGrip7/Jux/c0dp3tzmgqzAM++7QlWZmtl pdXDtoFFt2tSG5tbAHbZFGcIhb/+F4w= X-MC-Unique: J77Q0EfTMXes-F2zV6Qmug-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 280/351] meson: tests: built utils static libraries Date: Thu, 16 Jul 2020 11:58:36 +0200 Message-Id: <32dd6ea741095964aac5b17859e76d250bf89972.1594891445.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" With the old build system we just list the source files directly for each test, but this would not work as expected with Meson. For every binary there is a separate directory with its object files which would mean all the utils sources would be compiled repeatedly for every test using them. Having static libraries ensures that the utils sources are compiled only once. Signed-off-by: Pavel Hrdina --- tests/Makefile.am | 10 +-------- tests/meson.build | 53 +++++++++++++++++++++++++++++++++++++++++++++++ tests/testutils.c | 2 +- 3 files changed, 55 insertions(+), 10 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3cdeedb2308..3bc1a791a16 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -137,7 +137,7 @@ test_programs +=3D qemuxml2argvtest qemuxml2xmltest \ qemuvhostusertest \ $(NULL) test_helpers +=3D qemucapsprobe -test_libraries +=3D libqemumonitortestutils.la \ +test_libraries +=3D \ libqemutestdriver.la \ $(NULL) endif WITH_QEMU @@ -357,16 +357,8 @@ libxlxml2domconfigtest_LDADD =3D libxltestdriver.la \ $(libxl_LDADDS) $(LIBXML_LIBS) endif ! WITH_LIBXL =20 -QEMUMONITORTESTUTILS_SOURCES =3D \ - qemumonitortestutils.c \ - qemumonitortestutils.h \ - testutilsqemuschema.h testutilsqemuschema.c \ - $(NULL) - if WITH_QEMU =20 -libqemumonitortestutils_la_SOURCES =3D $(QEMUMONITORTESTUTILS_SOURCES) - qemu_LDADDS =3D ../src/libvirt_driver_qemu_impl.la if WITH_DTRACE_PROBES qemu_LDADDS +=3D ../src/libvirt_qemu_probes.lo diff --git a/tests/meson.build b/tests/meson.build index ca6e5b5f74d..5cbd3cd2077 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -117,3 +117,56 @@ foreach mock : mock_libs ], ) endforeach + + +# build libraries used by tests + +test_utils_lib =3D static_library( + 'test_utils', + [ 'testutils.c' ], + dependencies: [ tests_dep ], +) + +if conf.has('WITH_LIBXL') + test_utils_xen_lib =3D static_library( + 'test_utils_xen', + [ 'testutilsxen.c' ], + dependencies: [ tests_dep ], + ) + +else + test_utils_xen_lib =3D [] +endif + +if conf.has('WITH_LXC') + test_utils_lxc_lib =3D static_library( + 'test_utils_lxc', + [ 'testutilslxc.c' ], + dependencies: [ tests_dep ], + ) +else + test_utils_lxc_lib =3D [] +endif + +if conf.has('WITH_QEMU') + test_utils_qemu_lib =3D static_library( + 'test_utils_qemu', + [ 'testutilsqemu.c' ], + dependencies: [ tests_dep ], + ) + + test_utils_qemu_monitor_lib =3D static_library( + 'test_utils_qemu_monitor', + [ 'qemumonitortestutils.c', 'testutilsqemuschema.c' ], + dependencies: [ tests_dep ], + ) +else + test_utils_qemu_lib =3D [] + test_utils_qemu_monitor_lib =3D [] +endif + +test_file_wrapper_lib =3D static_library( + 'test_file_wrapper', + [ 'virfilewrapper.c' ], + dependencies: [ tests_dep ], +) diff --git a/tests/testutils.c b/tests/testutils.c index a1cd093e4e2..3f53f635fc2 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -340,7 +340,7 @@ virTestRewrapFile(const char *filename) =20 script =3D g_strdup_printf("%s/scripts/test-wrap-argv.py", abs_top_src= dir); =20 - cmd =3D virCommandNewArgList(PYTHON, script, "--in-place", filename, N= ULL); + cmd =3D virCommandNewArgList(PYTHON3, script, "--in-place", filename, = NULL); if (virCommandRun(cmd, NULL) < 0) return -1; =20 --=20 2.26.2