linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	 Shuah Khan <shuah@kernel.org>,
	David Hildenbrand <david@redhat.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	linux-mm@kvack.org,  linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,  Mark Brown <broonie@kernel.org>
Subject: [PATCH v2 1/4] selftests/mm: Use standard ksft_finished() in cow and gup_longterm
Date: Tue, 27 May 2025 17:04:45 +0100	[thread overview]
Message-ID: <20250527-selftests-mm-cow-dedupe-v2-1-ff198df8e38e@kernel.org> (raw)
In-Reply-To: <20250527-selftests-mm-cow-dedupe-v2-0-ff198df8e38e@kernel.org>

The cow and gup_longterm test programs open code something that looks a
lot like the standard ksft_finished() helper to summarise the test
results and provide an exit code, convert to use ksft_finished().

Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/mm/cow.c          | 7 +------
 tools/testing/selftests/mm/gup_longterm.c | 8 ++------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c
index b6cfe0a4b7df..e70cd3d900cc 100644
--- a/tools/testing/selftests/mm/cow.c
+++ b/tools/testing/selftests/mm/cow.c
@@ -1771,7 +1771,6 @@ static int tests_per_non_anon_test_case(void)
 
 int main(int argc, char **argv)
 {
-	int err;
 	struct thp_settings default_settings;
 
 	ksft_print_header();
@@ -1811,9 +1810,5 @@ int main(int argc, char **argv)
 		thp_restore_settings();
 	}
 
-	err = ksft_get_fail_cnt();
-	if (err)
-		ksft_exit_fail_msg("%d out of %d tests failed\n",
-				   err, ksft_test_num());
-	ksft_exit_pass();
+	ksft_finished();
 }
diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c
index 21595b20bbc3..e60e62809186 100644
--- a/tools/testing/selftests/mm/gup_longterm.c
+++ b/tools/testing/selftests/mm/gup_longterm.c
@@ -455,7 +455,7 @@ static int tests_per_test_case(void)
 
 int main(int argc, char **argv)
 {
-	int i, err;
+	int i;
 
 	pagesize = getpagesize();
 	nr_hugetlbsizes = detect_hugetlb_page_sizes(hugetlbsizes,
@@ -469,9 +469,5 @@ int main(int argc, char **argv)
 	for (i = 0; i < ARRAY_SIZE(test_cases); i++)
 		run_test_case(&test_cases[i]);
 
-	err = ksft_get_fail_cnt();
-	if (err)
-		ksft_exit_fail_msg("%d out of %d tests failed\n",
-				   err, ksft_test_num());
-	ksft_exit_pass();
+	ksft_finished();
 }

-- 
2.39.5



  reply	other threads:[~2025-05-27 16:13 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 16:04 [PATCH v2 0/4] selftests/mm: cow and gup_longterm cleanups Mark Brown
2025-05-27 16:04 ` Mark Brown [this message]
2025-05-27 16:04 ` [PATCH v2 2/4] selftests/mm: Add helper for logging test start and results Mark Brown
2025-06-03 12:37   ` David Hildenbrand
2025-06-03 18:27     ` Mark Brown
2025-06-03 20:18       ` David Hildenbrand
2025-05-27 16:04 ` [PATCH v2 3/4] selftests/mm: Report unique test names for each cow test Mark Brown
2025-06-03 12:51   ` David Hildenbrand
2025-06-03 13:21     ` Mark Brown
2025-06-03 14:15       ` David Hildenbrand
2025-06-03 14:58         ` Mark Brown
2025-06-03 15:06           ` David Hildenbrand
2025-06-03 15:22             ` Mark Brown
2025-06-03 16:57               ` David Hildenbrand
2025-06-03 17:48                 ` Mark Brown
2025-06-03 17:55                   ` Mark Brown
2025-06-03 20:21                     ` David Hildenbrand
2025-05-27 16:04 ` [PATCH v2 4/4] selftests/mm: Fix test result reporting in gup_longterm Mark Brown
2025-06-03 12:36   ` David Hildenbrand
2025-06-03 13:05     ` Mark Brown
2025-06-05 16:00   ` Lorenzo Stoakes
2025-06-05 16:15     ` Mark Brown
2025-06-05 16:26       ` Lorenzo Stoakes
2025-06-05 16:42         ` Mark Brown
2025-06-05 16:55           ` David Hildenbrand
2025-06-05 17:19             ` Mark Brown
2025-06-05 17:34               ` David Hildenbrand
2025-06-05 18:24                 ` Mark Brown
2025-06-05 17:09           ` Lorenzo Stoakes
2025-06-05 17:38             ` Mark Brown
2025-06-05 17:47               ` Lorenzo Stoakes
2025-06-05 18:29                 ` Mark Brown
2025-06-05 18:35                   ` Lorenzo Stoakes
2025-06-05 16:48       ` David Hildenbrand
2025-06-05 20:32         ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250527-selftests-mm-cow-dedupe-v2-1-ff198df8e38e@kernel.org \
    --to=broonie@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox