From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC8EB2EC56F for ; Thu, 21 Aug 2025 13:54:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755784496; cv=none; b=YA9DvJe3fr3hd6KvO7lRDY2N0FdmUBXLDnN46GT7vdPOpBUZC73BkmxLAEokHhclZZad/rMDdMLNJLTxhljpvHey9lJTBScx0O3Ul6Yj2QGw/m7jC0GP4k6bDxtZ2OM3ZdxfbyWGBcHPkPpM//whq/t82iDM3iTQNJ4lgmXNZuM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755784496; c=relaxed/simple; bh=FRZ/dkTH5e7JEyicr5rKwYSZwT6g3H9r7TNIOOAYgss=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=U1+fXSZWhW1LhwsLdDZauy4U7tlj7A9x4R3xMh2aWLElVKYvAlEyLcrMgI4ATeC2bQm21je7adNvvEoanvOBXfOipViq4BeT6MXgBJWos0i+4WXAPU6ZRt/c3GymoPkifTNcXhjWG8yALMfco77dmJSnpKztcg2jID7z0aID56o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--davidgow.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LO31eZ33; arc=none smtp.client-ip=209.85.215.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--davidgow.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LO31eZ33" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-b47174b2582so1738517a12.2 for ; Thu, 21 Aug 2025 06:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1755784494; x=1756389294; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=XpTFpmF3LpyMWsoi7YRVPJftCPsO+iVXO+bA6kJHgfU=; b=LO31eZ33Rx4MStqcRWDOLK/mE63EmxOKBKoNkGWRctXY1mzyW5mpdQKBsRUpNQEnMv zM1PgD/II8xYkUJYKxCq9asq7NNHiimsbwsH9vkC8cCXrIdNNPeMObMA7E731OcuHMfj fUp175K3AQzvGBAN0KcIbnbG+ls3NCfSOylHWyAQd8irgzCxCmyYYrHRErcHaSl9VPdQ 4VMjyhY6wEiHuGQFEKe7XptDCA6MisyI+Rl5pPa1nKs2MG+jCOsO2zdTuuCWhmLcDZch Ps4sOYFESuQ09hGhbRL7raRMmYh+AXUncKQ6Uww/mFFiWvZ8V1g66nuxCtZZHKKdsibT DvAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755784494; x=1756389294; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XpTFpmF3LpyMWsoi7YRVPJftCPsO+iVXO+bA6kJHgfU=; b=bD7rx3VeosJqGDqVzYPY0Rcwga4pUZ+hf02Y0FpjYSRpFegvUKU7+SEOirjfWGmq6g vsRNg3VCf1aV/LGZkfdZAKGijxpGxO/KzG4rZ2PFAIrIDT30Kuthd0wasqAMs4bh14Xh zFRXd73ovMWzu1SX9/pX36c66lmUatSlE95rC5B7hOJdv9b0YMHKhOuOvxxLU9iy7r09 AAvgVQeJwUVQJ+eLcomTjSCBSUv9dZ+icG08SecBgpTFOfsdtA0Gv8SifmclYrHI9vsO gVeLLuZFtxJvHQeW7jt4fevKRveF6sFAF288Ud5JpUcHsVY5FFxi41yLkKbHwbX3q9zI UcYQ== X-Forwarded-Encrypted: i=1; AJvYcCUfhq/6uVJ12gYAQUSQ741BWhy8Z/PCuyzEQK6+/EZSccoqug9vgcFoLTHu5aycGOrJMMLdJowNavE8@vger.kernel.org X-Gm-Message-State: AOJu0YyZxXVOCql/9Cj4jEWdCk3Zx0d9ZLZMazRhhm1PtzSTsHIOODNa GNkIZJDWyyALUynKJqjdM7FNdaLNTv/l69z5zguTPKOsn9VatJ+6M7cG/VjhokXdAkMBCKkpiF+ B57ip+cSDFYFywQ== X-Google-Smtp-Source: AGHT+IGJEX7ZclUuZ2o8JPzaPgxqgSiOjHKYAc6KuCEwQ4l/jHJHNh6xVmvyFffzu/3E1KDZ2EtRfnXg3G6H5Q== X-Received: from pfbmd16.prod.google.com ([2002:a05:6a00:7710:b0:76b:c859:e832]) (user=davidgow job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:5493:b0:23f:fd87:427c with SMTP id adf61e73a8af0-243307cb3b7mr3418114637.18.1755784494062; Thu, 21 Aug 2025 06:54:54 -0700 (PDT) Date: Thu, 21 Aug 2025 21:54:45 +0800 In-Reply-To: <20250821135447.1618942-1-davidgow@google.com> Precedence: bulk X-Mailing-List: linux-next@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250821135447.1618942-1-davidgow@google.com> X-Mailer: git-send-email 2.51.0.rc2.233.g662b1ed5c5-goog Message-ID: <20250821135447.1618942-2-davidgow@google.com> Subject: [PATCH v2 2/2] kunit: Only output a test plan if we're using kunit_array_gen_params From: David Gow To: Rae Moar , Marie Zhussupova , marievictoria875@gmail.com, Rodrigo Vivi , Shuah Khan Cc: David Gow , Stephen Rothwell , Linux Next Mailing List , intel-xe@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" In 6a2a027e254b ("kunit: Enable direct registration of parameter arrays to a KUnit test"), we now output a test plan for parameterised tests which use parameter arrays. This uses the size of the array (via the ARRAY_SIZE macro) to determine the number of subtests, which otherwise was indeterminate. However some tests (particularly xe_pci.check_platform_gt_count) use their own gen_params function which further filters the array, resulting in the test plan being inaccurate (and hence kunit.py failing). For now, only print the test plan line if the gen_params function is the provided kunit_array_gen_params. Unfortunately, this catches a lot of tests which would work, but at least makes sure we don't regress anything until we can rework how some of these macros function. Fixes: 6a2a027e254b ("kunit: Enable direct registration of parameter arrays to a KUnit test") Signed-off-by: David Gow --- No changes since v1: https://lore.kernel.org/linux-kselftest/20250819073434.1411114-2-davidgow@google.com/ (The change was in patch 1.) --- lib/kunit/test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/kunit/test.c b/lib/kunit/test.c index b661407ad0a3..bb66ea1a3eac 100644 --- a/lib/kunit/test.c +++ b/lib/kunit/test.c @@ -732,10 +732,12 @@ int kunit_run_tests(struct kunit_suite *suite) "KTAP version 1\n"); kunit_log(KERN_INFO, &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT "# Subtest: %s", test_case->name); - if (test.params_array.params) + if (test.params_array.params && + test_case->generate_params == kunit_array_gen_params) { kunit_log(KERN_INFO, &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT "1..%zd\n", test.params_array.num_params); + } while (curr_param) { struct kunit param_test = { -- 2.51.0.rc2.233.g662b1ed5c5-goog