Introduce a test for template.sh
This commit is contained in:
parent
e864e312eb
commit
010dec9b0e
|
@ -25,8 +25,9 @@
|
|||
|
||||
|
||||
#variables
|
||||
CONFIGSH="${0%/template.sh}/../config.sh"
|
||||
CONFIGSH="${0%/template.sh}/../../config.sh"
|
||||
PREFIX="/usr/local"
|
||||
DATABASEDIR="../data"
|
||||
PROGNAME="template.sh"
|
||||
#executables
|
||||
DEBUG="_debug"
|
||||
|
@ -54,14 +55,20 @@ _template()
|
|||
ext="${target##*.}"
|
||||
subject="${target##*-}"
|
||||
subject="${subject%%.*}"
|
||||
database="../data/$subject.db"
|
||||
database="$DATABASEDIR/$subject.db"
|
||||
if [ "$subject" = "$target" -o "$subject" = "${target%%.*}" ]; then
|
||||
_error "$target: No subject found for target"
|
||||
return $?
|
||||
fi
|
||||
if [ ! -f "$database" ]; then
|
||||
_error "$subject: No database found for subject"
|
||||
return $?
|
||||
fi
|
||||
source="${target%%-*}.$ext.in"
|
||||
[ -f "$source" ] || source="${source#$OBJDIR}"
|
||||
if [ ! -f "$source" ]; then
|
||||
_error "$source: Could not find source"
|
||||
return $?
|
||||
fi
|
||||
case "$ext" in
|
||||
html|md|rst|txt)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
targets=clint.log,coverage.log,fixme.log,htmllint.log,phplint.log,pylint.log,shlint.log,tests.log,xmllint.log
|
||||
dist=Makefile,tests.sh,binary/project.conf,binary/Makefile.Darwin,binary/Makefile.DeforaOS,binary/Makefile.NetBSD,binary/Makefile.Windows,command/project.conf,command/Makefile.NetBSD,include/project.conf,include/Makefile.NetBSD,java/project.conf,java/Makefile.NetBSD,library/project.conf,library/Makefile.Darwin,library/Makefile.Linux,library/Makefile.NetBSD,library/Makefile.Windows,libtool/project.conf,libtool/Makefile.Darwin,libtool/Makefile.Linux,libtool/Makefile.NetBSD,libtool/Makefile.Windows,object/project.conf,object/Makefile.NetBSD,package/project.conf,package/Makefile.NetBSD,package/config.h.NetBSD,package/config.sh.NetBSD,plugin/project.conf,plugin/Makefile.Darwin,plugin/Makefile.NetBSD,script/project.conf,script/Makefile.NetBSD,verilog/project.conf,verilog/Makefile.NetBSD
|
||||
targets=clint.log,coverage.log,fixme.log,htmllint.log,phplint.log,pylint.log,shlint.log,template-test.md,tests.log,xmllint.log
|
||||
dist=Makefile,template.md.in,test.db,tests.sh,binary/project.conf,binary/Makefile.Darwin,binary/Makefile.DeforaOS,binary/Makefile.NetBSD,binary/Makefile.Windows,command/project.conf,command/Makefile.NetBSD,include/project.conf,include/Makefile.NetBSD,java/project.conf,java/Makefile.NetBSD,library/project.conf,library/Makefile.Darwin,library/Makefile.Linux,library/Makefile.NetBSD,library/Makefile.Windows,libtool/project.conf,libtool/Makefile.Darwin,libtool/Makefile.Linux,libtool/Makefile.NetBSD,libtool/Makefile.Windows,object/project.conf,object/Makefile.NetBSD,package/project.conf,package/Makefile.NetBSD,package/config.h.NetBSD,package/config.sh.NetBSD,plugin/project.conf,plugin/Makefile.Darwin,plugin/Makefile.NetBSD,script/project.conf,script/Makefile.NetBSD,verilog/project.conf,verilog/Makefile.NetBSD
|
||||
|
||||
[clint.log]
|
||||
type=script
|
||||
|
@ -37,6 +37,12 @@ type=script
|
|||
script=../doc/scripts/shlint.sh
|
||||
depends=../doc/scripts/appbroker.sh,../doc/scripts/clint.sh,../doc/scripts/coverage.sh,../doc/scripts/docbook.sh,../doc/scripts/fixme.sh,../doc/scripts/gettext.sh,../doc/scripts/gtkdoc.sh,../doc/scripts/htmllint.sh,../doc/scripts/markdown.sh,../doc/scripts/phplint.sh,../doc/scripts/pkgconfig.sh,../doc/scripts/platform.sh,../doc/scripts/pylint.sh,../doc/scripts/shlint.sh,../doc/scripts/subst.sh,../doc/scripts/template.sh,../doc/scripts/xmllint.sh,tests.sh
|
||||
|
||||
[template-test.md]
|
||||
type=script
|
||||
script=../doc/scripts/template.sh
|
||||
flags=-O DATABASEDIR=.
|
||||
depends=template.md.in,test.db,../doc/scripts/template.sh,../config.sh
|
||||
|
||||
[tests.log]
|
||||
type=script
|
||||
script=./tests.sh
|
||||
|
|
7
tests/template.md.in
Executable file
7
tests/template.md.in
Executable file
|
@ -0,0 +1,7 @@
|
|||
Template test
|
||||
=============
|
||||
|
||||
Test result
|
||||
-----------
|
||||
|
||||
This test is @@SUBST@@.
|
1
tests/test.db
Normal file
1
tests/test.db
Normal file
|
@ -0,0 +1 @@
|
|||
SUBST=OK
|
Loading…
Reference in New Issue
Block a user