All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Simon Glass <sjg@chromium.org>,
	Francis Laniel <francis.laniel@amarulasolutions.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Tom Rini <trini@konsulko.com>
Subject: [PATCH 06/21] compression: test: Move into the lib suite
Date: Mon, 28 Oct 2024 13:41:11 +0100	[thread overview]
Message-ID: <20241028124130.32072-7-sjg@chromium.org> (raw)
In-Reply-To: <20241028124130.32072-1-sjg@chromium.org>

There is no particular need for compression to have its own test suite.
Move it into the lib suite instead.

Add the missing help for 'common' and update the docs.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 include/test/compression.h | 16 ----------------
 test/cmd_ut.c              |  5 -----
 test/lib/compression.c     | 39 ++++++++++++++------------------------
 3 files changed, 14 insertions(+), 46 deletions(-)
 delete mode 100644 include/test/compression.h

diff --git a/include/test/compression.h b/include/test/compression.h
deleted file mode 100644
index 02fcfa49f65..00000000000
--- a/include/test/compression.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (c) 2017 Google, Inc
- * Written by Simon Glass <sjg@chromium.org>
- */
-
-#ifndef __TEST_COMPRESSION_H__
-#define __TEST_COMPRESSION_H__
-
-#include <test/test.h>
-
-/* Declare a new compression test */
-#define COMPRESSION_TEST(_name, _flags) \
-		UNIT_TEST(_name, _flags, compression_test)
-
-#endif /* __TEST_ENV_H__ */
diff --git a/test/cmd_ut.c b/test/cmd_ut.c
index cba97725f76..0d7d5009fef 100644
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -111,8 +111,6 @@ static struct cmd_tbl cmd_ut_sub[] = {
 			 "", ""),
 #endif
 #ifdef CONFIG_SANDBOX
-	U_BOOT_CMD_MKENT(compression, CONFIG_SYS_MAXARGS, 1, do_ut_compression,
-			 "", ""),
 	U_BOOT_CMD_MKENT(bootm, CONFIG_SYS_MAXARGS, 1, do_ut_bootm, "", ""),
 #endif
 	U_BOOT_CMD_MKENT(str, CONFIG_SYS_MAXARGS, 1, do_ut_str, "", ""),
@@ -203,9 +201,6 @@ U_BOOT_LONGHELP(ut,
 	"\ncmd - test various commands"
 #endif
 	"\ncommon   - tests for common/ directory"
-#ifdef CONFIG_SANDBOX
-	"\ncompression - compressors and bootm decompression"
-#endif
 #ifdef CONFIG_UT_DM
 	"\ndm - driver model"
 #endif
diff --git a/test/lib/compression.c b/test/lib/compression.c
index 618a1936955..31b6e5b1eb4 100644
--- a/test/lib/compression.c
+++ b/test/lib/compression.c
@@ -23,8 +23,7 @@
 
 #include <linux/lzo.h>
 #include <linux/zstd.h>
-#include <test/compression.h>
-#include <test/suites.h>
+#include <test/lib.h>
 #include <test/ut.h>
 
 static const char plain[] =
@@ -471,40 +470,40 @@ static int compression_test_gzip(struct unit_test_state *uts)
 	return run_test(uts, "gzip", compress_using_gzip,
 			uncompress_using_gzip);
 }
-COMPRESSION_TEST(compression_test_gzip, 0);
+LIB_TEST(compression_test_gzip, 0);
 
 static int compression_test_bzip2(struct unit_test_state *uts)
 {
 	return run_test(uts, "bzip2", compress_using_bzip2,
 			uncompress_using_bzip2);
 }
-COMPRESSION_TEST(compression_test_bzip2, 0);
+LIB_TEST(compression_test_bzip2, 0);
 
 static int compression_test_lzma(struct unit_test_state *uts)
 {
 	return run_test(uts, "lzma", compress_using_lzma,
 			uncompress_using_lzma);
 }
-COMPRESSION_TEST(compression_test_lzma, 0);
+LIB_TEST(compression_test_lzma, 0);
 
 static int compression_test_lzo(struct unit_test_state *uts)
 {
 	return run_test(uts, "lzo", compress_using_lzo, uncompress_using_lzo);
 }
-COMPRESSION_TEST(compression_test_lzo, 0);
+LIB_TEST(compression_test_lzo, 0);
 
 static int compression_test_lz4(struct unit_test_state *uts)
 {
 	return run_test(uts, "lz4", compress_using_lz4, uncompress_using_lz4);
 }
-COMPRESSION_TEST(compression_test_lz4, 0);
+LIB_TEST(compression_test_lz4, 0);
 
 static int compression_test_zstd(struct unit_test_state *uts)
 {
 	return run_test(uts, "zstd", compress_using_zstd,
 			uncompress_using_zstd);
 }
-COMPRESSION_TEST(compression_test_zstd, 0);
+LIB_TEST(compression_test_zstd, 0);
 
 static int compress_using_none(struct unit_test_state *uts,
 			       void *in, unsigned long in_size,
@@ -570,50 +569,40 @@ static int compression_test_bootm_gzip(struct unit_test_state *uts)
 {
 	return run_bootm_test(uts, IH_COMP_GZIP, compress_using_gzip);
 }
-COMPRESSION_TEST(compression_test_bootm_gzip, 0);
+LIB_TEST(compression_test_bootm_gzip, 0);
 
 static int compression_test_bootm_bzip2(struct unit_test_state *uts)
 {
 	return run_bootm_test(uts, IH_COMP_BZIP2, compress_using_bzip2);
 }
-COMPRESSION_TEST(compression_test_bootm_bzip2, 0);
+LIB_TEST(compression_test_bootm_bzip2, 0);
 
 static int compression_test_bootm_lzma(struct unit_test_state *uts)
 {
 	return run_bootm_test(uts, IH_COMP_LZMA, compress_using_lzma);
 }
-COMPRESSION_TEST(compression_test_bootm_lzma, 0);
+LIB_TEST(compression_test_bootm_lzma, 0);
 
 static int compression_test_bootm_lzo(struct unit_test_state *uts)
 {
 	return run_bootm_test(uts, IH_COMP_LZO, compress_using_lzo);
 }
-COMPRESSION_TEST(compression_test_bootm_lzo, 0);
+LIB_TEST(compression_test_bootm_lzo, 0);
 
 static int compression_test_bootm_lz4(struct unit_test_state *uts)
 {
 	return run_bootm_test(uts, IH_COMP_LZ4, compress_using_lz4);
 }
-COMPRESSION_TEST(compression_test_bootm_lz4, 0);
+LIB_TEST(compression_test_bootm_lz4, 0);
 
 static int compression_test_bootm_zstd(struct unit_test_state *uts)
 {
 	return run_bootm_test(uts, IH_COMP_ZSTD, compress_using_zstd);
 }
-COMPRESSION_TEST(compression_test_bootm_zstd, 0);
+LIB_TEST(compression_test_bootm_zstd, 0);
 
 static int compression_test_bootm_none(struct unit_test_state *uts)
 {
 	return run_bootm_test(uts, IH_COMP_NONE, compress_using_none);
 }
-COMPRESSION_TEST(compression_test_bootm_none, 0);
-
-int do_ut_compression(struct cmd_tbl *cmdtp, int flag, int argc,
-		      char *const argv[])
-{
-	struct unit_test *tests = UNIT_TEST_SUITE_START(compression_test);
-	const int n_ents = UNIT_TEST_SUITE_COUNT(compression_test);
-
-	return cmd_ut_category("compression", "compression_test_",
-			       tests, n_ents, argc, argv);
-}
+LIB_TEST(compression_test_bootm_none, 0);
-- 
2.43.0


  parent reply	other threads:[~2024-10-28 12:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 12:41 [PATCH 00/21] test: Tidy up the test/ directory Simon Glass
2024-10-28 12:41 ` [PATCH 01/21] bloblist: test: Move test into common Simon Glass
2024-11-01 21:46   ` Tom Rini
2024-11-02 16:32     ` Simon Glass
2024-10-28 12:41 ` [PATCH 02/21] bloblist: test: Drop global_data declarations Simon Glass
2024-10-28 12:41 ` [PATCH 03/21] bloblist: test: doc: Move into the common suite Simon Glass
2024-10-28 19:33   ` Tom Rini
2024-10-29 15:45     ` Simon Glass
2024-10-29 16:36       ` Tom Rini
2024-10-31 18:00         ` Simon Glass
2024-10-31 18:10           ` Tom Rini
2024-11-01 15:32             ` Simon Glass
2024-11-01 16:47               ` Tom Rini
2024-10-28 12:41 ` [PATCH 04/21] test: Drop test-trace.sh and common.sh Simon Glass
2024-10-28 12:41 ` [PATCH 05/21] compression: test: Move test into lib Simon Glass
2024-10-28 12:41 ` Simon Glass [this message]
2024-10-28 12:41 ` [PATCH 07/21] command_ut: " Simon Glass
2024-10-28 12:41 ` [PATCH 08/21] command: test: Move into the cmd suite Simon Glass
2024-10-28 12:41 ` [PATCH 09/21] test: Update command test to use unit-test functions Simon Glass
2024-10-28 12:41 ` [PATCH 10/21] bootm: test: Move test into boot Simon Glass
2024-10-28 12:41 ` [PATCH 11/21] test: Move print_ut test into common Simon Glass
2024-10-28 12:41 ` [PATCH 12/21] test: Move print_ut into the common suite Simon Glass
2024-10-28 12:41 ` [PATCH 13/21] test: Move str_ut test into lib Simon Glass
2024-10-28 12:41 ` [PATCH 14/21] str: test: Move into the lib suite Simon Glass
2024-10-28 12:41 ` [PATCH 15/21] test: Move unicode_ut test into lib Simon Glass
2024-10-28 12:41 ` [PATCH 16/21] test: Move unicode tests into the lib suite Simon Glass
2024-10-28 12:41 ` [PATCH 17/21] test: Move time_ut test into lib Simon Glass
2024-10-28 12:41 ` [PATCH 18/21] test: Move time tests into the lib suite Simon Glass
2024-10-28 12:41 ` [PATCH 19/21] test: Update time tests to use unit-test asserts Simon Glass
2024-10-28 12:41 ` [PATCH 20/21] test: Correct display of failing test Simon Glass
2024-10-28 12:41 ` [PATCH 21/21] test: Quote test names Simon Glass

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=20241028124130.32072-7-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=francis.laniel@amarulasolutions.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.