[jhbuild] Add --check option to build and buildone (GNOME bug 592433)



commit ce1955e64f0c2611ef5ce054abd6251b1171b160
Author: Craig Keogh <cskeogh adam com au>
Date:   Mon Oct 5 09:49:06 2009 +1030

    Add --check option to build and buildone (GNOME bug 592433)

 doc/C/jhbuild.xml             |   19 +++++++++++++++----
 jhbuild/commands/base.py      |    6 ++++++
 jhbuild/config.py             |    3 +++
 jhbuild/modtypes/autotools.py |    4 +++-
 jhbuild/modtypes/waf.py       |    4 +++-
 5 files changed, 30 insertions(+), 6 deletions(-)
---
diff --git a/doc/C/jhbuild.xml b/doc/C/jhbuild.xml
index ce91748..802ebac 100644
--- a/doc/C/jhbuild.xml
+++ b/doc/C/jhbuild.xml
@@ -616,6 +616,7 @@ jhbuildbot_password = 'password'
 	<command>jhbuild build</command>
 	<arg>--autogen</arg>
 	<arg>--clean</arg>
+	<arg>--check</arg>
 	<arg>--dist</arg>
 	<arg>--distcheck</arg>
 	<arg>--ignore-suggests</arg>
@@ -659,6 +660,14 @@ jhbuildbot_password = 'password'
 	</varlistentry>
 
 	<varlistentry>
+	  <term><option>--check</option></term>
+	  <listitem>
+	    <simpara>Run <command>make check</command> after building
+	    modules.</simpara>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
 	  <term><option>-d</option>, <option>--dist</option></term>
 	  <listitem>
 	    <simpara>Run <command>make dist</command> after building
@@ -805,6 +814,7 @@ jhbuildbot_password = 'password'
 	<command>jhbuild buildone</command>
 	<arg>--autogen</arg>
 	<arg>--clean</arg>
+	<arg>--check</arg>
 	<arg>--distcheck</arg>
 	<arg>--no-network</arg>
 	<arg>-D <replaceable>date</replaceable></arg>
@@ -814,10 +824,11 @@ jhbuildbot_password = 'password'
 	<arg choice="plain" rep="repeat">module</arg>
       </cmdsynopsis>
 
-      <para>The <option>--autogen</option>, <option>--clean</option>,
-      <option>-d</option>, <option>--distcheck</option>, 
-      <option>--no-network</option>, <option>-D</option> and
-      <option>-x</option> options are processed as per the
+      <para>The <option>--autogen</option>, <option>--check</option>,
+      <option>--clean</option>, <option>-d</option>,
+      <option>--distcheck</option>, <option>--no-network</option>,
+      <option>-D</option> and <option>-x</option> options are processed
+      as per the
       <link linkend="command-reference-build"><command>build</command></link>
       command.</para>
 
diff --git a/jhbuild/commands/base.py b/jhbuild/commands/base.py
index fb40b89..fa5e8ba 100644
--- a/jhbuild/commands/base.py
+++ b/jhbuild/commands/base.py
@@ -215,6 +215,9 @@ class cmd_build(Command):
             make_option('-c', '--clean',
                         action='store_true', dest='clean', default=False,
                         help=_('run make clean before make')),
+            make_option('--check',
+                        action='store_true', dest='check', default=False,
+                        help=_('run make check after building')),
             make_option('-d', '--dist',
                         action='store_true', dest='dist', default=False,
                         help=_('run make dist after building')),
@@ -306,6 +309,9 @@ class cmd_buildone(Command):
             make_option('-c', '--clean',
                         action='store_true', dest='clean', default=False,
                         help=_('run make clean before make')),
+            make_option('--check',
+                        action='store_true', dest='check', default=False,
+                        help=_('run make check after building')),
             make_option('-d', '--dist',
                         action='store_true', dest='dist', default=False,
                         help=_('run make dist after building')),
diff --git a/jhbuild/config.py b/jhbuild/config.py
index 9d62df2..9a44f2d 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -487,6 +487,9 @@ class Config:
         if hasattr(options, 'clean') and (
                 options.clean and not 'clean' in self.build_targets):
             self.build_targets.insert(0, 'clean')
+        if hasattr(options, 'check') and (
+                options.check and not 'check' in self.build_targets):
+            self.build_targets.insert(0, 'check')
         if hasattr(options, 'dist') and (
                 options.dist and not 'dist' in self.build_targets):
             self.build_targets.append('dist')
diff --git a/jhbuild/modtypes/autotools.py b/jhbuild/modtypes/autotools.py
index e5b17a4..9d4c069 100644
--- a/jhbuild/modtypes/autotools.py
+++ b/jhbuild/modtypes/autotools.py
@@ -223,7 +223,9 @@ class AutogenModule(Package, DownloadableModule):
     def skip_check(self, buildscript, last_phase):
         if not self.check_target:
             return True
-        if not buildscript.config.module_makecheck.get(self.name, buildscript.config.makecheck):
+        if self.name in buildscript.config.module_makecheck:
+            return not buildscript.config.module_makecheck[self.name]
+        if 'check' not in buildscript.config.build_targets:
             return True
         return False
 
diff --git a/jhbuild/modtypes/waf.py b/jhbuild/modtypes/waf.py
index c6012a3..3df35ec 100644
--- a/jhbuild/modtypes/waf.py
+++ b/jhbuild/modtypes/waf.py
@@ -103,7 +103,9 @@ class WafModule(Package, DownloadableModule):
     do_build.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
 
     def skip_check(self, buildscript, last_phase):
-        if not buildscript.config.module_makecheck.get(self.name, buildscript.config.makecheck):
+        if self.name in buildscript.config.module_makecheck:
+            return not buildscript.config.module_makecheck[self.name]
+        if 'check' not in buildscript.config.build_targets:
             return True
         return False
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]