]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
compression: test: Move into the lib suite
authorSimon Glass <sjg@chromium.org>
Sat, 2 Nov 2024 19:36:50 +0000 (13:36 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 13 Nov 2024 17:56:01 +0000 (11:56 -0600)
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>
Tested-by: Tom Rini <trini@konsulko.com> # rpi_3, rpi_4, rpi_arm64, am64x_evm_a53, am64-sk
include/test/compression.h [deleted file]
test/cmd_ut.c
test/lib/compression.c

diff --git a/include/test/compression.h b/include/test/compression.h
deleted file mode 100644 (file)
index 02fcfa4..0000000
+++ /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__ */
index 53fddebd49d645b6ebe103ac509a1982af04beeb..32403b48ca4195d9691a081b18709ff8cdec1c4f 100644 (file)
@@ -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(bloblist, CONFIG_SYS_MAXARGS, 1, do_ut_bloblist,
                         "", ""),
        U_BOOT_CMD_MKENT(bootm, CONFIG_SYS_MAXARGS, 1, do_ut_bootm, "", ""),
@@ -207,9 +205,6 @@ U_BOOT_LONGHELP(ut,
 #ifdef CONFIG_CMDLINE
        "\ncmd - test various commands"
 #endif
-#ifdef CONFIG_SANDBOX
-       "\ncompression - compressors and bootm decompression"
-#endif
 #ifdef CONFIG_UT_DM
        "\ndm - driver model"
 #endif
index 618a1936955b5c971bf821ed750831f7fc70eb9f..31b6e5b1eb4b8c0fd3ac8a57a7ef085887fd21ad 100644 (file)
@@ -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);