]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: linking test/compression.c fails
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 31 Oct 2020 07:59:25 +0000 (08:59 +0100)
committerSimon Glass <sjg@chromium.org>
Thu, 5 Nov 2020 16:11:31 +0000 (09:11 -0700)
Building U-Boot with unit tests on a non-sandbox systems fails:

ld.bfd: test/built-in.o: in function `compress_using_gzip':
test/compression.c:138: undefined reference to `gzip'
ld.bfd: test/built-in.o: in function `uncompress_using_bzip2':
test/compression.c:187: undefined reference to `BZ2_bzBuffToBuffDecompress'
ld.bfd: test/built-in.o: in function `uncompress_using_lzma':
test/compression.c:222: undefined reference to `lzmaBuffToBuffDecompress'
ld.bfd: test/built-in.o: in function `uncompress_using_lzo':
test/compression.c:257: undefined reference to `lzop_decompress'
ld.bfd: test/built-in.o: in function `uncompress_using_lz4':
test/compression.c:292: undefined reference to `ulz4fn

Add the missing dependencies.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/Kconfig
test/Makefile

index 2646e7d825ac2718aff218f11d3f017b65c36193..ab3ac54a1b2fcec84c67a4e9a3062996e182aee5 100644 (file)
@@ -50,6 +50,15 @@ config UT_LIB_RSA
 
 endif
 
+config UT_COMPRESSION
+       bool "Unit test for compression"
+       depends on UNIT_TEST
+       depends on CMDLINE && GZIP_COMPRESSED && BZIP2 && LZMA && LZO && LZ4
+       default y
+       help
+         Enables tests for compression and decompression routines for simple
+         sanity and for buffer overflow conditions.
+
 config UT_LOG
        bool "Unit tests for logging functions"
        depends on UNIT_TEST
index 39ae04a3d28d2a7a370a85c7687759d69194221b..8296734eb3cdf739637768aeee401ec751130e6d 100644 (file)
@@ -8,7 +8,7 @@ endif
 obj-$(CONFIG_$(SPL_)CMDLINE) += cmd/
 obj-$(CONFIG_$(SPL_)CMDLINE) += cmd_ut.o
 obj-$(CONFIG_$(SPL_)CMDLINE) += command_ut.o
-obj-$(CONFIG_$(SPL_)CMDLINE) += compression.o
+obj-$(CONFIG_$(SPL_)UT_COMPRESSION) += compression.o
 obj-y += dm/
 obj-$(CONFIG_$(SPL_)CMDLINE) += print_ut.o
 obj-$(CONFIG_$(SPL_)CMDLINE) += str_ut.o