From 52d4e566743f57b9de81c77fdb605c171c02eacb Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Fri, 22 Feb 2019 15:19:33 -0600 Subject: [PATCH] combine test directories This fixes #295. --- Makefile | 3 ++- mk/scripts.mk | 1 - sh/Makefile | 1 - src/Makefile | 2 +- {src/test => test}/Makefile | 0 {src/test => test}/runtests.sh | 2 +- {src/test => test}/units/is_older_than | 0 sh/runtests.sh => test/units/sh_yesno | 3 +-- 8 files changed, 5 insertions(+), 7 deletions(-) rename {src/test => test}/Makefile (100%) rename {src/test => test}/runtests.sh (98%) rename {src/test => test}/units/is_older_than (100%) rename sh/runtests.sh => test/units/sh_yesno (95%) diff --git a/Makefile b/Makefile index 2c8527b5..b02e1c50 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,9 @@ ifeq (${MKZSHCOMP},yes) SUBDIR+= zsh-completion endif -# We need to ensure that runlevels is done last +# We need to ensure that runlevels is done last other than test SUBDIR+= runlevels +SUBDIR+= test INSTALLAFTER= _installafter diff --git a/mk/scripts.mk b/mk/scripts.mk index 40cb4d65..147e6643 100644 --- a/mk/scripts.mk +++ b/mk/scripts.mk @@ -53,7 +53,6 @@ realinstall: ${BIN} ${CONF} ${INC} install: all realinstall ${INSTALLAFTER} check test:: - @if test -e runtests.sh ; then ./runtests.sh || exit $$? ; fi # A lot of scripts don't have anything to clean # Also, some rm implentation require a file argument regardless of error diff --git a/sh/Makefile b/sh/Makefile index ef590e81..7f5dfb21 100644 --- a/sh/Makefile +++ b/sh/Makefile @@ -31,4 +31,3 @@ _installafter: ln -snf ${LIBEXECDIR}/sh/functions.sh ${DESTDIR}/${INITDIR} || exit $$? check test:: - ./runtests.sh diff --git a/src/Makefile b/src/Makefile index e3750347..0148c4d1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,7 @@ # Copyright (c) 2007-2008 Roy Marples # Released under the 2-clause BSD license. -SUBDIR= test libeinfo librc rc +SUBDIR= libeinfo librc rc MK= ../mk include ${MK}/subdir.mk diff --git a/src/test/Makefile b/test/Makefile similarity index 100% rename from src/test/Makefile rename to test/Makefile diff --git a/src/test/runtests.sh b/test/runtests.sh similarity index 98% rename from src/test/runtests.sh rename to test/runtests.sh index 269f26f1..5e21d2ab 100755 --- a/src/test/runtests.sh +++ b/test/runtests.sh @@ -1,6 +1,6 @@ #!/bin/sh -top_srcdir=${top_srcdir:-../..} +top_srcdir=${top_srcdir:-..} . ${top_srcdir}/test/setup_env.sh libeinfo_srcdir="${srcdir}/../libeinfo" diff --git a/src/test/units/is_older_than b/test/units/is_older_than similarity index 100% rename from src/test/units/is_older_than rename to test/units/is_older_than diff --git a/sh/runtests.sh b/test/units/sh_yesno similarity index 95% rename from sh/runtests.sh rename to test/units/sh_yesno index b42a3577..bff4693a 100755 --- a/sh/runtests.sh +++ b/test/units/sh_yesno @@ -15,7 +15,6 @@ ret=0 tret=0 -ebegin "Testing yesno()" for f in yes YES Yes true TRUE True 1 ; do if ! yesno $f; then : $(( tret += 1 )) @@ -28,7 +27,7 @@ for f in no NO No false FALSE False 0 ; do echo "!$f!" fi done -eend $tret : $(( ret += $tret )) +eend $ret exit $ret