summaryrefslogtreecommitdiff
path: root/tests/ubi-tests/Makemodule.am
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-07-13 16:10:28 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-11-17 11:36:55 +0100
commit8a00021b2ab5529640e5acaca30a27cdaca04178 (patch)
tree0944317c3e431143eedca84429348334a725e716 /tests/ubi-tests/Makemodule.am
parentd39ea7019cb204420c53a203ff9ccbb4cab0d4b3 (diff)
Integrate tests into autotools build system
Add automake files for the test binaries. If configured to do so, install the test binaries to libexec/mtd-utils and use autoconf to fix the paths in the test scripts. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'tests/ubi-tests/Makemodule.am')
-rw-r--r--tests/ubi-tests/Makemodule.am68
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/ubi-tests/Makemodule.am b/tests/ubi-tests/Makemodule.am
new file mode 100644
index 0000000..805aeaf
--- /dev/null
+++ b/tests/ubi-tests/Makemodule.am
@@ -0,0 +1,68 @@
+io_basic_SOURCES = tests/ubi-tests/io_basic.c tests/ubi-tests/helpers.c
+io_basic_LDADD = libubi.a
+io_basic_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+io_update_SOURCES = tests/ubi-tests/io_update.c tests/ubi-tests/helpers.c
+io_update_LDADD = libubi.a
+io_update_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+io_paral_SOURCES = tests/ubi-tests/io_paral.c tests/ubi-tests/helpers.c
+io_paral_LDADD = libubi.a $(PTHREAD_LIBS)
+io_paral_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+io_paral_LDADD += $(PTHREAD_CFLAGS)
+io_paral_CPPFLAGS += $(PTHREAD_CFLAGS)
+
+io_read_SOURCES = tests/ubi-tests/io_read.c tests/ubi-tests/helpers.c
+io_read_LDADD = libubi.a
+io_read_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+volrefcnt_SOURCES = tests/ubi-tests/volrefcnt.c tests/ubi-tests/helpers.c
+volrefcnt_LDADD = libubi.a
+volrefcnt_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+integ_SOURCES = tests/ubi-tests/integ.c tests/ubi-tests/helpers.c
+integ_LDADD = libubi.a
+integ_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+mkvol_basic_SOURCES = tests/ubi-tests/mkvol_basic.c tests/ubi-tests/helpers.c
+mkvol_basic_LDADD = libubi.a
+mkvol_basic_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+mkvol_bad_SOURCES = tests/ubi-tests/mkvol_bad.c tests/ubi-tests/helpers.c
+mkvol_bad_LDADD = libubi.a
+mkvol_bad_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+mkvol_paral_SOURCES = tests/ubi-tests/mkvol_paral.c tests/ubi-tests/helpers.c
+mkvol_paral_LDADD = libubi.a $(PTHREAD_LIBS)
+mkvol_paral_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+mkvol_paral_LDADD += $(PTHREAD_CFLAGS)
+mkvol_paral_CPPFLAGS += $(PTHREAD_CFLAGS)
+
+rsvol_SOURCES = tests/ubi-tests/rsvol.c tests/ubi-tests/helpers.c
+rsvol_LDADD = libubi.a
+rsvol_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/ubi-utils/include
+
+UBITEST_BINS = \
+ io_basic io_update io_paral io_read volrefcnt integ \
+ mkvol_basic mkvol_bad mkvol_paral rsvol
+
+UBITEST_SH = \
+ tests/ubi-tests/runubitests.sh tests/ubi-tests/ubi-stress-test.sh
+
+UBITEST_HEADER = \
+ tests/ubi-tests/helpers.h
+
+UBITEST_EXTRA = \
+ tests/ubi-tests/README.udev
+
+EXTRA_DIST += $(UBITEST_EXTRA) $(UBITEST_HEADER)
+
+if INSTALL_TESTS
+pkglibexec_SCRIPTS += $(UBITEST_SH)
+pkglibexec_PROGRAMS += $(UBITEST_BINS)
+else
+noinst_SCRIPTS += $(UBITEST_SH)
+noinst_PROGRAMS += $(UBITEST_BINS)
+endif