[jhbuild/wip/tests: 3/4] tests: Also support skipping checkout for tests



commit 41fac6507eeff6d251766eb65d3ff52368a9d598
Author: Colin Walters <walters verbum org>
Date:   Fri Aug 12 04:15:18 2011 -0400

    tests: Also support skipping checkout for tests

 tests/mock.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/tests/mock.py b/tests/mock.py
index 167fb74..74b7dd3 100644
--- a/tests/mock.py
+++ b/tests/mock.py
@@ -140,6 +140,14 @@ class MockModule(jhbuild.modtypes.Package):
         buildscript.set_action(_('Checking out'), self)
     do_checkout.error_phases = [PHASE_FORCE_CHECKOUT]
 
+    def skip_checkout(self, buildscript, last_phase):
+        # skip the checkout stage if the nonetwork flag is set
+        if not self.branch.may_checkout(buildscript):
+            if self.check_build_policy(buildscript) == self.PHASE_DONE:
+                raise jhbuild.errors.SkipToEnd()
+            return True
+        return False
+
     def do_clean(self, buildscript):
         buildscript.set_action(_('Cleaning'), self)
     do_clean.depends = [PHASE_CONFIGURE]



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