diff mbox series

[liburing] liburing: create an installation target for tests

Message ID 20191128102606.26353-1-jthumshirn@suse.de (mailing list archive)
State New, archived
Headers show
Series [liburing] liburing: create an installation target for tests | expand

Commit Message

Johannes Thumshirn Nov. 28, 2019, 10:26 a.m. UTC
Create an installation target for liburing's regressen test suite.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 Makefile      |  3 +++
 configure     |  8 ++++++++
 test/Makefile | 10 ++++++++++
 3 files changed, 21 insertions(+)

Comments

Jens Axboe Nov. 28, 2019, 3 p.m. UTC | #1
On 11/28/19 2:26 AM, Johannes Thumshirn wrote:
> Create an installation target for liburing's regressen test suite.
                                                ^^^^^^^^^
regression, will fix it up.

Applied, thanks. BTW, io-uring@vger.kernel.org is the io_uring mailing
list. Since it has nothing to do with linux-block, I've stopped using
that list.
Johannes Thumshirn Nov. 28, 2019, 3:08 p.m. UTC | #2
On 28/11/2019 16:00, Jens Axboe wrote:
> On 11/28/19 2:26 AM, Johannes Thumshirn wrote:
>> Create an installation target for liburing's regressen test suite.
>                                                 ^^^^^^^^^
> regression, will fix it up.

Thanks

> 
> Applied, thanks. BTW, io-uring@vger.kernel.org is the io_uring mailing
> list. Since it has nothing to do with linux-block, I've stopped using
> that list.

Yes I more or less knew, but I couldn't find the address any-more
(get_maintainers.pl would have helped...)

Anyway, thanks
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 9e132183620a..89b3f1d50135 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,9 @@  install: $(NAME).pc
 	$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man2
 	$(INSTALL) -m 644 man/*.2 $(DESTDIR)$(mandir)/man2
 
+install-tests:
+	@$(MAKE) -C test install prefix=$(DESTDIR)$(prefix) datadir=$(DESTDIR)$(datadir)
+
 clean:
 	@rm -f config-host.mak config-host.h cscope.out $(NAME).pc
 	@$(MAKE) -C src clean
diff --git a/configure b/configure
index 81e4bccab350..babbae1fafc2 100755
--- a/configure
+++ b/configure
@@ -24,6 +24,8 @@  for opt do
   ;;
   --mandir=*) mandir="$optarg"
   ;;
+  --datadir=*) datadir="$optarg"
+  ;;
   *)
     echo "ERROR: unkown option $opt"
     echo "Try '$0 --help' for more information"
@@ -44,6 +46,10 @@  fi
 if test -z "$mandir"; then
   mandir="$prefix/man"
 fi
+if test -z "$datadir"; then
+  datadir="$prefix/share"
+fi
+
 
 if test "$show_help" = "yes"; then
 cat <<EOF
@@ -55,6 +61,7 @@  Options: [defaults in brackets after descriptions]
   --includedir=PATH        install headers in PATH [$includedir]
   --libdir=PATH            install libraries in PATH [$libdir]
   --mandir=PATH            install man pages in PATH [$mandir]
+  --datadir=PATH           install shared data in PATH [$datadir]
 EOF
 exit 0
 fi
@@ -163,6 +170,7 @@  print_and_output_mak "prefix" "$prefix"
 print_and_output_mak "includedir" "$includedir"
 print_and_output_mak "libdir" "$libdir"
 print_and_output_mak "mandir" "$mandir"
+print_and_output_mak "datadir" "$datadir"
 
 ##########################################
 # check for __kernel_rwf_t
diff --git a/test/Makefile b/test/Makefile
index 40b7e76190d6..eb83bc1b7ad4 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,3 +1,8 @@ 
+prefix ?= /usr
+datadir ?= $(prefix)/share
+
+INSTALL=install
+
 CFLAGS ?= -g -O2
 XCFLAGS =
 override CFLAGS += -Wall -D_GNU_SOURCE -L../src/ -I../src/include/
@@ -41,6 +46,11 @@  send_recvmsg: XCFLAGS = -lpthread
 poll-link: XCFLAGS = -lpthread
 accept-link: XCFLAGS = -lpthread
 
+install: $(all_targets) runtests.sh runtests-loop.sh
+	$(INSTALL) -D -d -m 755 $(datadir)/liburing-test/
+	$(INSTALL) -D -m 755 $(all_targets) $(datadir)/liburing-test/
+	$(INSTALL) -D -m 755 runtests.sh  $(datadir)/liburing-test/
+	$(INSTALL) -D -m 755 runtests-loop.sh  $(datadir)/liburing-test/
 clean:
 	rm -f $(all_targets) $(test_objs)