Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp75445lqb; Tue, 4 Jun 2024 05:43:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgY0AUwL4lIkFUeeu0YsGflOMfmk8y/rBZmzp3wDcTHrZbGKLxWMu3Co4mIp1OUN+GBbDkngnrb/35NPYMDSPo1SHmPIOYu1t5HhuxJQ== X-Google-Smtp-Source: AGHT+IEhly4amwr6iJkR4pnh+eXf+ctZewL66VrLHz0990qHPvdSrOPT1orTEkKd3EkufwwrG3yL X-Received: by 2002:a05:6358:722:b0:194:82b4:4235 with SMTP id e5c5f4694b2df-19b48c23f53mr1701398255d.9.1717505012974; Tue, 04 Jun 2024 05:43:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717505012; cv=pass; d=google.com; s=arc-20160816; b=zY8N+mzGuTlsh3UAzrNIg8tdYBGJOE8QAg+WMwwGNi2JA8iWH59VgFW1wCAORr3xw4 /7jI7zqWBGsprraDATMaCZ7VAMnj8NxMHBp46r3oKeSjpKLhhV/bGRixYp/Ua+14bpOn jG9uwDDzUtZaXRZ6pB06cUUrJdiz6rMKBsdbNLfXnv+U0efYVtEZ8WXZ9UxLdhm5be07 uc52OHBRVylnWhQJ6Fg/JC167pUZdMCo+nk2LERx6hpymho1XR14MoysrdBPCDKAoT7m OszMZhh3iVQd6TnDz7tb1P2mDnqr2AJxhy8GdrARQx6BRnKLa0mlKw0Avu4nU802QPid Mikw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=8sMeT1jEzulHyaa1CBMKL3RJvYNB57BjMb6V3pNuGo0=; fh=FFJ7KaDy3uhvj0oqdLrLgwz1XQQ6OZcQlEi4lYEka/8=; b=dnnD35Q7HF+EB1DMYHEGPwvBhv3WaMBGa5C91Jtb8TJONo9DH3mu0UiFzXyfqtvmYb zuGB7NX+t8ujN1146BCso3NRb+V0PMgMenC+mKqwGKQuvurlqIS9d2TbCc8/Oyf52iJk WHe4FarN02yy7mDdo0Ff5oSuHnzCh7HKeOa2zE7nzN/S2xvBcHd+RhMI7cswg0DyWJl9 QPlolFjDPh2o9lIbjMt38f+nej5RHX43KIwlFxPcJizLgcWMFURbtfzVFPUfZUE9Vp19 hrVznOUxSCTLvB7EPIQfZ+gcrG92P2uMCzklIZxNCU6XsfcbeftZulABHRYv05dJkDVJ pGHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KorNNrwt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200606-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540f8475si1527957a12.52.2024.06.04.05.43.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200606-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KorNNrwt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200606-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1D56BB2468F for ; Tue, 4 Jun 2024 12:34:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84AAD1474CC; Tue, 4 Jun 2024 12:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KorNNrwt" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 0432C146D4D; Tue, 4 Jun 2024 12:32:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717504373; cv=none; b=sEilIh24SMWeOxORzk4C3XpI07xfnfhlX7aR/dQOmyjEhImk9u85Qhyz7MhTl1nFRNCETf5/8bkDaYYjei/h1W7WYNbRn15GIJZhi1aKMr8SACKXfdS2cVQZB+4R4KDKMYhzjaiRr5t68nSek6MMYJu1XFzz5kjyr/E+5jmsheg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717504373; c=relaxed/simple; bh=s5QTEl8avTLCywD+yMrBHIhLbHpxN43v91JE2hPsTQ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MIbUzf3wdt0Vdis2MioDOGOkgn+yw8nNV5qgq+4KYwfN98H7+Nlh758MZH7rvUbzxLj83B1hXZyToZzb9I6mN9EKzP8NFL+vpHv/jimOia6GMmqg/s6U63dWaqVb5ei9vgfZK7zJENrixkaj59qhjuAvq91U2pms32tcbCyrvQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KorNNrwt; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-52b9a7fb034so177510e87.1; Tue, 04 Jun 2024 05:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717504370; x=1718109170; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8sMeT1jEzulHyaa1CBMKL3RJvYNB57BjMb6V3pNuGo0=; b=KorNNrwtaYwleKlF7EArYCPxAm5z9V33Fiy/j9cp/2RYKFhfuJz2sVFsodsmOdFXPB KBC89Sw73smFNeEXdNnGCn/44xZLvJKT/vSCKX7hdgFP7Yc6A5NccXl5yr7/tuGmTAPs FNQ9M2DP/9Iuus6eHGWlJ/hCYKwYPSVjG9nh5vdXWRAGHwwm1sgJecjOsb3AHCdX23cD j4ZPlZ0O3KGSRbl8ayx0/UVqi38nTrdKl5NZXh62MzCZkyLQosEXpn+wSiZMo8qSOlzw 6h3U6tpZPbEhsuMleX0ktP/oHEU0b9RUdHq3X0U0vhthpELO7K1K3iYFddeqftzvq/1K Rv7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717504370; x=1718109170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8sMeT1jEzulHyaa1CBMKL3RJvYNB57BjMb6V3pNuGo0=; b=WHy8Nns2st8UN6Jnt1bfPVS9jYtHBhwLb6f4wEuaFruYvZE1mtVR5B5XihB+jmltrx a0+q4zb2GNCyyoaKaeUa460GnXsIBl0r09M0HNjwQvuvlzw23OG3ZN+j3kxNsSSJb/Wl ok+Omm3x2qLmcuTiejHsUaNDtcf5olMC1A6fMGv6mcgFM7e+3x6xadCq67yc1SC8m4Xy geW2vxflPQRGuPjXPwGnXflLTREL7PZW50Nf9z1vUFpx1Dk/rDIQlshX2qp1fKevJCio U55WtYY0gk8Fw6Z/O5VZaExULQ7hveuNy2tyGyIDTPZVeZnliXyPYzPiW2UfG306r1gt jigg== X-Forwarded-Encrypted: i=1; AJvYcCWtZmeNwgZMlUYRHKp7wTVyww1ZZP8Ax8A1yP2ZNU02YrynvKBLXxKUk1pw6OdAaJmbGRR8Bik4gn2lPY16VG99rF+Hq5zv+QCsIKahCuEZ9xPrSFUi5vnJpVHxnExqr/vGfD1c+Rc3TDMGUZ+/ X-Gm-Message-State: AOJu0Yz5D24PF1Lgnd0hKkRLn3OyHtp/YyIDf6g2ITxZCYFgBDgqH9mb 45VptoWk4xCjHuJn42g7YttP9xg1AOdL8Ve7I28Z26Fupqhp/xdF X-Received: by 2002:a05:6512:3b25:b0:52b:8909:58b1 with SMTP id 2adb3069b0e04-52b89702d1emr10752838e87.3.1717504369804; Tue, 04 Jun 2024 05:32:49 -0700 (PDT) Received: from ivan-HLYL-WXX9.guest.codethink.co.uk ([167.98.27.226]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35e535567e9sm7209179f8f.21.2024.06.04.05.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 05:32:49 -0700 (PDT) From: Ivan Orlov To: brendan.higgins@linux.dev, davidgow@google.com, rmoar@google.com Cc: Ivan Orlov , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] kunit: kunit-test: Remove stub for log tests Date: Tue, 4 Jun 2024 13:32:01 +0100 Message-Id: <20240604123204.10412-3-ivan.orlov0322@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604123204.10412-1-ivan.orlov0322@gmail.com> References: <20240604123204.10412-1-ivan.orlov0322@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since now we are exporting string-stream functions into the KUnit namespace, we can safely use them in kunit-test when it is compiled as a module as well. So, remove the stubs used when kunit-test is compiled as a module. Import the KUnit namespace in the test. Signed-off-by: Ivan Orlov --- lib/kunit/kunit-test.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c index e3412e0ca399..42178d5a97d1 100644 --- a/lib/kunit/kunit-test.c +++ b/lib/kunit/kunit-test.c @@ -577,12 +577,6 @@ static struct kunit_suite kunit_resource_test_suite = { .test_cases = kunit_resource_test_cases, }; -/* - * Log tests call string_stream functions, which aren't exported. So only - * build this code if this test is built-in. - */ -#if IS_BUILTIN(CONFIG_KUNIT_TEST) - /* This avoids a cast warning if kfree() is passed direct to kunit_add_action(). */ KUNIT_DEFINE_ACTION_WRAPPER(kfree_wrapper, kfree, const void *); @@ -637,17 +631,6 @@ static void kunit_log_newline_test(struct kunit *test) kunit_skip(test, "only useful when debugfs is enabled"); } } -#else -static void kunit_log_test(struct kunit *test) -{ - kunit_skip(test, "Log tests only run when built-in"); -} - -static void kunit_log_newline_test(struct kunit *test) -{ - kunit_skip(test, "Log tests only run when built-in"); -} -#endif /* IS_BUILTIN(CONFIG_KUNIT_TEST) */ static struct kunit_case kunit_log_test_cases[] = { KUNIT_CASE(kunit_log_test), @@ -871,4 +854,5 @@ kunit_test_suites(&kunit_try_catch_test_suite, &kunit_resource_test_suite, &kunit_current_test_suite, &kunit_device_test_suite, &kunit_fault_test_suite); +MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING); MODULE_LICENSE("GPL v2"); -- 2.34.1