Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79864 - trunk/tools/build/v2/test
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-04 18:13:36


Author: jurko
Date: 2012-08-04 18:13:35 EDT (Sat, 04 Aug 2012)
New Revision: 79864
URL: http://svn.boost.org/trac/boost/changeset/79864

Log:
Internal Boost Build project_root_constants.py test cleanup - minor stylistic changes + better implemented output content tests to display more detailed information on failure.
Text files modified:
   trunk/tools/build/v2/test/project_root_constants.py | 28 ++++++++++++----------------
   1 files changed, 12 insertions(+), 16 deletions(-)

Modified: trunk/tools/build/v2/test/project_root_constants.py
==============================================================================
--- trunk/tools/build/v2/test/project_root_constants.py (original)
+++ trunk/tools/build/v2/test/project_root_constants.py 2012-08-04 18:13:35 EDT (Sat, 04 Aug 2012)
@@ -1,32 +1,32 @@
 #!/usr/bin/python
 
-# Copyright 2003, 2004, 2005 Vladimir Prus
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+# Copyright 2003, 2004, 2005 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 import BoostBuild
-import string
 
 # Create a temporary working directory.
 t = BoostBuild.Tester()
 
 # Create the needed files.
-t.write("jamroot.jam", """
+t.write("jamroot.jam", """\
 constant FOO : foobar gee ;
 ECHO $(FOO) ;
 """)
 
 t.run_build_system()
-t.fail_test(string.find(t.stdout(), "foobar gee") == -1)
+t.expect_output_lines("foobar gee")
 
 # Regression test: when absolute paths were passed to path-constant rule,
 # Boost.Build failed to recognize path as absolute and prepended the current
 # dir.
-t.write("jamroot.jam", """
+t.write("jamroot.jam", """\
 import path ;
 local here = [ path.native [ path.pwd ] ] ;
 path-constant HERE : $(here) ;
-if $(HERE) != $(here)
+if $(HERE) != $(here)
 {
     ECHO "PWD =" $(here) ;
     ECHO "path constant =" $(HERE) ;
@@ -37,7 +37,7 @@
 
 t.run_build_system()
 
-t.write("jamfile.jam", """
+t.write("jamfile.jam", """\
 # This tests that rule 'hello' will be imported to children unlocalized, and
 # will still access variables in this Jamfile.
 x = 10 ;
@@ -45,22 +45,18 @@
 rule hello ( ) { ECHO "Hello $(x)" ; }
 """)
 
-t.write("d/jamfile.jam", """
+t.write("d/jamfile.jam", """\
 ECHO "d: $(FOO)" ;
 constant BAR : bar ;
 """)
 
-t.write("d/d2/jamfile.jam", """
+t.write("d/d2/jamfile.jam", """\
 ECHO "d2: $(FOO)" ;
 ECHO "d2: $(BAR)" ;
 hello ;
 """)
 
 t.run_build_system(subdir="d/d2")
-t.fail_test(t.stdout().find("""d: foo
-d2: foo
-d2: bar
-Hello 10
-""") == -1)
+t.expect_output_lines("d: foo\nd2: foo\nd2: bar\nHello 10")
 
 t.cleanup()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk