aboutsummaryrefslogtreecommitdiffstats
path: root/community/mtd-utils
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2019-04-15 09:22:27 +0200
committerKevin Daudt <kdaudt@alpinelinux.org>2019-04-19 20:59:00 +0000
commitc520aa0a98e78909ccd6a47801055e25358494c8 (patch)
treeac66cd1f4612bcb3f79d6208640cff013e9f18c5 /community/mtd-utils
parent9a92e00856b85bd22f1bd0c51a7c5827d77617eb (diff)
community/mtd-utils: Enable check
Enable self-sets by using `make check`. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Diffstat (limited to 'community/mtd-utils')
-rw-r--r--community/mtd-utils/0001_mtd-2.1.0_fix_tests.patch25
-rw-r--r--community/mtd-utils/APKBUILD8
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 00000000000..76d9dfd9a75
--- /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 2e2cc2e763a..7aff888fe7c 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