From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 580A645A12; Mon, 23 Sep 2024 21:26:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDD2B402B4; Mon, 23 Sep 2024 21:26:15 +0200 (CEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id BD49D4027C for ; Mon, 23 Sep 2024 21:26:13 +0200 (CEST) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2d8a744aa9bso3202178a91.3 for ; Mon, 23 Sep 2024 12:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1727119573; x=1727724373; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VFw1pdL/ziaQFXge/T0nJthXg9Ata0sKQQZpxhYW2yk=; b=Jkg0mYuz3CZq/+bVJkNWKxWznEClWmGffFeIU4r8yLmTNKYBEMsIxlP7UUuFm5Ohmz b96GEiYgq/5XQxhBJ/yzY1ZktkjC2uZv1H9RuFvuMT4gCFAvO+Zp1P9JE08SjeF+JvYE IwebdTvAOadtWgijOdAbBO9eQRs/yugkcfqbQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727119573; x=1727724373; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VFw1pdL/ziaQFXge/T0nJthXg9Ata0sKQQZpxhYW2yk=; b=Gl8iyDSa9J07qXYDJZDt3uxpgiIPwVcGQDDKArZkIWk4VFKFQ0MHtygJsnlgolJAWG zGTwuNWhK2kKUdxfVGuiKpxrxGh1Z/QG/tI1YQjci5HsrObLwI/dV9EeL/7nPbcU4w94 SySbLiU0wm/FKiBp2aI72D7lh7VsmQ5Kk/JZGcmRlhZAf1PGz4nrejuiTL21Ru2iqvf+ sqch0N1laSGlywPFlJhJOPAWJpCZ+8TxfMhIMTRcs/EtF6dLoKHBh8P/owkuipu4vEh8 ZU+jFuAw81UwlZLTyS0EK+7rmhCAUpEz1fMmlGCQ8U4VM1mkS/la4KZtTE2HrhsIP0u3 iVVQ== X-Forwarded-Encrypted: i=1; AJvYcCWrZSSCJ8+1r5fQ8/1N0J6gFAscUf9rQufHTw9teURyT3PWGEQqLSPcCQSaFwyCV3Mmq2s=@dpdk.org X-Gm-Message-State: AOJu0Yx5kV9/cgWfQmU4/jlttX5zBs8Nf+1QCcJrsfEs4aXQIxriQzMw xSRsRvy4N5kD+t2ymtoEdZedixdC/46A8hIPiMIx8j2pKd+ADMl/05+80Kg8T45uhW27JBO5PpU KYDWQzH0ok7Hs6vs3CAAD+Rsvf5FWqRfZtJvIRQ== X-Google-Smtp-Source: AGHT+IF6kR04hkTEjra81OQ5o9ELQou6MtLW1W01tqDPw2ejtyWrTbOIOWOJ5PuMlf5cCBMFcHcFcq7BVHUmK+W+zwM= X-Received: by 2002:a17:90a:be18:b0:2d8:6f66:1ebf with SMTP id 98e67ed59e1d1-2dd7f42a37emr16967356a91.20.1727119572913; Mon, 23 Sep 2024 12:26:12 -0700 (PDT) MIME-Version: 1.0 References: <20240301155416.96960-1-juraj.linkes@pantheon.tech> <20240923150210.57269-1-juraj.linkes@pantheon.tech> <20240923150210.57269-2-juraj.linkes@pantheon.tech> In-Reply-To: <20240923150210.57269-2-juraj.linkes@pantheon.tech> From: Jeremy Spewock Date: Mon, 23 Sep 2024 15:26:01 -0400 Message-ID: Subject: Re: [PATCH v4 02/11] dts: add test case decorators To: =?UTF-8?Q?Juraj_Linke=C5=A1?= Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, alex.chapman@arm.com, probb@iol.unh.edu, npratte@iol.unh.edu, dmarx@iol.unh.edu, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org One super nit-pick comment below, even without that though I still think this looks good. Reviewed-by: Jeremy Spewock On Mon, Sep 23, 2024 at 11:02=E2=80=AFAM Juraj Linke=C5=A1 wrote: > + def is_test_case(function: Callable) -> bool: > + if inspect.isfunction(function): > + # TestCase is not used at runtime, so we can't use isins= tance() with `function`. > + # But function.test_type exists. > + if hasattr(function, "test_type"): > + return isinstance(function.test_type, TestCaseType) > + return False > + > + if test_case_sublist is None: > + test_case_sublist =3D [] > + > + # the copy is needed so that the condition "elif test_case_subli= st" doesn't > + # change mid-cycle > + test_case_sublist_copy =3D list(test_case_sublist) > + func_test_cases =3D set() > + perf_test_cases =3D set() > + > + for test_case_name, test_case_function in inspect.getmembers(cls= , is_test_case): > + if test_case_name in test_case_sublist_copy: > + # if test_case_sublist_copy is non-empty, remove the fou= nd test case > + # so that we can look at the remainder at the end > + test_case_sublist_copy.remove(test_case_name) > + elif test_case_sublist: > + # the original list not being empty means we're filterin= g test cases This might read a little better if there was a period at the end, but I still think this gets the point across as is. > + # since we didn't remove test_case_name in the previous = branch, > + # it doesn't match the filter and we don't want to remov= e it > + continue > + > + match test_case_function.test_type: > + case TestCaseType.PERFORMANCE: > + perf_test_cases.add(test_case_function) > + case TestCaseType.FUNCTIONAL: > + func_test_cases.add(test_case_function) > + > 2.43.0 >