* Allow tests to work on more platforms
@ 2019-04-15 8:20 Olliver Schinagl
2019-04-15 8:20 ` [PATCH 1/3] unittests/test_lib: Include proper header for _IOC_SIZE Olliver Schinagl
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Olliver Schinagl @ 2019-04-15 8:20 UTC (permalink / raw)
To: linux-mtd; +Cc: Olliver Schinagl
Trying to make tests work on Alpine Linux (busybox + musl based) I ran
into a very small omissions. This series contains a few micropatches
which fixes these omissions.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] unittests/test_lib: Include proper header for _IOC_SIZE
2019-04-15 8:20 Allow tests to work on more platforms Olliver Schinagl
@ 2019-04-15 8:20 ` Olliver Schinagl
2019-04-15 8:20 ` [PATCH 2/3] unittests/libmtd_test: Include fcntl header Olliver Schinagl
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Olliver Schinagl @ 2019-04-15 8:20 UTC (permalink / raw)
To: linux-mtd; +Cc: Olliver Schinagl
The macro _IOC_SIZE is not part of sys/ioctl.h but lives in asm/ioctl.h
so we should include the proper header. If we do not, some systems
complain during linking that they cannot find the symbol _IOC_SIZE()
which was not expanded by the pre-compiler.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
tests/unittests/test_lib.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/unittests/test_lib.h b/tests/unittests/test_lib.h
index 7a6a003..cd94d9f 100644
--- a/tests/unittests/test_lib.h
+++ b/tests/unittests/test_lib.h
@@ -1,3 +1,4 @@
+#include <asm/ioctl.h>
#include <stdarg.h>
#include <setjmp.h>
#include <stddef.h>
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] unittests/libmtd_test: Include fcntl header
2019-04-15 8:20 Allow tests to work on more platforms Olliver Schinagl
2019-04-15 8:20 ` [PATCH 1/3] unittests/test_lib: Include proper header for _IOC_SIZE Olliver Schinagl
@ 2019-04-15 8:20 ` Olliver Schinagl
2019-04-15 8:20 ` [PATCH 3/3] unittests: Define the use of _GNU_SOURCE Olliver Schinagl
2019-04-25 6:27 ` Allow tests to work on more platforms David Oberhollenzer
3 siblings, 0 replies; 5+ messages in thread
From: Olliver Schinagl @ 2019-04-15 8:20 UTC (permalink / raw)
To: linux-mtd; +Cc: Olliver Schinagl
The test library for the mtd unit tests include various type's and
macro's that officially live in fcntl. Each file and header should
always properly include what they use, so lets add the fcntl headers.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
tests/unittests/libmtd_test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/unittests/libmtd_test.c b/tests/unittests/libmtd_test.c
index 633d94a..176d2ef 100644
--- a/tests/unittests/libmtd_test.c
+++ b/tests/unittests/libmtd_test.c
@@ -1,3 +1,4 @@
+#include <fcntl.h>
#include <stdarg.h>
#include <setjmp.h>
#include <stddef.h>
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] unittests: Define the use of _GNU_SOURCE
2019-04-15 8:20 Allow tests to work on more platforms Olliver Schinagl
2019-04-15 8:20 ` [PATCH 1/3] unittests/test_lib: Include proper header for _IOC_SIZE Olliver Schinagl
2019-04-15 8:20 ` [PATCH 2/3] unittests/libmtd_test: Include fcntl header Olliver Schinagl
@ 2019-04-15 8:20 ` Olliver Schinagl
2019-04-25 6:27 ` Allow tests to work on more platforms David Oberhollenzer
3 siblings, 0 replies; 5+ messages in thread
From: Olliver Schinagl @ 2019-04-15 8:20 UTC (permalink / raw)
To: linux-mtd; +Cc: Olliver Schinagl
The unittest suite actually makes use of some _GNU extensions during the
build (loff_t for example). So lets enable this in the makefile.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
tests/unittests/Makemodule.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/unittests/Makemodule.am b/tests/unittests/Makemodule.am
index b7ae575..df1041d 100644
--- a/tests/unittests/Makemodule.am
+++ b/tests/unittests/Makemodule.am
@@ -6,7 +6,7 @@ ubilib_test_CPPFLAGS = -O0 --std=gnu99 $(CMOCKA_CFLAGS) -I$(top_srcdir)/include
mtdlib_test_SOURCES = tests/unittests/libmtd_test.c lib/libmtd.c lib/libmtd_legacy.c
mtdlib_test_LDADD = $(CMOCKA_LIBS)
mtdlib_test_LDFLAGS = -Wl,--wrap=open -Wl,--wrap=close -Wl,--wrap=ioctl -Wl,--wrap=read -Wl,--wrap=lseek -Wl,--wrap=write
-mtdlib_test_CPPFLAGS = -O0 --std=gnu99 $(CMOCKA_CFLAGS) -I$(top_srcdir)/lib/ -I$(top_srcdir)/include -DSYSFS_ROOT='"$(top_srcdir)/tests/unittests/sysfs_mock"'
+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"'
TEST_BINS = \
ubilib_test \
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Allow tests to work on more platforms
2019-04-15 8:20 Allow tests to work on more platforms Olliver Schinagl
` (2 preceding siblings ...)
2019-04-15 8:20 ` [PATCH 3/3] unittests: Define the use of _GNU_SOURCE Olliver Schinagl
@ 2019-04-25 6:27 ` David Oberhollenzer
3 siblings, 0 replies; 5+ messages in thread
From: David Oberhollenzer @ 2019-04-25 6:27 UTC (permalink / raw)
To: Olliver Schinagl, linux-mtd
Applied to mtd-utils.git master.
Thanks,
David
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-04-25 6:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15 8:20 Allow tests to work on more platforms Olliver Schinagl
2019-04-15 8:20 ` [PATCH 1/3] unittests/test_lib: Include proper header for _IOC_SIZE Olliver Schinagl
2019-04-15 8:20 ` [PATCH 2/3] unittests/libmtd_test: Include fcntl header Olliver Schinagl
2019-04-15 8:20 ` [PATCH 3/3] unittests: Define the use of _GNU_SOURCE Olliver Schinagl
2019-04-25 6:27 ` Allow tests to work on more platforms David Oberhollenzer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).