summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-08-13 05:42:18 (GMT)
committerSteven Knight <knight@baldmt.com>2005-08-13 05:42:18 (GMT)
commit52fcda2435759339de636e5d5abad71b0f5372ad (patch)
tree7b99184d14e042b4f58b1f2186cbf70f4f05cfc8 /etc
parent90376f36df71401df8e7cf71fead9b7869153159 (diff)
downloadSCons-52fcda2435759339de636e5d5abad71b0f5372ad.zip
SCons-52fcda2435759339de636e5d5abad71b0f5372ad.tar.gz
SCons-52fcda2435759339de636e5d5abad71b0f5372ad.tar.bz2
Add a skip_test() method to the infrastructure and use it for test scripts that skip all or part of their tests based on tool availability or test platform.
Diffstat (limited to 'etc')
-rw-r--r--etc/TestSCons.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/etc/TestSCons.py b/etc/TestSCons.py
index 791415d..fec51a4 100644
--- a/etc/TestSCons.py
+++ b/etc/TestSCons.py
@@ -242,6 +242,33 @@ class TestSCons(TestCommon):
kw['match'] = self.match_re_dotall
apply(self.run, [], kw)
+ def skip_test(self, message="Skipping test.\n"):
+ """Skips a test.
+
+ Proper test-skipping behavior is dependent on whether we're being
+ executed as part of development of a change under Aegis.
+
+ Technically, skipping a test is a NO RESULT, but Aegis will
+ treat that as a test failure and prevent the change from going
+ to the next step. We don't want to force anyone using Aegis
+ to have to install absolutely every tool used by the tests,
+ so we actually report to Aegis that a skipped test has PASSED
+ so that the workflow isn't held up.
+ """
+ if message:
+ sys.stdout.write(message)
+ sys.stdout.flush()
+ devdir = os.popen("aesub '$dd' 2>/dev/null", "r").read()[:-1]
+ intdir = os.popen("aesub '$intd' 2>/dev/null", "r").read()[:-1]
+ if devdir and self._cwd[:len(devdir)] == devdir or \
+ intdir and self._cwd[:len(intdir)] == intdir:
+ # We're under the development directory for this change,
+ # so this is an Aegis invocation; pass the test (exit 0).
+ self.pass_test()
+ else:
+ self.no_result()
+
+
def java_ENV(self):
"""
Return a default external environment that uses a local Java SDK