[pacman-dev] [PATCH] Have configure set pactest options that it knows.
Jeremy Heiner
scalaprotractor at gmail.com
Tue Dec 24 08:11:02 EST 2013
This patch is not ready for accepting into the repository.
It does not work for VPATH builds (because the paths to all the .py
tests are seen as relative to $(builddir)). Dave is working on a fix
for this VPATH issue, so a real version of this patch must wait to
incorporate his commit. This patch works fine for in-$(srcdir) builds.
The purpose of posting it is to follow up Saturday's conversation.
I think it implements all of Allan's suggestions (if I understood
correctly). The real commit message would be something like:
SCRIPTLET_SHELL and LDCONFIG can be set via args to configure, and up
'till now those options were passed to pactest by Makefile.am as
command-line args. That works fine for 'make check', but required
repeated specification when running pactest manually. This patch makes
pactest a configured file so it has direct access to those options and
they no longer need to be specified (by Makefile.am nor by hand).
Also the default for the pactest '-p' arg is changed to be the pacman
that the make builds. The '-p' arg is still available, but it should
now be very rare to have to use it when calling pactest manually.
---
Makefile.am | 4 ----
configure.ac | 1 +
test/pacman/.gitignore | 1 +
test/pacman/{pactest.py => pactest.py.in} | 21 ++++++++++++---------
4 files changed, 14 insertions(+), 13 deletions(-)
rename test/pacman/{pactest.py => pactest.py.in} (88%)
mode change 100755 => 100644
diff --git a/Makefile.am b/Makefile.am
index 4d5adae..9689992 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,10 +41,6 @@ LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
PY_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/build-aux/tap-driver.sh
PY_LOG_COMPILER = $(top_srcdir)/test/pacman/pactest.py
-AM_PY_LOG_FLAGS = \
- --scriptlet-shell $(SCRIPTLET_SHELL) \
- --ldconfig $(LDCONFIG) \
- -p $(top_builddir)/src/pacman/pacman
# create the pacman DB and cache directories upon install
install-data-local:
diff --git a/configure.ac b/configure.ac
index cfcc8d1..292260a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -507,6 +507,7 @@ test/util/Makefile
contrib/Makefile
Makefile
])
+AC_CONFIG_FILES([test/pacman/pactest.py],[chmod +x test/pacman/pactest.py])
AC_OUTPUT
echo "
diff --git a/test/pacman/.gitignore b/test/pacman/.gitignore
index 0d20b64..39fa72b 100644
--- a/test/pacman/.gitignore
+++ b/test/pacman/.gitignore
@@ -1 +1,2 @@
*.pyc
+pactest.py
diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py.in
old mode 100755
new mode 100644
similarity index 88%
rename from test/pacman/pactest.py
rename to test/pacman/pactest.py.in
index e21cde7..0d9e1f7
--- a/test/pacman/pactest.py
+++ b/test/pacman/pactest.py.in
@@ -1,5 +1,7 @@
#! /usr/bin/python2
#
+# @configure_input@
+#
# pactest : run automated testing on the pacman binary
#
# Copyright (c) 2006 by Aurelien Foret <orelien at chez.com>
@@ -25,6 +27,12 @@
import sys
import tempfile
+BUILDDIR = os.path.dirname(os.path.realpath(__file__))
+SRCDIR = os.path.realpath(os.path.join(BUILDDIR, "@srcdir@"))
+if BUILDDIR != SRCDIR: sys.path.insert(0, SRCDIR)
+TOP_BUILDDIR = os.path.realpath(os.path.join(BUILDDIR, "@top_builddir@"))
+BUILT_EXE = os.path.realpath(os.path.join(TOP_BUILDDIR, "src/pacman/pacman"))
+
import pmenv
import tap
import util
@@ -50,7 +58,7 @@ def create_parser():
help = "set debug level for pacman")
parser.add_option("-p", "--pacman", action = "callback",
callback = resolve_binary_path, type = "string",
- dest = "bin", default = "pacman",
+ dest = "bin", default = BUILT_EXE,
help = "specify location of the pacman binary")
parser.add_option("--keep-root", action = "store_true",
dest = "keeproot", default = False,
@@ -67,12 +75,6 @@ def create_parser():
parser.add_option("--manual-confirm", action = "store_true",
dest = "manualconfirm", default = False,
help = "do not use --noconfirm for pacman calls")
- parser.add_option("--scriptlet-shell", type = "string",
- dest = "scriptletshell", default = "/bin/sh",
- help = "specify path to shell used for install scriptlets")
- parser.add_option("--ldconfig", type = "string",
- dest = "ldconfig", default = "/sbin/ldconfig",
- help = "specify path to ldconfig")
return parser
@@ -97,8 +99,9 @@ def create_parser():
env.pacman["gdb"] = opts.gdb
env.pacman["valgrind"] = opts.valgrind
env.pacman["manual-confirm"] = opts.manualconfirm
- env.pacman["scriptlet-shell"] = opts.scriptletshell
- env.pacman["ldconfig"] = opts.ldconfig
+ # and add configured options
+ env.pacman["scriptlet-shell"] = "@SCRIPTLET_SHELL@"
+ env.pacman["ldconfig"] = "@LDCONFIG@"
opts.testcases = []
for path in args:
--
1.8.5.2
More information about the pacman-dev
mailing list