diff options
-rw-r--r-- | community/mtd-utils/0001_mtd-2.1.0_fix_tests.patch | 25 | ||||
-rw-r--r-- | community/mtd-utils/APKBUILD | 8 |
2 files changed, 33 insertions, 0 deletions
diff --git a/community/mtd-utils/0001_mtd-2.1.0_fix_tests.patch b/community/mtd-utils/0001_mtd-2.1.0_fix_tests.patch new file mode 100644 index 0000000000..76d9dfd9a7 --- /dev/null +++ b/community/mtd-utils/0001_mtd-2.1.0_fix_tests.patch @@ -0,0 +1,25 @@ +--- mtd-utils-2.1.0/tests/unittests/test_lib.h.orig 2019-04-15 08:01:29.688043955 +0200 ++++ mtd-utils-2.1.0/tests/unittests/test_lib.h 2019-04-15 08:01:34.884030090 +0200 +@@ -1,3 +1,4 @@ ++#include <asm/ioctl.h> + #include <stdarg.h> + #include <setjmp.h> + #include <stddef.h> +--- mtd-utils-2.1.0/tests/unittests/libmtd_test.c.orig 2019-04-15 08:02:47.535836214 +0200 ++++ mtd-utils-2.1.0/tests/unittests/libmtd_test.c 2019-04-15 08:07:22.583102241 +0200 +@@ -1,3 +1,4 @@ ++#include <fcntl.h> + #include <stdarg.h> + #include <setjmp.h> + #include <stddef.h> +--- mtd-utils-2.1.0/Makefile.in.orig 2019-04-15 09:13:39.149755481 +0200 ++++ mtd-utils-2.1.0/Makefile.in 2019-04-15 09:14:13.689663316 +0200 +@@ -1710,7 +1710,7 @@ + @UNIT_TESTS_TRUE@mtdlib_test_SOURCES = tests/unittests/libmtd_test.c lib/libmtd.c lib/libmtd_legacy.c + @UNIT_TESTS_TRUE@mtdlib_test_LDADD = $(CMOCKA_LIBS) + @UNIT_TESTS_TRUE@mtdlib_test_LDFLAGS = -Wl,--wrap=open -Wl,--wrap=close -Wl,--wrap=ioctl -Wl,--wrap=read -Wl,--wrap=lseek -Wl,--wrap=write +-@UNIT_TESTS_TRUE@mtdlib_test_CPPFLAGS = -O0 --std=gnu99 $(CMOCKA_CFLAGS) -I$(top_srcdir)/lib/ -I$(top_srcdir)/include -DSYSFS_ROOT='"$(top_srcdir)/tests/unittests/sysfs_mock"' ++@UNIT_TESTS_TRUE@mtdlib_test_CPPFLAGS = -O0 -D_GNU_SOURCE --std=gnu99 $(CMOCKA_CFLAGS) -I$(top_srcdir)/lib/ -I$(top_srcdir)/include -DSYSFS_ROOT='"$(top_srcdir)/tests/unittests/sysfs_mock"' + @UNIT_TESTS_TRUE@TEST_BINS = \ + @UNIT_TESTS_TRUE@ ubilib_test \ + @UNIT_TESTS_TRUE@ mtdlib_test diff --git a/community/mtd-utils/APKBUILD b/community/mtd-utils/APKBUILD index 2e2cc2e763..7aff888fe7 100644 --- a/community/mtd-utils/APKBUILD +++ b/community/mtd-utils/APKBUILD @@ -10,6 +10,7 @@ makedepends=" acl-dev autoconf automake + cmocka-dev libtool linux-headers lzo-dev @@ -32,6 +33,8 @@ build() ./autogen.sh ./configure \ --build="${CBUILD}" \ + --enable-tests \ + --enable-unit-tests \ --host="${CHOST}" \ --mandir="/usr/share/man" \ --prefix="/usr" \ @@ -39,6 +42,11 @@ build() make } +check() +{ + make check +} + package() { make DESTDIR="${pkgdir}" install |