* Patch by Caglar.
The idea is to run tests that comes with some packages between
build and install operations.
Tests run either when explicitly given from command line as a command
# pisi build --check pspec.xml
or if --debug option is given to build command
# pisi build -d pspec.xml
If neither --check or -d is given, tests are not run. This is done for
quick build operations and to not wait a boring long test step.
----------
--- actions.py (revision 12260)
+++ actions.py (local)
@@ -18,6 +18,9 @@
autotools.make("-j2 CC=%s AR=%s RANLIB=%s" % (get.CC(), get.AR(),
get.RANLIB()))
autotools.make("-f Makefile-libbz2_so")
+def check():
+ autotools.make("test")
+
def install():
autotools.rawInstall("PREFIX=%s/usr" % get.installDIR())
-----------
[caglar@zangetsu][~/svk/devel/system/base/bzip2]> sudo pisi build
pspec.xml --check
Paketler çalışma dizinine yazılıyor.
Last state was buildpackages
Testing package...
This commit is contained in:
@@ -198,6 +198,8 @@ class Builder:
|
||||
|
||||
self.run_setup_action()
|
||||
self.run_build_action()
|
||||
if ctx.get_option('debug'):
|
||||
self.run_check_action()
|
||||
self.run_install_action()
|
||||
|
||||
# after all, we are ready to build/prepare the packages
|
||||
@@ -324,6 +326,10 @@ class Builder:
|
||||
self.run_action_function(ctx.const.build_func)
|
||||
self.set_state("buildaction")
|
||||
|
||||
def run_check_action(self):
|
||||
ctx.ui.action(_("Testing package..."))
|
||||
self.run_action_function(ctx.const.check_func)
|
||||
|
||||
def run_install_action(self):
|
||||
ctx.ui.action(_("Installing..."))
|
||||
|
||||
@@ -947,6 +953,12 @@ def __buildState_buildaction(pb, last):
|
||||
__buildState_setupaction(pb, last)
|
||||
pb.run_build_action()
|
||||
|
||||
def __buildState_checkaction(pb, last):
|
||||
|
||||
if order[last] < order["buildaction"]:
|
||||
__buildState_buildaction(pb, last)
|
||||
pb.run_check_action()
|
||||
|
||||
def __buildState_installaction(pb, last):
|
||||
|
||||
if order[last] < order["buildaction"]:
|
||||
@@ -989,6 +1001,10 @@ def build_until(pspec, state):
|
||||
__buildState_buildaction(pb, last)
|
||||
return
|
||||
|
||||
if state == "check":
|
||||
__buildState_checkaction(pb, last)
|
||||
return
|
||||
|
||||
if state == "install":
|
||||
__buildState_installaction(pb, last)
|
||||
return
|
||||
|
||||
@@ -461,6 +461,8 @@ to be downloaded from a repository containing sources.
|
||||
const="setup", help=_("Break build after running configure step"))
|
||||
group.add_option("--build", dest="until", action="store_const",
|
||||
const="build", help=_("Break build after running compile step"))
|
||||
group.add_option("--check", dest="until", action="store_const",
|
||||
const="check", help=_("Break build after running check step"))
|
||||
group.add_option("--install", dest="until", action="store_const",
|
||||
const="install", help=_("Break build after running install step"))
|
||||
group.add_option("--package", dest="until", action="store_const",
|
||||
|
||||
@@ -87,6 +87,7 @@ class Constants:
|
||||
# functions in actions_file
|
||||
self.__c.setup_func = "setup"
|
||||
self.__c.build_func = "build"
|
||||
self.__c.check_func = "check"
|
||||
self.__c.install_func = "install"
|
||||
|
||||
# file types
|
||||
|
||||
Reference in New Issue
Block a user