Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79600 - trunk/tools/build/v2/test
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-19 08:30:49


Author: jurko
Date: 2012-07-19 08:30:48 EDT (Thu, 19 Jul 2012)
New Revision: 79600
URL: http://svn.boost.org/trac/boost/changeset/79600

Log:
Corrected the internal Boost Build library_order.py unit test - updated its test run parameter passing to use lists of strings instead of simple strings (was causing assertion failures with the latest internal Boost Build testing framework implementation), minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/test/library_order.py | 60 ++++++++++++++++++----------------------
   1 files changed, 27 insertions(+), 33 deletions(-)

Modified: trunk/tools/build/v2/test/library_order.py
==============================================================================
--- trunk/tools/build/v2/test/library_order.py (original)
+++ trunk/tools/build/v2/test/library_order.py 2012-07-19 08:30:48 EDT (Thu, 19 Jul 2012)
@@ -4,37 +4,41 @@
 # 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)
 
-# Test that on compilers sensitive to library order on linker's command line, we
-# generate the correct order.
+# Test that on compilers sensitive to library order on linker's command line,
+# we generate the correct order.
 
 import BoostBuild
-import string
 
 
 t = BoostBuild.Tester()
 
-t.write("a.cpp", """
+t.write("main.cpp", """\
+void a();
+int main() { a(); }
+""")
+
+t.write("a.cpp", """\
 void b();
 void a() { b(); }
 """)
 
-t.write("b.cpp", """
+t.write("b.cpp", """\
 void c();
 void b() { c(); }
 """)
 
-t.write("c.cpp", """
+t.write("c.cpp", """\
 void d();
 void c() { d(); }
 """)
 
-t.write("d.cpp", """
+t.write("d.cpp", """\
 void d() {}
 """)
 
-# The order of libraries in 'main' is crafted so that we get error unless we do
-# something about the order ourselves.
-t.write("jamfile.jam", """
+# The order of libraries in 'main' is crafted so that we get an error unless we
+# do something about the order ourselves.
+t.write("jamroot.jam", """\
 exe main : main.cpp libd libc libb liba ;
 lib libd : d.cpp ;
 lib libc : c.cpp : <link>static <use>libd ;
@@ -42,59 +46,49 @@
 lib liba : a.cpp : <use>libb ;
 """)
 
-t.write("main.cpp", """
-void a();
-int main() { a(); }
-""")
-
-t.write("jamroot.jam", """
-""")
-
-t.run_build_system("-d2")
+t.run_build_system(["-d2"])
 t.expect_addition("bin/$toolset/debug/main.exe")
 
 
 # Test the order between searched libraries.
-t.write("jamfile.jam", """
+t.write("jamroot.jam", """\
 exe main : main.cpp png z ;
 lib png : z : <name>png ;
 lib z : : <name>zzz ;
 """)
 
-t.run_build_system("-a -n -d+2")
-t.fail_test(string.find(t.stdout(), "png") > string.find(t.stdout(), "zzz"))
+t.run_build_system(["-a", "-n", "-d+2"])
+t.fail_test(t.stdout().find("png") > t.stdout().find("zzz"))
 
-t.write("jamfile.jam", """
+t.write("jamroot.jam", """\
 exe main : main.cpp png z ;
 lib png : : <name>png ;
 lib z : png : <name>zzz ;
 """)
 
-t.run_build_system("-a -n -d+2")
-t.fail_test(string.find(t.stdout(), "png") < string.find(t.stdout(), "zzz"))
+t.run_build_system(["-a", "-n", "-d+2"])
+t.fail_test(t.stdout().find("png") < t.stdout().find("zzz"))
 
 
 # Test the order between prebuilt libraries.
 t.write("first.a", "")
-
 t.write("second.a", "")
-
-t.write("jamfile.jam", """
+t.write("jamroot.jam", """\
 exe main : main.cpp first second ;
 lib first : second : <file>first.a ;
 lib second : : <file>second.a ;
 """)
 
-t.run_build_system("-a -n -d+2")
-t.fail_test(string.find(t.stdout(), "first") > string.find(t.stdout(), "second"))
+t.run_build_system(["-a", "-n", "-d+2"])
+t.fail_test(t.stdout().find("first") > t.stdout().find("second"))
 
-t.write("jamfile.jam", """
+t.write("jamroot.jam", """
 exe main : main.cpp first second ;
 lib first : : <file>first.a ;
 lib second : first : <file>second.a ;
 """)
 
-t.run_build_system("-a -n -d+2")
-t.fail_test(string.find(t.stdout(), "first") < string.find(t.stdout(), "second"))
+t.run_build_system(["-a", "-n", "-d+2"])
+t.fail_test(t.stdout().find("first") < t.stdout().find("second"))
 
 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