From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202508 header.b=bn0YTnvG; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 872C35A0271 for ; Wed, 03 Sep 2025 02:54:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1756860861; bh=yl3JXKQCvSHKdPS0H0BbEiPduqeqZB6gqM1ljtxEcrs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bn0YTnvG6Jl1YYl8hC6bYwUGOPPonGN4+VQNL/+NHf8rxDQftEhLhwu+rwvPKMFSI t8exmig2zt9T2W+yy8oO1xlVCMTtBcum7vyy1VNYHucoOSRuuF/yQt23JBSkJ4agEF 0aXKpv8Q70K54ZKiylLcE7I5Xrfe3anWYDhxZysGexjTkmMLIzo5geqw6srvCY6mqf Qyr/lkeTxZ72x60k0Nct17aqVOlg3iR+09X3br08bD0G3fYyu1cQTckrbp0mk1GOmU UjF7fdOMExT3IDKxsAVI52+qjbrmQBGEhqzrbU6heJ27LLd7c7GfoFyDcTh2vYlCgt LizTkD702Rdfw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cGkdn0D0pz4w9g; Wed, 3 Sep 2025 10:54:21 +1000 (AEST) Date: Wed, 3 Sep 2025 10:54:12 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v6 3/4] test: Convert build tests to exeter Message-ID: References: <20250901042515.138861-1-david@gibson.dropbear.id.au> <20250901042515.138861-4-david@gibson.dropbear.id.au> <20250902093953.734411c7@elisabeth> <20250902142323.28cf5c6d@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="O8+OTsavgg1a36GF" Content-Disposition: inline In-Reply-To: <20250902142323.28cf5c6d@elisabeth> Message-ID-Hash: W6OKI3XTB7RR2MHTUHVXCJ5LUJSZEJRI X-Message-ID-Hash: W6OKI3XTB7RR2MHTUHVXCJ5LUJSZEJRI X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --O8+OTsavgg1a36GF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 02, 2025 at 02:23:23PM +0200, Stefano Brivio wrote: > On Tue, 2 Sep 2025 20:41:41 +1000 > David Gibson wrote: >=20 > > On Tue, Sep 02, 2025 at 09:39:53AM +0200, Stefano Brivio wrote: > > > On Mon, 1 Sep 2025 14:25:14 +1000 > > > David Gibson wrote: > > > =20 > > > > +def test_make(target: str, expected_files: list[str]) -> None: > > > > + """Test `make {target}` > > > > + > > > > + Arguments: > > > > + target -- make target to invoke > > > > + expected_files -- files make is expected to create > > > > + > > > > + Verifies that > > > > + 1) `make target` completes successfully > > > > + 2) expected_files care created by `make target` > > > > + 3) expected_files are removed by `make clean` > > > > + """ > > > > + > > > > + ex_paths =3D [Path(f) for f in expected_files] > > > > + with clone_sources(): > > > > + for p in ex_paths: > > > > + assert not p.exists(), f"{p} existed before make" > > > > + sh(f'make {target} CFLAGS=3D"-Werror"') > > > > + for p in ex_paths: > > > > + assert p.exists(), f"{p} wasn't made" > > > > + sh('make clean') > > > > + for p in ex_paths: > > > > + assert not p.exists(), f"{p} existed after make clean" > > > > + > > > > + > > > > +exeter.register('make_passt', test_make, 'passt', ['passt']) > > > > +exeter.register('make_pasta', test_make, 'pasta', ['pasta']) > > > > +exeter.register('make_qrap', test_make, 'qrap', ['qrap']) > > > > +exeter.register('make_all', test_make, 'all', ['passt', 'pasta', '= qrap']) =20 > > >=20 > > > I guess I'm missing something, but how do you set descriptions from > > > Python? =20 > >=20 > > There are two ways: > > 1) > >=20 > > foo =3D exeter.register(...) > > foo.set_description("test that does the thing") > >=20 > > 2) > >=20 > > By default exeter will take it from the first line of the test > > function's docstring. >=20 > Ah, this is really convenient. I mean I saw it happening but I wasn't > sure why. :) To be a little more specific here, exeter.register will introspect the docstring and put it in the description. @exeter.test calls exeter.register, so it does the same thing. If you register with parameters it will expand Python-style formatting parameters in the docstring. This is useful for something like: def test_n(n : int): """Test the thing {n} times""" ... for i in range(3): exeter.register(f'test_{i}', test_n, i) You can always overwrite the default description afterwards with set_description. register_pipe() won't set a description automatically, but you can still set one explicitly afterwards. The Scenario stuff... I haven't checked, it's probably needs some work. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --O8+OTsavgg1a36GF Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmi3kaEACgkQzQJF27ox 2GdKLg/8CzS7T1BSUqUaZJOCCPgW4YWd7zAyjOnQxv9u0gwjlElMAyTxWLXjAIlU iv+ozmPYWqKUudmUIvYRVHVOFGqobBKkG6ahQUhYhaGq08ML3Do+aqWl/UWWyk62 ONotE2ks58m/SwpAIvU0sVQmfKgisUnWsvk4oqcGxjTRyCc8qHyLu+pFbf11qYWx MNO05D4tuoiJUZlWSI4zwqYV2jWcILqaVTj6/jhleW5SgW04Em+MW1iD03Yj5ti7 10xV7Sty/QNQKk5V6JvZJcflycW59bkiL3yAyv7wvEc8iXLY9Y740v2xK78DvPMP cldDxhXgny2RwFlUV/yoruRW5mdjtPSyR0EVAzaKQQ3Fza1f7yGbxQmNv5ipmYRA LpE8PK08u0YAty2qgtHjxScQ7gkbk1D7x5iFf4Ht5jcPQ0gZ7asoxmgR4V9koS6g ys3ZDCzcr5XjdF0mMKqSPlGu1T1ooSqnZw3q48wYv960GBvf6Uj/LlIXjKDU7cpI rhul6P90X5ZUE7cZYgIUWVYK9dFeIP5WbeV7Shblw4c3x9v7/QSdQjDnQE5vhDS3 atJw/iupsvTZ+wWimauwlUc9O525Kewd0Z8yCyVJ6diPTT2SSTUec43Z8EEeLeVh OJnfYAK2C6D/ejZX7dWDlcAGJ+AJWu8D/zEVW/ixgKtD+1YxYKg= =CtBu -----END PGP SIGNATURE----- --O8+OTsavgg1a36GF--