From: stevenknight Date: Sun, 14 Aug 2005 06:00:06 +0000 (+0000) Subject: Update more tests to use the new skip_test() method. Replace a CHANGES.txt comment... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7608beb6403eb6b255289c989923060f253463f5;p=scons.git Update more tests to use the new skip_test() method. Replace a CHANGES.txt comment inadvertently deleted. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1333 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 1696d7f1..b95268d8 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -44,6 +44,8 @@ RELEASE 0.97 - XXX - Allow access to both TARGET and SOURCE in $*PATH expansions. + - Allow SConscript files to modify BUILD_TARGETS. + From Timothee Besset: - Add support for Objective C/C++ .m and .mm file suffixes (for diff --git a/test/BitKeeper/BitKeeper.py b/test/BitKeeper/BitKeeper.py index 6db48f41..2fa3921e 100644 --- a/test/BitKeeper/BitKeeper.py +++ b/test/BitKeeper/BitKeeper.py @@ -36,8 +36,7 @@ test = TestSCons.TestSCons() bk = test.where_is('bk') if not bk: - print "Could not find BitKeeper, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'bk'; skipping test(s).\n") try: login = os.getlogin() diff --git a/test/CVS.py b/test/CVS.py index abdffe21..79257df9 100644 --- a/test/CVS.py +++ b/test/CVS.py @@ -37,8 +37,7 @@ test = TestSCons.TestSCons() cvs = test.where_is('cvs') if not cvs: - print "Could not find CVS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'cvs'; skipping test(s).\n") test.subdir('CVS', 'import', ['import', 'sub'], 'work1', 'work2') diff --git a/test/DMD.py b/test/DMD.py index 9bad5f42..8b443f89 100644 --- a/test/DMD.py +++ b/test/DMD.py @@ -34,8 +34,7 @@ test = TestSCons.TestSCons() dmd = test.where_is('dmd') if not dmd: - print "dmd not found, skipping test" - test.pass_test(1) + test.skip_test("Could not find 'dmd'; skipping test.\n") test.write('SConstruct', """\ import os diff --git a/test/Java/RMIC.py b/test/Java/RMIC.py index 8f3623c9..3ce3decc 100644 --- a/test/Java/RMIC.py +++ b/test/Java/RMIC.py @@ -94,8 +94,7 @@ line 3 if not os.path.exists('/usr/local/j2sdk1.3.1/bin/rmic'): - print "Could not find Java, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find Java; skipping non-simulated test(s).\n") diff --git a/test/Perforce/Perforce.py b/test/Perforce/Perforce.py index 5808b23d..891acc3c 100644 --- a/test/Perforce/Perforce.py +++ b/test/Perforce/Perforce.py @@ -41,8 +41,7 @@ test = TestSCons.TestSCons() p4 = test.where_is('p4') if not p4: - print "Could not find Perforce, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'p4'; skipping test(s).\n") user = os.environ.get('USER') if not user: diff --git a/test/QT/installed.py b/test/QT/installed.py index 14aad260..6b06d376 100644 --- a/test/QT/installed.py +++ b/test/QT/installed.py @@ -31,14 +31,15 @@ Look if qt is installed, and try out all builders. import os import re import string +import sys import TestSCons test = TestSCons.TestSCons() if not os.environ.get('QTDIR', None): - print "Could not find QT, skipping test(s)." - test.no_result(1) + x ="External environment variable $QTDIR not set; skipping test(s).\n" + test.skip_test(x) test.Qt_dummy_installation() @@ -175,8 +176,24 @@ int main(int argc, char **argv) { test.run(arguments="bld/test_realqt" + TestSCons._exe) + test.run(program=test.workpath("bld", "test_realqt"), - stdout="Hello World\n") + stdout=None, + status=None, + stderr=None) + +if test.stdout() != "Hello World\n" or test.stderr() != '' or test.status: + sys.stdout.write(test.stdout()) + sys.stderr.write(test.stderr()) + # The test might be run on a system that doesn't have an X server + # running, or may be run by an ID that can't connect to the server. + # If so, then print whatever it showed us (which is in and of itself + # an indication that it built correctly) but don't fail the test. + expect = 'cannot connect to X server' + test.fail_test(test.stdout() != '' or + string.find(test.stderr(), expect) == -1 or \ + (test.status>>8) != 1) + QTDIR = os.environ['QTDIR'] PATH = os.environ['PATH'] @@ -191,4 +208,5 @@ expect2 = "scons: warning: Could not detect qt, using moc executable as a hint" test.fail_test(string.find(test.stderr(), expect1) == -1 and string.find(test.stderr(), expect2) == -1) + test.pass_test() diff --git a/test/RCS/diskcheck.py b/test/RCS/diskcheck.py index c1d5ccad..4a93edf7 100644 --- a/test/RCS/diskcheck.py +++ b/test/RCS/diskcheck.py @@ -36,13 +36,11 @@ test = TestSCons.TestSCons() rcs = test.where_is('rcs') if not rcs: - print "Could not find RCS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'rcs'; skipping test(s).\n") ci = test.where_is('ci') if not ci: - print "Could not find `ci' command, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'ci'; skipping test(s).\n") diff --git a/test/RCS/explicit.py b/test/RCS/explicit.py index 39ea8342..d3d5d877 100644 --- a/test/RCS/explicit.py +++ b/test/RCS/explicit.py @@ -36,13 +36,11 @@ test = TestSCons.TestSCons() rcs = test.where_is('rcs') if not rcs: - print "Could not find RCS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'rcs'; skipping test(s).\n") ci = test.where_is('ci') if not ci: - print "Could not find `ci' command, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find `ci' command, skipping test(s).\n") diff --git a/test/RCS/implicit.py b/test/RCS/implicit.py index 22892580..362f15aa 100644 --- a/test/RCS/implicit.py +++ b/test/RCS/implicit.py @@ -34,18 +34,15 @@ test = TestSCons.TestSCons() rcs = test.where_is('rcs') if not rcs: - print "Could not find RCS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'rcs'; skipping test(s).\n") ci = test.where_is('ci') if not ci: - print "Could not find `ci' command, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'ci'; skipping test(s).\n") co = test.where_is('co') if not co: - print "Could not find `co' command, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'co'; skipping test(s).\n") diff --git a/test/RCS/transparent.py b/test/RCS/transparent.py index 63475c87..28dc558b 100644 --- a/test/RCS/transparent.py +++ b/test/RCS/transparent.py @@ -36,13 +36,11 @@ test = TestSCons.TestSCons() rcs = test.where_is('rcs') if not rcs: - print "Could not find RCS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'rcs'; skipping test(s).\n") ci = test.where_is('ci') if not ci: - print "Could not find `ci' command, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'ci'; skipping test(s).\n") diff --git a/test/SCCS/diskcheck.py b/test/SCCS/diskcheck.py index 691f09c0..532ad9c8 100644 --- a/test/SCCS/diskcheck.py +++ b/test/SCCS/diskcheck.py @@ -36,8 +36,7 @@ test = TestSCons.TestSCons() sccs = test.where_is('sccs') if not sccs: - print "Could not find SCCS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'sccs'; skipping test(s).\n") diff --git a/test/SCCS/explicit.py b/test/SCCS/explicit.py index 23bb6eb8..0a52acef 100644 --- a/test/SCCS/explicit.py +++ b/test/SCCS/explicit.py @@ -36,8 +36,7 @@ test = TestSCons.TestSCons() sccs = test.where_is('sccs') if not sccs: - print "Could not find SCCS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'sccs'; skipping test(s).\n") diff --git a/test/SCCS/implicit.py b/test/SCCS/implicit.py index 3c3676e1..eca8e0c4 100644 --- a/test/SCCS/implicit.py +++ b/test/SCCS/implicit.py @@ -36,8 +36,7 @@ test = TestSCons.TestSCons() sccs = test.where_is('sccs') if not sccs: - print "Could not find SCCS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'sccs'; skipping test(s).\n") diff --git a/test/SCCS/transparent.py b/test/SCCS/transparent.py index ba614cde..384e27cf 100644 --- a/test/SCCS/transparent.py +++ b/test/SCCS/transparent.py @@ -36,8 +36,7 @@ test = TestSCons.TestSCons() sccs = test.where_is('sccs') if not sccs: - print "Could not find SCCS, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'sccs'; skipping test(s).\n") diff --git a/test/Subversion.py b/test/Subversion.py index 54e9942e..74ff86c0 100644 --- a/test/Subversion.py +++ b/test/Subversion.py @@ -34,13 +34,11 @@ test = TestSCons.TestSCons() svn = test.where_is('svn') if not svn: - print "Could not find Subversion, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'svn'; skipping test(s).\n") svnadmin = test.where_is('svnadmin') if not svn: - print "Could not find Subversion, skipping test(s)." - test.pass_test(1) + test.skip_test("Could not find 'svnadmin'; skipping test(s).\n") print "Short-circuiting this test until we support Subversion" test.pass_test() diff --git a/test/option/debug-count.py b/test/option/debug-count.py index 3cb924b7..3a0fbb03 100644 --- a/test/option/debug-count.py +++ b/test/option/debug-count.py @@ -39,9 +39,8 @@ test = TestSCons.TestSCons() try: import weakref except ImportError: - print "Python version has no `weakref' module;" - print "skipping tests of --debug=count." - test.pass_test() + x = "Python version has no 'weakref' module; skipping tests.\n" + test.skip_test(x) diff --git a/test/option/debug-memory.py b/test/option/debug-memory.py index 2812f502..0a2875f4 100644 --- a/test/option/debug-memory.py +++ b/test/option/debug-memory.py @@ -39,9 +39,8 @@ test = TestSCons.TestSCons() try: import resource except ImportError: - print "Python version has no `resource' module;" - print "skipping test of --debug=memory." - test.pass_test() + x = "Python version has no 'resource' module; skipping tests.\n" + test.skip_test(x) diff --git a/test/option/debug-objects.py b/test/option/debug-objects.py index 324585e2..33ec59de 100644 --- a/test/option/debug-objects.py +++ b/test/option/debug-objects.py @@ -39,9 +39,8 @@ test = TestSCons.TestSCons() try: import weakref except ImportError: - print "Python version has no `weakref' module;" - print "skipping tests of --debug=objects." - test.pass_test() + x = "Python version has no 'weakref' module; skipping tests.\n" + test.skip_test(x)