Skip to content

Commit 63ab326

Browse files
committed
add skeleton for autotest testsuite
1 parent 8a5547a commit 63ab326

File tree

6 files changed

+82
-0
lines changed

6 files changed

+82
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
/config.h.in
44
/config.h.in~
55
/configure
6+
/tests/package.m4
7+
/tests/testsuite
8+
/tests/testsuite.dir
9+
/tests/testsuite.log
610
Makefile.in

Makefile.am

+24
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,27 @@ msibuild_DEPENDENCIES = libmsi/libmsi.la
1717
msiinfo_SOURCES = tools/msiinfo.c
1818
msiinfo_LDADD = -lmsi $(GLIB_LIBS) $(GSF_LIBS)
1919
msiinfo_DEPENDENCIES = libmsi/libmsi.la
20+
21+
# Autotest support
22+
23+
dist_noinst_DATA = tests/testsuite.at tests/package.m4 tests/testsuite
24+
DISTCLEANFILES = atconfig
25+
CLEANFILES = testsuite.log
26+
27+
check-local: tests/testsuite atconfig
28+
builddir=`pwd` && \
29+
cd $(srcdir)/tests && \
30+
$(SHELL) testsuite AUTOTEST_PATH=$$builddir $(TESTSUITEFLAGS)
31+
32+
installcheck-local: tests/testsuite atconfig
33+
cd $(srcdir)/tests && \
34+
$(SHELL) testsuite AUTOTEST_PATH=$(bindir) $(TESTSUITEFLAGS)
35+
36+
clean-local:
37+
-$(SHELL) tests/testsuite --clean
38+
39+
tests/testsuite: tests/testsuite.at tests/package.m4
40+
cd $(srcdir)/tests && \
41+
$(AUTOM4TE) --language=autotest -o testsuite.tmp testsuite.at && \
42+
mv testsuite.tmp testsuite
43+

build-aux/move-if-change

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
# Like mv $1 $2, but if the files are the same, just delete $1.
3+
# Status is zero if successful, nonzero otherwise.
4+
#
5+
# Copyright (C) 2011 Free Software Foundation, Inc.
6+
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
7+
# This is free software: you are free to change and redistribute it.
8+
# There is NO WARRANTY, to the extent permitted by law."
9+
10+
if test -r "$2" && cmp -- "$1" "$2" >/dev/null; then
11+
rm -f -- "$1"
12+
else
13+
if mv -f -- "$1" "$2"; then :; else
14+
# Ignore failure due to a concurrent move-if-change.
15+
test -r "$2" && cmp -- "$1" "$2" >/dev/null && rm -f -- "$1"
16+
fi
17+
fi

configure.ac

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ AS_IF([test "$uuid" = yes],
2525

2626
LT_INIT([win32-dll disable-fast-install])
2727

28+
AM_MISSING_PROG([AUTOM4TE], [autom4te])
29+
AC_CONFIG_TESTDIR([.])
30+
AC_CONFIG_FILES([tests/package.m4.tmp:tests/package.m4.in],
31+
[$srcdir/build-aux/move-if-change tests/package.m4.tmp $srcdir/tests/package.m4
32+
cp $srcdir/tests/package.m4 tests/package.m4.tmp])
33+
2834
AC_CONFIG_FILES([Makefile libmsi/Makefile tests/Makefile])
2935
AC_CONFIG_FILES([tests/runtest], [chmod +x tests/runtest])
3036
AC_OUTPUT

tests/package.m4.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Signature of the current package.
2+
m4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])
3+
m4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])
4+
m4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])
5+
m4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])
6+
m4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])
7+
m4_define([AT_PACKAGE_URL], [@PACKAGE_URL@])
8+

tests/testsuite.at

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Autotest testsuite for msitools.
2+
3+
# Copyright (C) 2012 Red Hat, Inc.
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 2, or (at your option)
8+
# any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program; if not, write to the Free Software
17+
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18+
# 02111-1307, USA.
19+
20+
m4_include([package.m4])
21+
22+
AT_INIT
23+
# Cannot use AT_TESTED because of $EXEEXT (Autotest bug)

0 commit comments

Comments
 (0)