|
Boost-Commit : |
From: jurko.gospodnetic_at_[hidden]
Date: 2008-08-31 17:42:41
Author: jurko
Date: 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
New Revision: 48504
URL: http://svn.boost.org/trac/boost/changeset/48504
Log:
Renamed differently named Jamroot and Jamfile files throughout Boost Build's test suite to jamroot.jam & jamfile.jam. Stylistic changes throughout the whole Boost Build test suite.
Added:
trunk/tools/build/v2/test/boostbook/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/boostbook/Jamroot
trunk/tools/build/v2/test/dependency-test/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/dependency-test/Jamfile
trunk/tools/build/v2/test/dependency-test/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/dependency-test/project-root.jam
trunk/tools/build/v2/test/direct-request-test/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/direct-request-test/Jamfile
trunk/tools/build/v2/test/direct-request-test/jamfile2.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/direct-request-test/Jamfile2
trunk/tools/build/v2/test/direct-request-test/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/direct-request-test/project-root.jam
trunk/tools/build/v2/test/generators-test/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/generators-test/Jamfile
trunk/tools/build/v2/test/generators-test/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/generators-test/project-root.jam
trunk/tools/build/v2/test/generators-test/lib/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/generators-test/lib/Jamfile
trunk/tools/build/v2/test/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/Jamfile
trunk/tools/build/v2/test/prebuilt/ext/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/prebuilt/ext/Jamfile
trunk/tools/build/v2/test/prebuilt/ext/jamfile2.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/prebuilt/ext/Jamfile2
trunk/tools/build/v2/test/prebuilt/ext/jamfile3.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/prebuilt/ext/Jamfile3
trunk/tools/build/v2/test/prebuilt/ext/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/prebuilt/ext/project-root.jam
trunk/tools/build/v2/test/prebuilt/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/prebuilt/Jamfile
trunk/tools/build/v2/test/prebuilt/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/prebuilt/project-root.jam
trunk/tools/build/v2/test/project-test1/dir/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test1/dir/Jamfile
trunk/tools/build/v2/test/project-test1/dir2/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test1/dir2/Jamfile
trunk/tools/build/v2/test/project-test1/dir2/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test1/dir2/project-root.jam
trunk/tools/build/v2/test/project-test1/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test1/Jamfile
trunk/tools/build/v2/test/project-test1/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test1/project-root.jam
trunk/tools/build/v2/test/project-test3/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test3/Jamfile
trunk/tools/build/v2/test/project-test3/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test3/project-root.jam
trunk/tools/build/v2/test/project-test3/lib/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test3/lib/Jamfile
trunk/tools/build/v2/test/project-test3/lib2/helper/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test3/lib2/helper/Jamfile
trunk/tools/build/v2/test/project-test3/lib2/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test3/lib2/Jamfile
trunk/tools/build/v2/test/project-test3/lib3/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test3/lib3/Jamfile
trunk/tools/build/v2/test/project-test3/lib3/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test3/lib3/project-root.jam
trunk/tools/build/v2/test/project-test4/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/Jamfile
trunk/tools/build/v2/test/project-test4/jamfile3.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/Jamfile3
trunk/tools/build/v2/test/project-test4/jamfile4.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/Jamfile4
trunk/tools/build/v2/test/project-test4/jamfile5.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/Jamfile5
trunk/tools/build/v2/test/project-test4/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/project-root.jam
trunk/tools/build/v2/test/project-test4/lib/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/lib/Jamfile
trunk/tools/build/v2/test/project-test4/lib/jamfile1.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/lib/Jamfile1
trunk/tools/build/v2/test/project-test4/lib/jamfile2.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/lib/Jamfile2
trunk/tools/build/v2/test/project-test4/lib/jamfile3.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/lib/Jamfile3
trunk/tools/build/v2/test/project-test4/lib2/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/lib2/Jamfile
trunk/tools/build/v2/test/project-test4/lib2/jamfile2.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/project-test4/lib2/Jamfile2
trunk/tools/build/v2/test/qt4/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/qt4/Jamroot
trunk/tools/build/v2/test/railsys/libx/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/railsys/libx/project-root.jam
trunk/tools/build/v2/test/railsys/libx/src/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/railsys/libx/src/Jamfile
trunk/tools/build/v2/test/railsys/program/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/railsys/program/Jamfile
trunk/tools/build/v2/test/railsys/program/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/railsys/program/project-root.jam
trunk/tools/build/v2/test/railsys/program/liba/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/railsys/program/liba/Jamfile
trunk/tools/build/v2/test/railsys/program/main/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/railsys/program/main/Jamfile
trunk/tools/build/v2/test/test2/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/test2/Jamfile
trunk/tools/build/v2/test/unused/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/unused/Jamfile
trunk/tools/build/v2/test/unused/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/unused/project-root.jam
trunk/tools/build/v2/test/v1-testing/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/v1-testing/Jamfile
trunk/tools/build/v2/test/v1_testing/jamfile.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/v1_testing/Jamfile
trunk/tools/build/v2/test/v1_testing/jamroot.jam (props changed)
- copied unchanged from r48491, /trunk/tools/build/v2/test/v1_testing/project-root.jam
Removed:
trunk/tools/build/v2/test/Jamfile
trunk/tools/build/v2/test/boostbook/Jamroot
trunk/tools/build/v2/test/dependency-test/Jamfile
trunk/tools/build/v2/test/dependency-test/project-root.jam
trunk/tools/build/v2/test/direct-request-test/Jamfile
trunk/tools/build/v2/test/direct-request-test/Jamfile2
trunk/tools/build/v2/test/direct-request-test/project-root.jam
trunk/tools/build/v2/test/generators-test/Jamfile
trunk/tools/build/v2/test/generators-test/lib/Jamfile
trunk/tools/build/v2/test/generators-test/project-root.jam
trunk/tools/build/v2/test/prebuilt/Jamfile
trunk/tools/build/v2/test/prebuilt/ext/Jamfile
trunk/tools/build/v2/test/prebuilt/ext/Jamfile2
trunk/tools/build/v2/test/prebuilt/ext/Jamfile3
trunk/tools/build/v2/test/prebuilt/ext/project-root.jam
trunk/tools/build/v2/test/prebuilt/project-root.jam
trunk/tools/build/v2/test/project-test1/Jamfile
trunk/tools/build/v2/test/project-test1/dir/Jamfile
trunk/tools/build/v2/test/project-test1/dir2/Jamfile
trunk/tools/build/v2/test/project-test1/dir2/project-root.jam
trunk/tools/build/v2/test/project-test1/project-root.jam
trunk/tools/build/v2/test/project-test3/Jamfile
trunk/tools/build/v2/test/project-test3/lib/Jamfile
trunk/tools/build/v2/test/project-test3/lib2/Jamfile
trunk/tools/build/v2/test/project-test3/lib2/helper/Jamfile
trunk/tools/build/v2/test/project-test3/lib3/Jamfile
trunk/tools/build/v2/test/project-test3/lib3/project-root.jam
trunk/tools/build/v2/test/project-test3/project-root.jam
trunk/tools/build/v2/test/project-test4/Jamfile
trunk/tools/build/v2/test/project-test4/Jamfile3
trunk/tools/build/v2/test/project-test4/Jamfile4
trunk/tools/build/v2/test/project-test4/Jamfile5
trunk/tools/build/v2/test/project-test4/lib/Jamfile
trunk/tools/build/v2/test/project-test4/lib/Jamfile1
trunk/tools/build/v2/test/project-test4/lib/Jamfile2
trunk/tools/build/v2/test/project-test4/lib/Jamfile3
trunk/tools/build/v2/test/project-test4/lib2/Jamfile
trunk/tools/build/v2/test/project-test4/lib2/Jamfile2
trunk/tools/build/v2/test/project-test4/project-root.jam
trunk/tools/build/v2/test/qt4/Jamroot
trunk/tools/build/v2/test/railsys/libx/project-root.jam
trunk/tools/build/v2/test/railsys/libx/src/Jamfile
trunk/tools/build/v2/test/railsys/program/Jamfile
trunk/tools/build/v2/test/railsys/program/liba/Jamfile
trunk/tools/build/v2/test/railsys/program/main/Jamfile
trunk/tools/build/v2/test/railsys/program/project-root.jam
trunk/tools/build/v2/test/test2/Jamfile
trunk/tools/build/v2/test/unused/Jamfile
trunk/tools/build/v2/test/unused/project-root.jam
trunk/tools/build/v2/test/v1-testing/Jamfile
trunk/tools/build/v2/test/v1_testing/Jamfile
trunk/tools/build/v2/test/v1_testing/project-root.jam
Text files modified:
trunk/tools/build/v2/test/abs_workdir.py | 10
trunk/tools/build/v2/test/absolute_sources.py | 64 +++++----
trunk/tools/build/v2/test/alias.py | 21 +-
trunk/tools/build/v2/test/alternatives.py | 79 +++++------
trunk/tools/build/v2/test/bad_dirname.py | 19 +-
trunk/tools/build/v2/test/boostbook.py | 12
trunk/tools/build/v2/test/build_dir.py | 90 ++++++-------
trunk/tools/build/v2/test/build_file.py | 40 ++--
trunk/tools/build/v2/test/build_no.py | 27 +--
trunk/tools/build/v2/test/c_file.py | 22 +-
trunk/tools/build/v2/test/chain.py | 40 ++---
trunk/tools/build/v2/test/clean.py | 2
trunk/tools/build/v2/test/composite.py | 18 +-
trunk/tools/build/v2/test/conditionals.py | 6
trunk/tools/build/v2/test/conditionals2.py | 8
trunk/tools/build/v2/test/conditionals3.py | 8
trunk/tools/build/v2/test/conditionals_multiple.py | 7
trunk/tools/build/v2/test/configuration.py | 5
trunk/tools/build/v2/test/core_d12.py | 15 -
trunk/tools/build/v2/test/core_delete_module.py | 12
trunk/tools/build/v2/test/core_dependencies.py | 73 +++++-----
trunk/tools/build/v2/test/core_import_module.py | 29 ++--
trunk/tools/build/v2/test/core_modifiers.py | 27 +--
trunk/tools/build/v2/test/core_varnames.py | 9
trunk/tools/build/v2/test/custom_generator.py | 28 +--
trunk/tools/build/v2/test/default_build.py | 60 ++++----
trunk/tools/build/v2/test/default_features.py | 34 ++--
trunk/tools/build/v2/test/default_toolset.py | 6
trunk/tools/build/v2/test/dependency_property.py | 28 +--
trunk/tools/build/v2/test/dependency_test.py | 53 +++----
trunk/tools/build/v2/test/direct_request_test.py | 44 ++---
trunk/tools/build/v2/test/disambiguation.py | 33 ++--
trunk/tools/build/v2/test/dll_path.py | 91 ++++++-------
trunk/tools/build/v2/test/double_loading.py | 19 +-
trunk/tools/build/v2/test/duplicate.py | 37 ++---
trunk/tools/build/v2/test/example_customization.py | 18 +-
trunk/tools/build/v2/test/example_gettext.py | 17 +-
trunk/tools/build/v2/test/example_libraries.py | 17 +-
trunk/tools/build/v2/test/example_make.py | 10
trunk/tools/build/v2/test/example_qt4.py | 6
trunk/tools/build/v2/test/expansion.py | 57 +++-----
trunk/tools/build/v2/test/explicit.py | 38 ++---
trunk/tools/build/v2/test/file_name_handling.py | 3
trunk/tools/build/v2/test/free_features_request.py | 29 +--
trunk/tools/build/v2/test/gcc_runtime.py | 24 +-
trunk/tools/build/v2/test/generators_test.py | 1
trunk/tools/build/v2/test/implicit_dependency.py | 30 +--
trunk/tools/build/v2/test/indirect_conditional.py | 34 ++--
trunk/tools/build/v2/test/inherit_toolset.py | 67 +++------
trunk/tools/build/v2/test/inherited_dependency.py | 152 +++++++++++-----------
trunk/tools/build/v2/test/inline.py | 42 ++---
trunk/tools/build/v2/test/lib_source_property.py | 32 ++--
trunk/tools/build/v2/test/library_chain.py | 103 +++++++-------
trunk/tools/build/v2/test/library_order.py | 80 ++++-------
trunk/tools/build/v2/test/library_property.py | 42 ++---
trunk/tools/build/v2/test/load_dir.py | 29 +--
trunk/tools/build/v2/test/load_order.py | 55 +++----
trunk/tools/build/v2/test/loop.py | 25 +-
trunk/tools/build/v2/test/m1-01.py | 28 +--
trunk/tools/build/v2/test/m1-02.py | 44 +++---
trunk/tools/build/v2/test/m1-03.py | 20 +-
trunk/tools/build/v2/test/make_rule.py | 48 +++---
trunk/tools/build/v2/test/module_actions.py | 2
trunk/tools/build/v2/test/ndebug.py | 39 ++---
trunk/tools/build/v2/test/no_type.py | 15 +-
trunk/tools/build/v2/test/notfile.py | 24 +--
trunk/tools/build/v2/test/ordered_include.py | 16 +-
trunk/tools/build/v2/test/ordered_properties.py | 36 +---
trunk/tools/build/v2/test/out_of_tree.py | 43 ++---
trunk/tools/build/v2/test/path_features.py | 40 +++--
trunk/tools/build/v2/test/pch.py | 63 +++-----
trunk/tools/build/v2/test/prebuilt.py | 40 ++--
trunk/tools/build/v2/test/print.py | 13 +
trunk/tools/build/v2/test/project_dependencies.py | 44 +++---
trunk/tools/build/v2/test/project_glob.py | 123 +++++++----------
trunk/tools/build/v2/test/project_root_constants.py | 34 ++--
trunk/tools/build/v2/test/project_root_rule.py | 38 ++---
trunk/tools/build/v2/test/project_test1.py | 17 +-
trunk/tools/build/v2/test/project_test3.py | 38 ++---
trunk/tools/build/v2/test/project_test4.py | 31 ++--
trunk/tools/build/v2/test/property_expansion.py | 19 +-
trunk/tools/build/v2/test/qt4.py | 17 +-
trunk/tools/build/v2/test/railsys.py | 10
trunk/tools/build/v2/test/rebuilds.py | 8
trunk/tools/build/v2/test/regression.py | 64 ++++-----
trunk/tools/build/v2/test/relative_sources.py | 19 +-
trunk/tools/build/v2/test/remove_requirement.py | 90 ++++--------
trunk/tools/build/v2/test/resolution.py | 33 ++--
trunk/tools/build/v2/test/searched_lib.py | 105 ++++++++-------
trunk/tools/build/v2/test/skipping.py | 46 +++---
trunk/tools/build/v2/test/sort_rule.py | 6
trunk/tools/build/v2/test/source_locations.py | 37 +---
trunk/tools/build/v2/test/stage.py | 155 ++++++++++++----------
trunk/tools/build/v2/test/standalone.py | 34 ++--
trunk/tools/build/v2/test/startup_v1.py | 84 ++++-------
trunk/tools/build/v2/test/startup_v2.py | 28 +--
trunk/tools/build/v2/test/suffix.py | 37 ++--
trunk/tools/build/v2/test/svn_tree.py | 14 -
trunk/tools/build/v2/test/symlink.py | 41 +++--
trunk/tools/build/v2/test/tag.py | 22 +-
trunk/tools/build/v2/test/template.py | 49 +++---
trunk/tools/build/v2/test/test1.py | 5
trunk/tools/build/v2/test/test2.py | 23 +-
trunk/tools/build/v2/test/test_all.py | 45 +++---
trunk/tools/build/v2/test/test_system.html | 19 +-
trunk/tools/build/v2/test/testing_primitives.py | 19 -
trunk/tools/build/v2/test/timedata.py | 1
trunk/tools/build/v2/test/tree.py | 18 +-
trunk/tools/build/v2/test/unit_test.py | 5
trunk/tools/build/v2/test/unit_tests.py | 5
trunk/tools/build/v2/test/unused.py | 19 +-
trunk/tools/build/v2/test/use_requirements.py | 270 +++++++++++++++------------------------
trunk/tools/build/v2/test/using.py | 36 +---
trunk/tools/build/v2/test/v1_testing.py | 30 ++--
trunk/tools/build/v2/test/wrapper.py | 38 ++---
trunk/tools/build/v2/test/wrong_project.py | 29 +--
116 files changed, 1908 insertions(+), 2355 deletions(-)
Deleted: trunk/tools/build/v2/test/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,11 +0,0 @@
-# Copyright 2001 Dave Abrahams
-# 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)
-
-
-# establish a project root right here in the test directory, so that we can test
-# things independently of the boost jambase, etc.
-project-root ;
-
-include check-test-tools.jam ;
-include check-jam-patches.jam ;
Modified: trunk/tools/build/v2/test/abs_workdir.py
==============================================================================
--- trunk/tools/build/v2/test/abs_workdir.py (original)
+++ trunk/tools/build/v2/test/abs_workdir.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,6 +1,6 @@
# Niklaus Giger, 2005-03-15
-# Testing whether we may run a test in a absolute directories
-# There are no tests for temporary directories as this is implictly tested in a lot of other cases
+# Testing whether we may run a test in absolute directories. There are no tests
+# for temporary directories as this is implictly tested in a lot of other cases.
import BoostBuild
import os
@@ -9,10 +9,10 @@
t = BoostBuild.Tester(arguments="pwd", executable="jam", workdir=os.getcwd(),
pass_toolset=0)
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
actions print_pwd { pwd ; }
print_pwd pwd ;
-Always pwd ;
+ALWAYS pwd ;
""")
t.run_build_system(status=0)
@@ -30,5 +30,5 @@
t.run_build_system(status=1, subdir="/must/fail/with/absolute/path",
stderr=None)
-t.cleanup
+t.cleanup()
Modified: trunk/tools/build/v2/test/absolute_sources.py
==============================================================================
--- trunk/tools/build/v2/test/absolute_sources.py (original)
+++ trunk/tools/build/v2/test/absolute_sources.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,72 +1,76 @@
#!/usr/bin/python
-# Copyright 2003, 2004 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 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)
# Test that sources with absolute names are handled OK.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", """
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
path-constant TOP : . ;
""")
-t.write("Jamfile", """
+
+t.write("jamfile.jam", """
local pwd = [ PWD ] ;
ECHO $(pwd) XXXXX ;
exe hello : $(pwd)/hello.cpp $(TOP)/empty.cpp ;
""")
-t.write("hello.cpp", "int main() { return 0; }\n")
+
+t.write("hello.cpp", "int main() {}\n")
+
t.write("empty.cpp", "\n")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
-# Test a contrived case. There, absolute name is used in
-# standalone project (not Jamfile). Moreover, the target with
-# absolute name is returned by 'alias' and used from other project.
-t.write("a.cpp", """
-int main()
-{
- return 0;
-}
-
+# Test a contrived case. There, absolute name is used in a standalone project
+# (not Jamfile). Moreover, the target with an absolute name is returned by
+# 'alias' and used from another project.
+t.write("a.cpp", """
+int main() {}
""")
-t.write("Jamfile", """
-exe a : /standalone//a ;
+t.write("jamfile.jam", """
+exe a : /standalone//a ;
""")
-t.write("project-root.jam", """
-import standalone ;
+t.write("jamroot.jam", """
+import standalone ;
""")
-t.write("standalone.jam", """
+t.write("standalone.jam", """
import project ;
project.initialize $(__name__) ;
project standalone ;
local pwd = [ PWD ] ;
-
alias a : $(pwd)/a.cpp ;
-
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
-# Test absolute path in target ids
+# Test absolute path in target ids.
t.rm(".")
-t.write("d1/project-root.jam", "")
-t.write("d1/Jamfile", """
+
+t.write("d1/jamroot.jam", "")
+
+t.write("d1/jamfile.jam", """
exe a : a.cpp ;
""")
+
t.write("d1/a.cpp", """
-int main() { return 0; }
+int main() {}
""")
-t.write("d2/project-root.jam", "")
-t.write("d2/Jamfile", """
+
+t.write("d2/jamroot.jam", "")
+
+t.write("d2/jamfile.jam", """
local pwd = [ PWD ] ;
alias x : $(pwd)/../d1//a ;
""")
Modified: trunk/tools/build/v2/test/alias.py
==============================================================================
--- trunk/tools/build/v2/test/alias.py (original)
+++ trunk/tools/build/v2/test/alias.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,7 +5,7 @@
# 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)
-from BoostBuild import Tester, List
+import BoostBuild
################################################################################
@@ -19,7 +19,7 @@
"""Basic alias rule test.
"""
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe a : a.cpp ;
exe b : b.cpp ;
exe c : c.cpp ;
@@ -31,7 +31,7 @@
exe hello : hello.cpp src ;
""")
- t.write("a.cpp", "int main() { return 0; }\n")
+ t.write("a.cpp", "int main() {}\n")
t.copy("a.cpp", "b.cpp")
t.copy("a.cpp", "c.cpp")
t.copy("a.cpp", "hello.cpp")
@@ -39,19 +39,20 @@
# Check that targets to which "bin1" refers are updated, and only those.
t.run_build_system("bin1")
- t.expect_addition(List("bin/$toolset/debug/") * "a.exe a.obj")
+ t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "a.exe a.obj")
t.expect_nothing_more()
# Try again with "bin2"
t.run_build_system("bin2")
- t.expect_addition(List("bin/$toolset/debug/") * "b.exe b.obj")
+ t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "b.exe b.obj")
t.expect_nothing_more()
# Try building everything, making sure 'hello' target is created.
t.run_build_system()
- t.expect_addition(List("bin/$toolset/debug/") * "hello.exe hello.obj")
+ t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * \
+ "hello.exe hello.obj")
t.expect_addition("bin/$toolset/debug/s.obj")
- t.expect_addition(List("bin/$toolset/debug/") * "c.exe c.obj")
+ t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "c.exe c.obj")
t.expect_nothing_more()
@@ -68,7 +69,7 @@
anywhere in the source.
"""
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
lib l : l.cpp : : : <define>WANT_MAIN ;
alias la : l ;
exe main : main.cpp la ;
@@ -84,7 +85,7 @@
t.write("main.cpp", """
#ifdef WANT_MAIN
-int main() { return 0; }
+int main() {}
#endif
""")
@@ -98,7 +99,7 @@
#
################################################################################
-t = Tester()
+t = BoostBuild.Tester()
test_alias_rule(t)
test_alias_source_usage_requirements(t)
Modified: trunk/tools/build/v2/test/alternatives.py
==============================================================================
--- trunk/tools/build/v2/test/alternatives.py (original)
+++ trunk/tools/build/v2/test/alternatives.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,42 +1,44 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2003, 2006 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 Dave Abrahams
+# Copyright 2003, 2006 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)
# Test main target alternatives.
-from BoostBuild import Tester
-from string import find
-t = Tester()
+import BoostBuild
+import string
+t = BoostBuild.Tester()
# Test that basic alternatives selection works.
-t.write("project-root.jam", " ")
-t.write("Jamfile", """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
exe a : a_empty.cpp ;
exe a : a.cpp : <variant>release ;
""")
+
t.write("a_empty.cpp", "")
-t.write("a.cpp", "int main() { return 0; }\n")
+
+t.write("a.cpp", "int main() {}\n")
t.run_build_system("release")
+
t.expect_addition("bin/$toolset/release/a.exe")
-# Test that alternative selection works for ordinary
-# properties, in particular user-defined.
-t.write("project-root.jam", " ")
-t.write("Jamfile", """
+# Test that alternative selection works for ordinary properties, in particular
+# user-defined.
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
import feature ;
feature.feature X : off on : propagated ;
-
exe a : b.cpp ;
exe a : a.cpp : <X>on ;
""")
-t.write("b.cpp", "int main() { return 0; }\n")
+t.write("b.cpp", "int main() {}\n")
t.rm("bin")
@@ -48,11 +50,8 @@
t.rm("bin")
-# Test that everything works ok even with default
-# build.
-
-t.write("Jamfile", """
-
+# Test that everything works ok even with default build.
+t.write("jamfile.jam", """
exe a : a_empty.cpp : <variant>release ;
exe a : a.cpp : <variant>debug ;
""")
@@ -60,12 +59,10 @@
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
-# Test that only properties which are in build request
-# matters when selection alternative. IOW, alternative
-# with <variant>release is better than one with
+# Test that only properties which are in build request matter for alternative
+# selection. IOW, alternative with <variant>release is better than one with
# <variant>debug when building release version.
-t.write("Jamfile", """
-
+t.write("jamfile.jam", """
exe a : a_empty.cpp : <variant>debug ;
exe a : a.cpp : <variant>release ;
""")
@@ -73,10 +70,9 @@
t.run_build_system("release")
t.expect_addition("bin/$toolset/release/a.exe")
-# Test that free properties do not matter. We really don't
-# want <cxxflags> property in build request to affect
-# alternative selection.
-t.write("Jamfile", """
+# Test that free properties do not matter. We really do not want <cxxflags>
+# property in build request to affect alternative selection.
+t.write("jamfile.jam", """
exe a : a_empty.cpp : <variant>debug <define>FOO <include>BAR ;
exe a : a.cpp : <variant>release ;
""")
@@ -85,28 +81,26 @@
t.run_build_system("release define=FOO")
t.expect_addition("bin/$toolset/release/a.exe")
-# Test that abibuity is reported correctly
-t.write("Jamfile", """
+# Test that ambiguity is reported correctly.
+t.write("jamfile.jam", """
exe a : a_empty.cpp ;
exe a : a.cpp ;
""")
t.run_build_system("--no-error-backtrace", status=None)
-t.fail_test(find(t.stdout(), "No best alternative") == -1)
+t.fail_test(string.find(t.stdout(), "No best alternative") == -1)
-# Another ambiguity test: two matches properties in one alternative are
-# neither better nor worse than a single one in another alternative.
-t.write("Jamfile", """
+# Another ambiguity test: two matches properties in one alternative are neither
+# better nor worse than a single one in another alternative.
+t.write("jamfile.jam", """
exe a : a_empty.cpp : <optimization>off <profiling>off ;
exe a : a.cpp : <debug-symbols>on ;
""")
t.run_build_system("--no-error-backtrace", status=None)
-t.fail_test(find(t.stdout(), "No best alternative") == -1)
-
-
+t.fail_test(string.find(t.stdout(), "No best alternative") == -1)
-# Test that we can have alternative without sources
-t.write("Jamfile", """
+# Test that we can have alternative without sources.
+t.write("jamfile.jam", """
alias specific-sources ;
import feature ;
feature.extend os : MAGIC ;
@@ -116,5 +110,4 @@
t.rm("bin")
t.run_build_system()
-
-t.cleanup()
+t.cleanup()
Modified: trunk/tools/build/v2/test/bad_dirname.py
==============================================================================
--- trunk/tools/build/v2/test/bad_dirname.py (original)
+++ trunk/tools/build/v2/test/bad_dirname.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,23 +1,22 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-# Regression test: when directory of project root contained regex metacharacters,
-# Boost.Build failed to work. Bug reported by Michael Stevens
+# Regression test: when directory of project root contained regex
+# metacharacters, Boost.Build failed to work. Bug reported by Michael Stevens.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("bad[abc]dirname/Jamfile", """
+t.write("bad[abc]dirname/jamfile.jam", """
""")
-t.write("bad[abc]dirname/project-root.jam", """
+t.write("bad[abc]dirname/jamroot.jam", """
""")
t.run_build_system(subdir="bad[abc]dirname")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/boostbook.py
==============================================================================
--- trunk/tools/build/v2/test/boostbook.py (original)
+++ trunk/tools/build/v2/test/boostbook.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,16 +1,16 @@
#!/usr/bin/python
-# Copyright 2004, 2006 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 2004, 2006 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)
-from BoostBuild import Tester, List
+import BoostBuild
import string
-# Create a temporary working directory
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("boostbook")
+
# For some reason, the messages are sent to stderr.
t.run_build_system()
t.fail_test(string.find(t.stdout(), """Writing boost/A.html for refentry(boost.A)
Deleted: trunk/tools/build/v2/test/boostbook/Jamroot
==============================================================================
--- trunk/tools/build/v2/test/boostbook/Jamroot 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,3 +0,0 @@
-
-boostbook docs : docs.xml autodoc ;
-doxygen autodoc : [ glob *.hpp ] ;
Modified: trunk/tools/build/v2/test/build_dir.py
==============================================================================
--- trunk/tools/build/v2/test/build_dir.py (original)
+++ trunk/tools/build/v2/test/build_dir.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,55 +1,52 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 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 Dave Abrahams
+# Copyright 2002, 2003, 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)
-# Test that we can change build directory using
-# the 'build-dir' project attribute.
+# Test that we can change build directory using the 'build-dir' project
+# attribute.
-from BoostBuild import Tester
+import BoostBuild
import string
import os
-t = Tester()
+t = BoostBuild.Tester()
-# Test that top-level project can affect build dir
-t.write("project-root.jam", "import gcc ; ")
-t.write("Jamfile", """
-project
- : build-dir build
- ;
-
+# Test that top-level project can affect build dir.
+t.write("jamroot.jam", "import gcc ;")
+t.write("jamfile.jam", """
+project : build-dir build ;
exe a : a.cpp ;
-build-project src ;
+build-project src ;
""")
-t.write("a.cpp", "int main() { return 0; }\n")
-t.write("src/Jamfile", "exe b : b.cpp ; ")
-t.write("src/b.cpp", "int main() { return 0; }\n")
+t.write("a.cpp", "int main() {}\n")
+
+t.write("src/jamfile.jam", "exe b : b.cpp ; ")
+
+t.write("src/b.cpp", "int main() {}\n")
t.run_build_system()
t.expect_addition(["build/$toolset/debug/a.exe",
"build/src/$toolset/debug/b.exe"])
-
-# Test that building from child projects work
+
+# Test that building from child projects work.
t.run_build_system(subdir='src')
-t.expect_nothing_more()
-
-# Test that project can override build dir
-t.write("Jamfile", """
+t.expect_nothing_more()
+
+# Test that project can override build dir.
+t.write("jamfile.jam", """
exe a : a.cpp ;
build-project src ;
-""")
+""")
-t.write("src/Jamfile", """
-project
- : build-dir build
- ;
-exe b : b.cpp ;
+t.write("src/jamfile.jam", """
+project : build-dir build ;
+exe b : b.cpp ;
""")
t.run_build_system()
@@ -58,46 +55,44 @@
# Now test the '--build-dir' option.
t.rm(".")
-t.write("Jamroot", "")
+t.write("jamroot.jam", "")
# Test that we get an error when no project id is specified.
t.run_build_system("--build-dir=foo")
t.fail_test(string.find(t.stdout(),
"warning: the --build-dir option will be ignored") == -1)
-t.write("Jamroot", """
+t.write("jamroot.jam", """
project foo ;
exe a : a.cpp ;
build-project sub ;
""")
-t.write("a.cpp", "int main() { return 0; }\n")
-t.write("sub/Jamfile", "exe b : b.cpp ;\n")
-t.write("sub/b.cpp", "int main() { return 0; }\n")
+t.write("a.cpp", "int main() {}\n")
+t.write("sub/jamfile.jam", "exe b : b.cpp ;\n")
+t.write("sub/b.cpp", "int main() {}\n")
t.run_build_system("--build-dir=build")
t.expect_addition(["build/foo/$toolset/debug/a.exe",
"build/foo/sub/$toolset/debug/b.exe"])
-t.write("Jamroot", """
+t.write("jamroot.jam", """
project foo : build-dir bin.v2 ;
exe a : a.cpp ;
build-project sub ;
""")
t.run_build_system("--build-dir=build")
-t.expect_addition(["build/foo/bin.v2/$toolset/debug/a.exe",
+t.expect_addition(["build/foo/bin.v2/$toolset/debug/a.exe",
"build/foo/bin.v2/sub/$toolset/debug/b.exe"])
-# Try building in subdir. We expect that the entire build
-# tree with be in 'sub/build'. Today, I'm not sure if
-# this is what the user expects, but let it be.
+# Try building in subdir. We expect that the entire build tree with be in
+# 'sub/build'. Today, I am not sure if this is what the user expects, but let it
+# be.
t.rm('build')
t.run_build_system("--build-dir=build", subdir="sub")
t.expect_addition(["sub/build/foo/bin.v2/sub/$toolset/debug/b.exe"])
-
-
-t.write("Jamroot", """
+t.write("jamroot.jam", """
project foo : build-dir %s ;
exe a : a.cpp ;
build-project sub ;
@@ -105,9 +100,6 @@
t.run_build_system("--build-dir=build", status=1)
t.fail_test(string.find(t.stdout(),
- "Absolute directory specified via 'build-dir' project attribute") == -1)
-
-
-
+ "Absolute directory specified via 'build-dir' project attribute") == -1)
-t.cleanup()
+t.cleanup()
Modified: trunk/tools/build/v2/test/build_file.py
==============================================================================
--- trunk/tools/build/v2/test/build_file.py (original)
+++ trunk/tools/build/v2/test/build_file.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -22,18 +22,18 @@
def test_building_file_from_specific_project():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
build-project sub ;
""")
- t.write("hello.cpp", "int main() { return 0; }")
- t.write("sub/Jamfile.jam", """
+ t.write("hello.cpp", "int main() {}")
+ t.write("sub/jamfile.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
exe sub : hello.cpp ;
""")
- t.write("sub/hello.cpp", "int main() { return 0; }")
+ t.write("sub/hello.cpp", "int main() {}")
t.run_build_system("sub " + t.adjust_suffix("hello.obj"))
t.expect_output_line("*depends on itself*", False)
@@ -53,14 +53,14 @@
def test_building_file_from_specific_target():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello1 : hello1.cpp ;
exe hello2 : hello2.cpp ;
exe hello3 : hello3.cpp ;
""")
- t.write("hello1.cpp", "int main() { return 0; }")
- t.write("hello2.cpp", "int main() { return 0; }")
- t.write("hello3.cpp", "int main() { return 0; }")
+ t.write("hello1.cpp", "int main() {}")
+ t.write("hello2.cpp", "int main() {}")
+ t.write("hello3.cpp", "int main() {}")
t.run_build_system("hello1 " + t.adjust_suffix("hello1.obj"))
t.expect_addition("bin/$toolset/debug/hello1.obj")
@@ -79,14 +79,14 @@
def test_building_missing_file_from_specific_target():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello1 : hello1.cpp ;
exe hello2 : hello2.cpp ;
exe hello3 : hello3.cpp ;
""")
- t.write("hello1.cpp", "int main() { return 0; }")
- t.write("hello2.cpp", "int main() { return 0; }")
- t.write("hello3.cpp", "int main() { return 0; }")
+ t.write("hello1.cpp", "int main() {}")
+ t.write("hello2.cpp", "int main() {}")
+ t.write("hello3.cpp", "int main() {}")
t.run_build_system("hello1 " + t.adjust_suffix("hello2.obj"), status=1)
t.expect_output_line("don't know how to make*" + t.adjust_suffix("hello2.obj"))
@@ -105,14 +105,14 @@
def test_building_multiple_files_with_different_names():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello1 : hello1.cpp ;
exe hello2 : hello2.cpp ;
exe hello3 : hello3.cpp ;
""")
- t.write("hello1.cpp", "int main() { return 0; }")
- t.write("hello2.cpp", "int main() { return 0; }")
- t.write("hello3.cpp", "int main() { return 0; }")
+ t.write("hello1.cpp", "int main() {}")
+ t.write("hello2.cpp", "int main() {}")
+ t.write("hello3.cpp", "int main() {}")
t.run_build_system(
t.adjust_suffix("hello1.obj") + " " +
@@ -134,18 +134,18 @@
def test_building_multiple_files_with_the_same_name():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
build-project sub ;
""")
- t.write("hello.cpp", "int main() { return 0; }")
- t.write("sub/Jamfile.jam", """
+ t.write("hello.cpp", "int main() {}")
+ t.write("sub/jamfile.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
exe sub : hello.cpp ;
""")
- t.write("sub/hello.cpp", "int main() { return 0; }")
+ t.write("sub/hello.cpp", "int main() {}")
t.run_build_system(t.adjust_suffix("hello.obj"))
t.expect_output_line("*depends on itself*", False)
Modified: trunk/tools/build/v2/test/build_no.py
==============================================================================
--- trunk/tools/build/v2/test/build_no.py (original)
+++ trunk/tools/build/v2/test/build_no.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,28 +1,22 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Tests that <build>no property prevents a target from being built.
-from BoostBuild import Tester, List
-import string
+# Tests that <build>no property prevents a target from being built.
+import BoostBuild
-# Create a temporary working directory
-t = Tester()
+t = BoostBuild.Tester()
-# Create the needed files
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe hello : hello.cpp : <variant>debug:<build>no ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() {}
""")
t.run_build_system()
@@ -31,5 +25,4 @@
t.run_build_system("release")
t.expect_addition("bin/$toolset/release/hello.exe")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/c_file.py
==============================================================================
--- trunk/tools/build/v2/test/c_file.py (original)
+++ trunk/tools/build/v2/test/c_file.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,26 +1,27 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-# Test that C files are compiled by C compiler
-from BoostBuild import Tester, List
+# Test that C files are compiled by a C compiler.
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "")
-t.write("Jamfile", """
-project ;
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
+project ;
exe hello : hello.cpp a.c ;
""")
+
t.write("hello.cpp", """
extern "C" int foo();
int main() { return foo(); }
""")
+
t.write("a.c", """
-// This won't compile unless in C mode
+// This will not compile unless in C mode.
int foo()
{
int new = 0;
@@ -28,6 +29,7 @@
return new;
}
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
Modified: trunk/tools/build/v2/test/chain.py
==============================================================================
--- trunk/tools/build/v2/test/chain.py (original)
+++ trunk/tools/build/v2/test/chain.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,38 +5,33 @@
# 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)
-# This tests that
-# 1) the 'make' correctly assigns types to produced targets
-# 2) than if 'make' create targets of type CPP, they are
-# correctly used (there was a bug with it).
-
-from BoostBuild import Tester
-t = Tester()
-
-# In order to correctly link this app, 'b.cpp', created by 'make'
-# rule, should be compiled.
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", r'''
-rule create ( dst : src * : properties * )
-{
- # hack to echo a space under NT
- setup on $(dst) = "set x=int main(){ return 0; }" ;
-}
+# This tests that :
+# 1) the 'make' correctly assigns types to produced targets
+# 2) if 'make' creates targets of type CPP, they are correctly used.
+
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+# In order to correctly link this app, 'b.cpp', created by a 'make' rule, should
+# be compiled.
+t.write("jamroot.jam", "import gcc ;")
+
+t.write("jamfile.jam", r'''
import modules ;
if [ modules.peek : NT ]
{
actions create
{
- $(setup)
- echo %x% > $(<)
+ echo int main() {} > $(<)
}
}
else
{
actions create
{
- echo "int main(){ return 0; }" > $(<)
+ echo "int main() {}" > $(<)
}
}
@@ -44,13 +39,14 @@
exe a : l dummy.cpp ;
-# needs to be static lib for Windows - main cannot appear in DLL
+# Needs to be static lib for Windows - main() cannot appear in DLL.
static-lib l : a.cpp b.cpp ;
make b.cpp : : create ;
-
''')
+
t.write("a.cpp", "")
+
t.write("dummy.cpp", "// msvc needs at least one object file\n")
t.run_build_system()
Modified: trunk/tools/build/v2/test/clean.py
==============================================================================
--- trunk/tools/build/v2/test/clean.py (original)
+++ trunk/tools/build/v2/test/clean.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -58,7 +58,6 @@
void sub3() {}
""")
-
# The 'clean' should not remove files under separate jamroot.jam.
t.run_build_system()
t.run_build_system("--clean")
@@ -114,5 +113,4 @@
t.run_build_system("--clean")
t.expect_nothing("a.h")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/composite.py
==============================================================================
--- trunk/tools/build/v2/test/composite.py (original)
+++ trunk/tools/build/v2/test/composite.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,26 +4,22 @@
# 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 composite properties are handled correctly.
-from BoostBuild import Tester, List
+# Test that composite properties are handled correctly.
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
exe hello : hello.cpp : <variant>release ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() {}
""")
t.run_build_system()
t.expect_addition("bin/$toolset/release/hello.exe")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/conditionals.py
==============================================================================
--- trunk/tools/build/v2/test/conditionals.py (original)
+++ trunk/tools/build/v2/test/conditionals.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -20,13 +20,13 @@
""")
# Test conditionals in target requirements.
-t.write("Jamroot.jam", "exe a : a.cpp : <link>static:<define>STATIC ;")
+t.write("jamroot.jam", "exe a : a.cpp : <link>static:<define>STATIC ;")
t.run_build_system("link=static")
t.expect_addition("bin/$toolset/debug/link-static/a.exe")
t.rm("bin")
# Test conditionals in project requirements.
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
project : requirements <link>static:<define>STATIC ;
exe a : a.cpp ;
""")
@@ -36,7 +36,7 @@
# Regression test for a bug found by Ali Azarbayejani. Conditionals inside usage
# requirement were not being evaluated.
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
lib l : l.cpp : : : <link>static:<define>STATIC ;
exe a : a.cpp l ;
""")
Modified: trunk/tools/build/v2/test/conditionals2.py
==============================================================================
--- trunk/tools/build/v2/test/conditionals2.py (original)
+++ trunk/tools/build/v2/test/conditionals2.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,9 +4,9 @@
# 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)
-# Regression test: it was possible that due to evaluation of conditional
-# requirements, two different values of non-free features were present in
-# property set.
+# Regression test: it was possible that due to evaluation of conditional
+# requirements, two different values of non-free features were present in a
+# property set.
import BoostBuild
@@ -14,7 +14,7 @@
t.write("a.cpp", "")
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
import feature ;
import common ;
Modified: trunk/tools/build/v2/test/conditionals3.py
==============================================================================
--- trunk/tools/build/v2/test/conditionals3.py (original)
+++ trunk/tools/build/v2/test/conditionals3.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,23 +4,23 @@
# 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 conditional properties work, even if property is free, and value
-# includes a colon.
+# Test that conditional properties work, even if property is free, and value
+# includes a colon.
import BoostBuild
t = BoostBuild.Tester()
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
exe hello : hello.cpp : <variant>debug:<define>CLASS=Foo::Bar ;
""")
+
t.write("hello.cpp", """
namespace Foo { class Bar { } ; }
int main()
{
CLASS c;
c; // Disables the unused variable warning.
- return 0;
}
""")
Modified: trunk/tools/build/v2/test/conditionals_multiple.py
==============================================================================
--- trunk/tools/build/v2/test/conditionals_multiple.py (original)
+++ trunk/tools/build/v2/test/conditionals_multiple.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -21,7 +21,8 @@
"""Basic tests for properties conditioned on multiple other properties.
"""
- t = BoostBuild.Tester("--ignore-regular-config toolset=testToolset", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("--ignore-regular-config toolset=testToolset",
+ pass_toolset=False, use_test_config=False)
t.write("testToolset.jam", """
import feature ;
@@ -29,7 +30,7 @@
rule init ( ) { }
""")
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import feature ;
import notfile ;
import toolset ;
@@ -134,7 +135,7 @@
rule init ( version ? ) { }
""" % {"toolset": toolset})
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import feature ;
import notfile ;
import toolset ;
Modified: trunk/tools/build/v2/test/configuration.py
==============================================================================
--- trunk/tools/build/v2/test/configuration.py (original)
+++ trunk/tools/build/v2/test/configuration.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -23,7 +23,8 @@
path handling is tested.
"""
- t = BoostBuild.Tester("--debug-configuration", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("--debug-configuration", pass_toolset=False,
+ use_test_config=False)
implicitConfigLoadMessage = "notice: Loading user-config configuration file: *"
explicitConfigLoadMessage = "notice: Loading explicitly specified user configuration file:"
@@ -46,7 +47,7 @@
feature.extend toolset : %s ;
rule init ( ) { }
""" % toolsetName )
- t.write("Jamroot.jam", "using %s ;" % toolsetName)
+ t.write("jamroot.jam", "using %s ;" % toolsetName)
t.run_build_system()
t.expect_output_line(explicitConfigLoadMessage, False)
Modified: trunk/tools/build/v2/test/core_d12.py
==============================================================================
--- trunk/tools/build/v2/test/core_d12.py (original)
+++ trunk/tools/build/v2/test/core_d12.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,8 +1,8 @@
#!/usr/bin/python
-# Copyright 2002, 2003 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 2002, 2003 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)
# This tests correct handling of "-d1" and "-d2" options.
@@ -11,14 +11,9 @@
t = BoostBuild.Tester(pass_toolset=0)
t.write("file.jam", """
-actions a {
-}
-
-actions quietly b {
-}
-
+actions a { }
+actions quietly b { }
ALWAYS all ;
-
a all ;
b all ;
""")
Modified: trunk/tools/build/v2/test/core_delete_module.py
==============================================================================
--- trunk/tools/build/v2/test/core_delete_module.py (original)
+++ trunk/tools/build/v2/test/core_delete_module.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,8 +1,8 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# 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 Dave Abrahams
+# 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)
# This tests the facilities for deleting modules.
@@ -28,12 +28,12 @@
{
EXIT DELETE_MODULE failed to kill foo's variables ;
}
-
+
rule bar { }
var = x y ;
-
+
DELETE_MODULE foo ;
-
+
if $(var)
{
EXIT internal DELETE_MODULE failed to kill foo's variables ;
Modified: trunk/tools/build/v2/test/core_dependencies.py
==============================================================================
--- trunk/tools/build/v2/test/core_dependencies.py (original)
+++ trunk/tools/build/v2/test/core_dependencies.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,11 +4,12 @@
# 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)
-# This tests correct handling of dependencies, specifically, on
-# generated sources, and from generated sources.
+# This tests correct handling of dependencies, specifically, on generated
+# sources, and from generated sources.
import BoostBuild
-from string import find
+
+import string
t = BoostBuild.Tester(pass_toolset=0)
@@ -37,20 +38,22 @@
HDRSCAN on b foo.h bar.h = \"#include <(.*)>\" ;
"""
-# This creates 'a' which depends on 'b', which is generated.
-# The generated 'b' contains '#include <foo.h>' and no rules for
-# foo.h are given. The system should error out on the first invocation.
+# This creates 'a' which depends on 'b', which is generated. The generated 'b'
+# contains '#include <foo.h>' and no rules for foo.h are given. The system
+# should error out on the first invocation.
t.run_build_system("-f-", stdin=code)
-t.fail_test(find(t.stdout(), "...skipped a for lack of foo.h...") == -1)
+t.fail_test(string.find(t.stdout(), "...skipped a for lack of foo.h...") == -1)
t.rm('b')
-# Now test that if target 'c' also depends on 'b', then it won't be built, as well.
-t.run_build_system("-f-", stdin=code + " copy c : b ; DEPENDS c : b ; DEPENDS all : c ; ")
-t.fail_test(find(t.stdout(), "...skipped c for lack of foo.h...") == -1)
+# Now test that if target 'c' also depends on 'b', then it will not be built, as
+# well.
+t.run_build_system("-f-", stdin=code + " copy c : b ; DEPENDS c : b ; DEPENDS all : c ; ")
+t.fail_test(string.find(t.stdout(), "...skipped c for lack of foo.h...") == -1)
-# Now add a rule for creating foo.h
t.rm('b')
+
+# Now add a rule for creating foo.h.
code += """
actions create-foo
{
@@ -60,36 +63,35 @@
"""
t.run_build_system("-f-", stdin=code)
-# Run two times, adding explicit dependency from all to foo.h at
-# the beginning and at the end, to make sure that foo.h is generated before
-# 'a' in all cases.
-
-def mk_right_order_func(s1, s2):
- def right_order(s):
- n1 = find(s, s1)
- n2 = find(s, s2)
- return n1 != -1 and n2 != -1 and n1 < n2
- return right_order
+# Run two times, adding explicit dependency from all to foo.h at the beginning
+# and at the end, to make sure that foo.h is generated before 'a' in all cases.
+
+def mk_correct_order_func(s1, s2):
+ def correct_order(s):
+ n1 = string.find(s, s1)
+ n2 = string.find(s, s2)
+ return ( n1 != -1 ) and ( n2 != -1 ) and ( n1 < n2 )
+ return correct_order
-right_order = mk_right_order_func("create-foo", "copy a")
+correct_order = mk_correct_order_func("create-foo", "copy a")
t.rm(["a", "b", "foo.h"])
t.run_build_system("-d+2 -f-", stdin=code + " DEPENDS all : foo.h ;")
-t.fail_test(not right_order(t.stdout()))
+t.fail_test(not correct_order(t.stdout()))
t.rm(["a", "b", "foo.h"])
t.run_build_system("-d+2 -f-", stdin=" DEPENDS all : foo.h ; " + code)
-t.fail_test(not right_order(t.stdout()))
+t.fail_test(not correct_order(t.stdout()))
-# Now foo.h exists. Test include from b -> foo.h -> bar.h -> biz.h
-# b and foo.h already have updating actions.
+# Now foo.h exists. Test include from b -> foo.h -> bar.h -> biz.h. b and foo.h
+# already have updating actions.
t.rm(["a", "b"])
t.write("foo.h", "#include <bar.h>")
t.write("bar.h", "#include <biz.h>")
t.run_build_system("-d+2 -f-", stdin=code)
-t.fail_test(find(t.stdout(), "...skipped a for lack of biz.h...") == -1)
+t.fail_test(string.find(t.stdout(), "...skipped a for lack of biz.h...") == -1)
-# Add an action for biz.h
+# Add an action for biz.h.
code += """
actions create-biz
{
@@ -97,15 +99,15 @@
}
create-biz biz.h ;
"""
+
t.rm(["b"])
-right_order = mk_right_order_func("create-biz", "copy a")
+correct_order = mk_correct_order_func("create-biz", "copy a")
t.run_build_system("-d+2 -f-", stdin=code + " DEPENDS all : biz.h ;")
-t.fail_test(not right_order(t.stdout()))
+t.fail_test(not correct_order(t.stdout()))
t.rm(["a", "biz.h"])
t.run_build_system("-d+2 -f-", stdin=" DEPENDS all : biz.h ; " + code)
-t.fail_test(not right_order(t.stdout()))
-
+t.fail_test(not correct_order(t.stdout()))
t.write("a", "")
@@ -147,10 +149,9 @@
INCLUDES $(1) : d ;
}
"""
-right_order = mk_right_order_func("create-d", "copy main")
-t.run_build_system("-d2 -f-", stdin=code)
-t.fail_test(not right_order(t.stdout()))
-
+correct_order = mk_correct_order_func("create-d", "copy main")
+t.run_build_system("-d2 -f-", stdin=code)
+t.fail_test(not correct_order(t.stdout()))
t.cleanup()
Modified: trunk/tools/build/v2/test/core_import_module.py
==============================================================================
--- trunk/tools/build/v2/test/core_import_module.py (original)
+++ trunk/tools/build/v2/test/core_import_module.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,24 +1,23 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-from BoostBuild import Tester, List
+import BoostBuild
-
-t = Tester(pass_toolset=0)
-
-# Test that
+t = BoostBuild.Tester(pass_toolset=0)
t.write("code", """
-module a {
+module a
+{
rule r1 ( )
{
ECHO R1 ;
}
}
-module a2 {
+module a2
+{
rule r2 ( )
{
ECHO R2 ;
@@ -26,9 +25,9 @@
}
IMPORT a2 : r2 : : a2.r2 ;
-module b {
+module b
+{
IMPORT_MODULE a : b ;
-
rule test
{
# Call rule visible via IMPORT_MODULE
@@ -41,19 +40,19 @@
IMPORT b : test : : test ;
test ;
-module c {
+module c
+{
rule test
{
ECHO CTEST ;
}
-}
+}
IMPORT_MODULE c : ;
c.test ;
actions do-nothing { }
do-nothing all ;
-
""")
t.run_build_system("-fcode", stdout="""R1
Modified: trunk/tools/build/v2/test/core_modifiers.py
==============================================================================
--- trunk/tools/build/v2/test/core_modifiers.py (original)
+++ trunk/tools/build/v2/test/core_modifiers.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,18 +1,17 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
# This tests the "existing" and "updated" modifiers on actions.
import BoostBuild
-from string import strip, replace
+import string
t = BoostBuild.Tester(pass_toolset=0)
code = """
-
DEPENDS all : a ;
ALWAYS a ;
NOTFILE a ;
@@ -36,25 +35,17 @@
t.write("a-1", "")
t.run_build_system("-ffile.jam")
-t.fail_test(strip(t.read("list")) != "a-1")
+t.fail_test(string.strip(t.read("list")) != "a-1")
t.rm(["a-3", "list"])
-code = replace(code, "existing", "updated")
+code = string.replace(code, "existing", "updated")
t.write("file.jam", code)
t.run_build_system("-ffile.jam")
-t.fail_test(strip(t.read("list")) != "a-3")
+t.fail_test(string.strip(t.read("list")) != "a-3")
-code = replace(code, "updated", "existing updated")
+code = string.replace(code, "updated", "existing updated")
t.write("file.jam", code)
t.run_build_system("-ffile.jam")
-t.fail_test(strip(t.read("list")) != "a-1 a-3")
-
-
-
-
-
-
-
-
+t.fail_test(string.strip(t.read("list")) != "a-1 a-3")
t.cleanup()
Modified: trunk/tools/build/v2/test/core_varnames.py
==============================================================================
--- trunk/tools/build/v2/test/core_varnames.py (original)
+++ trunk/tools/build/v2/test/core_varnames.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# 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 Dave Abrahams
+# 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)
-# This tests the core rule for enumerating the variable names in a module
+# This tests the core rule for enumerating the variable names in a module.
import BoostBuild
@@ -34,4 +34,5 @@
""")
t.run_build_system("-ffile.jam", status=0)
+
t.cleanup()
Modified: trunk/tools/build/v2/test/custom_generator.py
==============================================================================
--- trunk/tools/build/v2/test/custom_generator.py (original)
+++ trunk/tools/build/v2/test/custom_generator.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,19 +4,17 @@
# 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)
+# Attempt to declare a generator for creating OBJ from RC files. That generator
+# should be considered together with standard CPP->OBJ generators and
+# successfully create the target. Since we do not have a RC compiler everywhere,
+# we fake the action. The resulting OBJ will be unusable, but it must be
+# created.
-from BoostBuild import Tester, List
+import BoostBuild
+t = BoostBuild.Tester()
-t = Tester()
-
-# Attempt to declare a generator for creating OBJ from RC files.
-# That generator should be considered together with standard
-# CPP->OBJ generators and successfully create the target.
-# Since we don't have RC compiler everywhere, we fake the action.
-# The resulting OBJ will be unusable, but it must be created.
-
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
import rcc ;
""")
@@ -25,8 +23,8 @@
import generators ;
import print ;
-# Use 'RCC' to avoid conflicts with definitions in
-# the standard rc.jam and msvc.jam
+# Use 'RCC' to avoid conflicts with definitions in the standard rc.jam and
+# msvc.jam
type.register RCC : rcc ;
rule resource-compile ( targets * : sources * : properties * )
@@ -36,10 +34,9 @@
}
generators.register-standard rcc.resource-compile : RCC : OBJ ;
-
""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
obj r : r.rcc ;
""")
@@ -50,6 +47,3 @@
t.expect_content("bin/$toolset/debug/r.obj", "rc-object")
t.cleanup()
-
-
-
Modified: trunk/tools/build/v2/test/default_build.py
==============================================================================
--- trunk/tools/build/v2/test/default_build.py (original)
+++ trunk/tools/build/v2/test/default_build.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,38 +1,38 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003 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 Dave Abrahams
+# Copyright 2002, 2003 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)
# Test that default build clause actually has any effect.
-from BoostBuild import Tester, List
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", "exe a : a.cpp : : debug release ;")
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "import gcc ;")
+t.write("jamfile.jam", "exe a : a.cpp : : debug release ;")
t.write("a.cpp", "int main() { return 0; }\n")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
t.expect_addition("bin/$toolset/release/a.exe")
-# Check that explictly-specified build variant supresses
-# default-build
+# Check that explictly-specified build variant supresses default-build.
t.rm("bin")
t.run_build_system("release")
-t.expect_addition(List("bin/$toolset/release/") * "a.exe a.obj")
+t.expect_addition(BoostBuild.List("bin/$toolset/release/") * "a.exe a.obj")
t.expect_nothing_more()
-# Now check that we can specify explicit build request and
-# default-build will be combined with it
+# Now check that we can specify explicit build request and default-build will be
+# combined with it.
t.run_build_system("optimization=space")
t.expect_addition("bin/$toolset/debug/optimization-space/a.exe")
t.expect_addition("bin/$toolset/release/optimization-space/a.exe")
# Test that default-build must be identical in all alternatives. Error case.
-t.write("Jamfile", """
+t.write("jamfile.jam", """
exe a : a.cpp : : debug ;
exe a : b.cpp : : ;
""")
@@ -44,29 +44,28 @@
"""
t.run_build_system("-n --no-error-backtrace", status=1, stdout=expected)
-# Test that default-build must be identical in all alternatives. No Error case, empty default build.
-t.write("Jamfile", """
+# Test that default-build must be identical in all alternatives. No Error case,
+# empty default build.
+t.write("jamfile.jam", """
exe a : a.cpp : <variant>debug ;
exe a : b.cpp : <variant>release ;
""")
t.run_build_system("-n --no-error-backtrace", status=0)
-# Now try a harder example: default build which contains <define>
-# should cause <define> to be present when "b" is compiled.
-# This happens only of "build-project b" is placed first.
-t.write("Jamfile", """
- project
- : default-build <define>FOO
- ;
-
- build-project a ;
- build-project b ;
+# Now try a harder example: default build which contains <define> should cause
+# <define> to be present when "b" is compiled. This happens only if
+# "build-project b" is placed first.
+t.write("jamfile.jam", """
+project : default-build <define>FOO ;
+build-project a ;
+build-project b ;
""")
-t.write("a/Jamfile", """
- exe a : a.cpp ../b//b ;
+t.write("a/jamfile.jam", """
+exe a : a.cpp ../b//b ;
""")
+
t.write("a/a.cpp", """
#ifdef _WIN32
__declspec(dllimport)
@@ -75,9 +74,10 @@
int main() { foo(); return 0; }
""")
-t.write("b/Jamfile", """
- lib b : b.cpp ;
+t.write("b/jamfile.jam", """
+lib b : b.cpp ;
""")
+
t.write("b/b.cpp", """
#ifdef FOO
#ifdef _WIN32
Modified: trunk/tools/build/v2/test/default_features.py
==============================================================================
--- trunk/tools/build/v2/test/default_features.py (original)
+++ trunk/tools/build/v2/test/default_features.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,44 +1,39 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-# Test that features with default values are always present
-# in build properties of any target.
+# Test that features with default values are always present in build properties
+# of any target.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
# Declare *non-propagated* feature foo.
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
import feature : feature ;
-
feature foo : on off ;
""")
-# Note that '<foo>on' won't be propagated
-# to 'd/l'.
-t.write("Jamfile", """
+# Note that '<foo>on' will not be propagated to 'd/l'.
+t.write("jamfile.jam", """
exe hello : hello.cpp d//l ;
""")
+
t.write("hello.cpp", """
#ifdef _WIN32
__declspec(dllimport)
#endif
void foo();
-int main()
-{
- foo();
- return 1;
-}
-
+int main() { foo(); return 1; }
""")
-t.write("d/Jamfile", """
+t.write("d/jamfile.jam", """
lib l : l.cpp : <foo>on:<define>FOO ;
""")
+
t.write("d/l.cpp", """
#ifdef _WIN32
__declspec(dllexport)
@@ -46,7 +41,6 @@
#ifdef FOO
void foo() {}
#endif
-
""")
t.run_build_system()
Modified: trunk/tools/build/v2/test/default_toolset.py
==============================================================================
--- trunk/tools/build/v2/test/default_toolset.py (original)
+++ trunk/tools/build/v2/test/default_toolset.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -58,7 +58,7 @@
'toolset_version_unused': toolset_version_unused})
# Main Boost Build project script.
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import build-system ;
import errors ;
import feature ;
@@ -121,7 +121,7 @@
t = BoostBuild.Tester("--user-config= --ignore-site-config",
pass_toolset=False, use_test_config=False)
- t.write("Jamroot.jam", "modules.poke os : .name : %s ;" % os)
+ t.write("jamroot.jam", "modules.poke os : .name : %s ;" % os)
# We need to tell the test system to ignore stderr output as attempting to
# load missing toolsets might cause random failures with which we are not
@@ -159,7 +159,7 @@
""" % {'toolset_name': toolset_name})
# Main Boost Build project script.
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import build-system ;
import errors ;
import feature ;
Deleted: trunk/tools/build/v2/test/dependency-test/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,25 +0,0 @@
-# Copyright 2002, 2003, 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)
-
-
-project test
- : requirements <include>src1
- ;
-
-exe a
- : x.foo a.cpp a_c.c
- ;
-
-exe b
- : b.cpp
- ;
-
-# Because of <define>, c.cpp will be compiled to different
-# directory than everything for main target "a". Therefore
-# without <implicit-dependency>, it won't find "x.h", which is part
-# of "a"'s dependency graph.
-exe c
- : c.cpp
- : <define>FOO <implicit-dependency>a
- ;
Deleted: trunk/tools/build/v2/test/dependency-test/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,7 +0,0 @@
-# Copyright 2002 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)
-
-
-import gcc ;
-import foo ;
Modified: trunk/tools/build/v2/test/dependency_property.py
==============================================================================
--- trunk/tools/build/v2/test/dependency_property.py (original)
+++ trunk/tools/build/v2/test/dependency_property.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,30 +4,28 @@
# 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)
-# Regression test: virtual targets with different dependency properties
-# were considered different by 'virtual-target.register', but the code
-# which determined target paths ignored dependency properties --- so both
-# targets used to be placed to the same location.
+# Regression test: virtual targets with different dependency properties were
+# considered different by 'virtual-target.register', but the code which
+# determined target paths ignored dependency properties --- so both targets used
+# to be placed to the same location.
-from BoostBuild import Tester, List
-from string import find
+import BoostBuild
+import string
-t = Tester()
+t = BoostBuild.Tester()
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
lib foo : foo.cpp ;
exe hello : hello.cpp ;
exe hello2 : hello.cpp : <library>foo ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() { return 0; }
""")
+
t.write("foo.cpp", """
#ifdef _WIN32
__declspec(dllexport)
@@ -36,6 +34,6 @@
""")
t.run_build_system("--no-error-backtrace", status=1)
-t.fail_test(find(t.stdout(), "Duplicate name of actual target") == -1)
+t.fail_test(string.find(t.stdout(), "Duplicate name of actual target") == -1)
t.cleanup()
Modified: trunk/tools/build/v2/test/dependency_test.py
==============================================================================
--- trunk/tools/build/v2/test/dependency_test.py (original)
+++ trunk/tools/build/v2/test/dependency_test.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,19 +5,20 @@
# 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("dependency-test")
+
t.run_build_system()
-# Check that main target 'c' was able to find 'x.h' from
-# 'a's dependency graph
+
+# Check that main target 'c' was able to find 'x.h' from 'a's dependency graph.
t.expect_addition("bin/$toolset/debug/c.exe")
# Check handling of first level includes.
-# Both 'a' and 'b' include "a.h" and should be updated
+# Both 'a' and 'b' include "a.h" and should be updated.
t.touch("a.h")
t.run_build_system()
@@ -26,14 +27,13 @@
t.expect_touch("bin/$toolset/debug/a_c.obj")
t.expect_touch("bin/$toolset/debug/b.exe")
t.expect_touch("bin/$toolset/debug/b.obj")
-# Now, <dependency> does not add dependency.
-# It sound weird, but is intentional. Need
-# to rename <dependency> eventually.
+# Now, <dependency> does not add a dependency. It sound weird, but is
+# intentional. Need to rename <dependency> eventually.
#t.expect_touch("bin/$toolset/debug/main-target-c/c.exe")
t.ignore("*.tds")
t.expect_nothing_more()
-# Only 'a' include <a.h> and should be updated
+# Only 'a' include <a.h> and should be updated.
t.touch("src1/a.h")
t.run_build_system()
@@ -43,7 +43,7 @@
t.ignore("*.tds")
t.expect_nothing_more()
-# "src/a.h" includes "b.h" (in the same dir)
+# "src/a.h" includes "b.h" (in the same dir).
t.touch("src1/b.h")
t.run_build_system()
t.expect_touch("bin/$toolset/debug/a.exe")
@@ -52,8 +52,8 @@
t.ignore("*.tds")
t.expect_nothing_more()
-# included by "src/b.h". We had a bug: file included via "",
-# like "b.h" is in this case was not scanned at all.
+# Included by "src/b.h". We had a bug: file included via "", like "b.h" is in
+# this case was not scanned at all.
t.touch("src1/c.h")
t.run_build_system()
t.expect_touch("bin/$toolset/debug/a.exe")
@@ -62,41 +62,38 @@
t.run_build_system()
t.expect_nothing_more()
-# Test dependency on generated header.
-# TODO: we have also to check that generated header is found correctly
-# if it is different for different subvariants. Lacking any toolset
-# support, this check will be implemented later.
+# Test dependency on a generated header.
+#
+# TODO: we have also to check that generated header is found correctly if it is
+# different for different subvariants. Lacking any toolset support, this check
+# will be implemented later.
t.touch("x.foo")
t.run_build_system()
t.expect_touch("bin/$toolset/debug/a.obj")
t.expect_touch("bin/$toolset/debug/a_c.obj")
-# Check that generated headers are scanned for dependencies as well
+# Check that generated headers are scanned for dependencies as well.
t.touch("src1/z.h")
t.run_build_system()
t.expect_touch("bin/$toolset/debug/a.obj")
t.expect_touch("bin/$toolset/debug/a_c.obj")
-# Regression test: on windows, <includes> with absolute paths
-# were not considered when scanning dependencies.
-
+# Regression test: on Windows, <includes> with absolute paths were not
+# considered when scanning dependencies.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
path-constant TOP : . ;
-exe app : main.cpp
- : <include>$(TOP)/include
- ;
+exe app : main.cpp : <include>$(TOP)/include ;
""");
t.write("main.cpp", """
#include <dir/header.h>
-
-int main() { return 0; }
-
+int main() {}
""")
t.write("include/dir/header.h", "")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.obj")
@@ -104,6 +101,4 @@
t.run_build_system()
t.expect_touch("bin/$toolset/debug/main.obj")
-
-
t.cleanup()
Deleted: trunk/tools/build/v2/test/direct-request-test/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/direct-request-test/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2002 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)
-
-
-# This will link correctly only if symbol MACROS is defined when compiling
-# b.cpp. However, this is only possible if that symbol is requested
-# on command line and b.cpp is compiled with directly requested
-# properties.
-
-exe a : a.cpp b ;
-
-lib b : b.cpp ;
Deleted: trunk/tools/build/v2/test/direct-request-test/Jamfile2
==============================================================================
--- trunk/tools/build/v2/test/direct-request-test/Jamfile2 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-
-# This will link correctly only if symbol MACROS is not defined when
-# compiling b.cpp. This tests if direct build request
-# 'release <define>MACROS' to 'b' does not add 'MACROS' when 'b'
-# is compiled with 'debug' -- the version needed by 'a'.
-
-exe a : a.cpp b : <variant>debug ;
-
-lib b : b.cpp ;
\ No newline at end of file
Deleted: trunk/tools/build/v2/test/direct-request-test/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/direct-request-test/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-# Copyright 2002 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)
-
-
-import gcc ;
Modified: trunk/tools/build/v2/test/direct_request_test.py
==============================================================================
--- trunk/tools/build/v2/test/direct_request_test.py (original)
+++ trunk/tools/build/v2/test/direct_request_test.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,46 +1,40 @@
#!/usr/bin/python
-from BoostBuild import Tester, List
-import os
-from string import strip
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-# First check some startup
+
+# First check some startup.
t.set_tree("direct-request-test")
t.run_build_system(extra_args="define=MACROS")
-
t.expect_addition("bin/$toolset/debug/"
- * (List("a.obj b.obj b.dll a.exe")))
+ * (BoostBuild.List("a.obj b.obj b.dll a.exe")))
+
-# When building debug version, the 'define' still applies
+# When building a debug version, the 'define' still applies.
t.rm("bin")
t.run_build_system(extra_args="debug define=MACROS")
t.expect_addition("bin/$toolset/debug/"
- * (List("a.obj b.obj b.dll a.exe")))
+ * (BoostBuild.List("a.obj b.obj b.dll a.exe")))
-# When building release version, the 'define' should not
-# apply: we'll have direct build request 'release <define>MACROS'
-# and real build properties 'debug'.
-t.copy("Jamfile2", "Jamfile")
+
+# When building release version, the 'define' should not apply: we will have
+# direct build request 'release <define>MACROS' and a real build property
+# 'debug'.
+t.copy("jamfile2.jam", "jamfile.jam")
t.copy("b_inverse.cpp", "b.cpp")
t.rm("bin")
t.run_build_system(extra_args="release define=MACROS")
-# Regression test: direct build request was not working
-# when there's more than one level of 'build-project'
-
+# Regression test: direct build request was not working when there was more than
+# one level of 'build-project'.
t.rm(".")
-t.write('project-root.jam', '')
-t.write('Jamfile', 'build-project a ;')
-t.write('a/Jamfile', 'build-project b ;')
-t.write('a/b/Jamfile', '')
-
+t.write('jamroot.jam', '')
+t.write('jamfile.jam', 'build-project a ;')
+t.write('a/jamfile.jam', 'build-project b ;')
+t.write('a/b/jamfile.jam', '')
t.run_build_system("release")
-
-
-
-
t.cleanup()
Modified: trunk/tools/build/v2/test/disambiguation.py
==============================================================================
--- trunk/tools/build/v2/test/disambiguation.py (original)
+++ trunk/tools/build/v2/test/disambiguation.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,30 +1,26 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
-
-# Test that it's possible to add a suffix to a main target name to
-# disambiguate that main target from another, and that this does not
-# affect the names of the generated targets.
-from BoostBuild import Tester, List
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Create a temporary working directory
-t = Tester()
+# Test that it is possible to add a suffix to a main target name to disambiguate
+# that main target from another, and that this does not affect the names of the
+# generated targets.
-# Create the needed files
-t.write("Jamroot", """
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
exe hello.exe : hello.obj ;
obj hello.obj : hello.cpp : <variant>debug ;
obj hello.obj2 : hello.cpp : <variant>release ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() {}
""")
t.run_build_system()
@@ -33,5 +29,4 @@
t.expect_addition("bin/$toolset/debug/hello.obj")
t.expect_addition("bin/$toolset/release/hello.obj")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/dll_path.py
==============================================================================
--- trunk/tools/build/v2/test/dll_path.py (original)
+++ trunk/tools/build/v2/test/dll_path.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,41 +1,38 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
-# distribute this software is granted provided this copyright notice appears in
-# all copies. This software is provided "as is" without express or implied
-# warranty, and with no claim as to its suitability for any purpose.
-
-# Test that the <dll-path> property is correctly set when using
-# <hardcode-dll-paths>true.
-from BoostBuild import Tester, List
-from string import find
-
-
-t = Tester()
-
-# The point of this test is to have exe "main" which uses library "b",
-# which uses library "a". When "main" is built with <hardcode-dll-paths>true,
-# paths to both libraries should be present as values of <dll-path> feature.
-# We create a special target type which reports <dll-path> values on its sources
-# and compare the list of found values with out expectations.
+# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
+# distribute this software is granted provided this copyright notice appears in
+# all copies. This software is provided "as is" without express or implied
+# warranty, and with no claim as to its suitability for any purpose.
-t.write("Jamfile", """
+# Test that the <dll-path> property is correctly set when using
+# <hardcode-dll-paths>true.
+
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+# The point of this test is to have exe "main" which uses library "b", which
+# uses library "a". When "main" is built with <hardcode-dll-paths>true, paths to
+# both libraries should be present as values of <dll-path> feature. We create a
+# special target type which reports <dll-path> values on its sources and compare
+# the list of found values with out expectations.
+
+t.write("jamfile.jam", """
exe main : main.cpp b//b ;
explicit main ;
-
-path-list mp : main ;
+path-list mp : main ;
""")
-t.write("main.cpp", """
-int main() { return 0; }
-
+t.write("main.cpp", """
+int main() {}
""")
-t.write("project-root.jam", """
-using dll-paths ;
+t.write("jamroot.jam", """
+using dll-paths ;
""")
-t.write("dll-paths.jam", """
+t.write("dll-paths.jam", """
import type ;
import generators ;
import feature ;
@@ -43,18 +40,18 @@
import print ;
import "class" : new ;
-rule init ( )
-{
+rule init ( )
+{
type.register PATH_LIST : pathlist ;
-
- class dll-paths-list-generator : generator
+
+ class dll-paths-list-generator : generator
{
rule __init__ ( )
{
generator.__init__ dll-paths.list : EXE : PATH_LIST ;
}
-
- rule generated-targets ( sources + : property-set : project name ? )
+
+ rule generated-targets ( sources + : property-set : project name ? )
{
local dll-paths ;
for local s in $(sources)
@@ -64,15 +61,15 @@
{
local p = [ $(a).properties ] ;
dll-paths += [ $(p).get <dll-path> ] ;
- }
+ }
}
- return [ generator.generated-targets $(sources)
- : [ $(property-set).add-raw $(dll-paths:G=<dll-path>) ] : $(project) $(name) ] ;
-
+ return [ generator.generated-targets $(sources) :
+ [ $(property-set).add-raw $(dll-paths:G=<dll-path>) ] :
+ $(project) $(name) ] ;
+
}
}
generators.register [ new dll-paths-list-generator ] ;
-
}
rule list ( target : sources * : properties * )
@@ -82,35 +79,30 @@
print.output $(target) ;
print.text $(paths) ;
}
-
""")
-t.write("a/a.cpp", """
+t.write("a/a.cpp", """
void
#if defined(_WIN32)
__declspec(dllexport)
#endif
foo() {}
-
-
""")
-t.write("a/Jamfile", """
-lib a : a.cpp ;
+t.write("a/jamfile.jam", """
+lib a : a.cpp ;
""")
-t.write("b/b.cpp", """
+t.write("b/b.cpp", """
void
#if defined(_WIN32)
__declspec(dllexport)
#endif
bar() {}
-
-
""")
-t.write("b/Jamfile", """
-lib b : b.cpp ../a//a ;
+t.write("b/jamfile.jam", """
+lib b : b.cpp ../a//a ;
""")
t.run_build_system("hardcode-dll-paths=true")
@@ -124,4 +116,3 @@
t.expect_content_line("bin/$toolset/debug/mp.pathlist", "*" + es2);
t.cleanup()
-
Modified: trunk/tools/build/v2/test/double_loading.py
==============================================================================
--- trunk/tools/build/v2/test/double_loading.py (original)
+++ trunk/tools/build/v2/test/double_loading.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,15 +4,14 @@
# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-# Regression test for double loading of the same Jamfile.
-t.write("Jamfile.jam", "build-project subdir ;")
-t.write("Jamroot.jam", "" )
-t.write("subdir/Jamfile.jam", 'ECHO "Loaded subdir" ;')
+# Regression test for double loading of the same Jamfile.
+t.write("jamroot.jam", "" )
+t.write("jamfile.jam", "build-project subdir ;")
+t.write("subdir/jamfile.jam", 'ECHO "Loaded subdir" ;')
t.run_build_system(subdir="subdir")
t.expect_output_line("Loaded subdir")
@@ -22,9 +21,9 @@
# subdir via use-project, while subdir's Jamfile is being loaded. The motivation
# why use-project referring to subprojects is useful can be found at
# http://article.gmane.org/gmane.comp.lib.boost.build/3906/
-t.write("Jamfile.jam", "use-project /subdir : subdir ;")
-t.write("Jamroot.jam", "" )
-t.write("subdir/Jamfile.jam", "project subdir ;")
+t.write("jamroot.jam", "" )
+t.write("jamfile.jam", "use-project /subdir : subdir ;")
+t.write("subdir/jamfile.jam", "project subdir ;")
t.run_build_system(subdir="subdir");
Modified: trunk/tools/build/v2/test/duplicate.py
==============================================================================
--- trunk/tools/build/v2/test/duplicate.py (original)
+++ trunk/tools/build/v2/test/duplicate.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,40 +4,35 @@
# 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)
-# This test tries to stage the same file to the same location by *two*
-# different stage rules, in two different projects. This is not exactly
-# good thing to do, but still, V2 should handle this. We had two bugs:
-# - since the file is referred from two projects, we created to different
-# virtual targets
-# - we also failed to figure out that the two target corresponding to the
-# copied files (created in two projects) are actually equivivalent.
+# This test tries to stage the same file to the same location by *two* different
+# stage rules, in two different projects. This is not exactly good thing to do,
+# but still, V2 should handle this. We had two bugs:
+# - since the file is referred from two projects, we created to different
+# virtual targets
+# - we also failed to figure out that the two target corresponding to the copied
+# files (created in two projects) are actually equivalent.
-from BoostBuild import Tester, List
+import BoostBuild
+t = BoostBuild.Tester()
-t = Tester()
-
-t.write("a.cpp", """
+t.write("a.cpp", """
""")
-t.write("Jamfile", """
+t.write("jamroot.jam", """
build-project a ;
-build-project b ;
-""")
-
-t.write("project-root.jam", """
+build-project b ;
""")
-t.write("a/Jamfile", """
-stage bin : ../a.cpp : <location>../dist ;
+t.write("a/jamfile.jam", """
+stage bin : ../a.cpp : <location>../dist ;
""")
-t.write("b/Jamfile", """
-stage bin : ../a.cpp : <location>../dist ;
+t.write("b/jamfile.jam", """
+stage bin : ../a.cpp : <location>../dist ;
""")
t.run_build_system()
t.expect_addition("dist/a.cpp")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/example_customization.py
==============================================================================
--- trunk/tools/build/v2/test/example_customization.py (original)
+++ trunk/tools/build/v2/test/example_customization.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,15 +1,15 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Test the 'libraries' example.
-from BoostBuild import Tester, List
+# Test the 'customization' example.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree("../example/customization")
@@ -17,7 +17,5 @@
t.expect_addition(["bin/$toolset/debug/codegen.exe",
"bin/$toolset/debug/usage.cpp"])
-
-
t.cleanup()
Modified: trunk/tools/build/v2/test/example_gettext.py
==============================================================================
--- trunk/tools/build/v2/test/example_gettext.py (original)
+++ trunk/tools/build/v2/test/example_gettext.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,17 +1,17 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Test the 'libraries' example.
-from BoostBuild import Tester, List
+# Test the 'gettext' example.
+
+import BoostBuild
import os
import string
-# Create a temporary working directory
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("../example/gettext")
@@ -20,7 +20,6 @@
t.expect_addition(["bin/$toolset/debug/main.exe",
"bin/$toolset/debug/russian.mo"])
-
file = t.adjust_names(["bin/$toolset/debug/main.exe"])[0]
input_fd = os.popen(file)
Modified: trunk/tools/build/v2/test/example_libraries.py
==============================================================================
--- trunk/tools/build/v2/test/example_libraries.py (original)
+++ trunk/tools/build/v2/test/example_libraries.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,15 +1,15 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Test the 'libraries' example.
-from BoostBuild import Tester, List
+# Test the 'libraries' example.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree("../example/libraries")
@@ -18,5 +18,4 @@
t.expect_addition(["app/bin/$toolset/debug/app.exe",
"util/foo/bin/$toolset/debug/bar.dll"])
-
t.cleanup()
Modified: trunk/tools/build/v2/test/example_make.py
==============================================================================
--- trunk/tools/build/v2/test/example_make.py (original)
+++ trunk/tools/build/v2/test/example_make.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,11 +1,11 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Test the 'make' example.
+# Test the 'make' example.
import BoostBuild
Modified: trunk/tools/build/v2/test/example_qt4.py
==============================================================================
--- trunk/tools/build/v2/test/example_qt4.py (original)
+++ trunk/tools/build/v2/test/example_qt4.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -6,10 +6,10 @@
# http://www.boost.org/LICENSE_1_0.txt)
# Test the 'qt4' examples.
-from BoostBuild import Tester, List
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree("../example/qt/qt4/hello")
t.run_build_system()
Modified: trunk/tools/build/v2/test/expansion.py
==============================================================================
--- trunk/tools/build/v2/test/expansion.py (original)
+++ trunk/tools/build/v2/test/expansion.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,88 +4,77 @@
# 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)
-# This file is template for Boost.Build tests. It creates a simple
-# project that builds one exe from one source, and checks that the exe
-# is really created.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("a.cpp", """
+t.write("a.cpp", """
#ifdef CF_IS_OFF
int main() { return 0; }
#endif
-
""")
-t.write("b.cpp", """
+t.write("b.cpp", """
#ifdef CF_1
int main() { return 0; }
#endif
-
""")
t.write("c.cpp", """
#ifdef FOO
int main() { return 0; }
#endif
-
""")
-
-t.write("Jamfile", """
-# See if default value of composite feature 'cf'
-# will be expanded to <define>CF_IS_OFF
+t.write("jamfile.jam", """
+# See if default value of composite feature 'cf' will be expanded to
+# <define>CF_IS_OFF.
exe a : a.cpp ;
# See if subfeature in requirements in expanded.
exe b : b.cpp : <cf>on-1 ;
# See if conditional requirements are recursively expanded.
-exe c : c.cpp : <toolset>$toolset:<variant>release <variant>release:<define>FOO ;
+exe c : c.cpp : <toolset>$toolset:<variant>release <variant>release:<define>FOO
+ ;
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
import feature ;
-
feature.feature cf : off on : composite incidental ;
-
feature.compose <cf>off : <define>CF_IS_OFF ;
-
feature.subfeature cf on : version : 1 2 : composite optional incidental ;
-
feature.compose <cf-on:version>1 : <define>CF_1 ;
-
""")
-t.expand_toolset("Jamfile")
+t.expand_toolset("jamfile.jam")
t.run_build_system()
t.expect_addition(["bin/$toolset/debug/a.exe",
"bin/$toolset/debug/b.exe",
- "bin/$toolset/release/c.exe",
- ])
+ "bin/$toolset/release/c.exe"])
t.rm("bin")
-# Test for issue BB60
+
+# Test for issue BB60.
+
t.write("test.cpp", """
#include "header.h"
int main() { return 0; }
""")
-t.write("Jamfile", """
-project
- : requirements <toolset>$toolset:<include>foo
- ;
+
+t.write("jamfile.jam", """
+project : requirements <toolset>$toolset:<include>foo ;
exe test : test.cpp : <toolset>$toolset ;
""")
-t.expand_toolset("Jamfile")
-t.write("foo/header.h", """
-""")
-t.write("project-root.jam", "")
+
+t.expand_toolset("jamfile.jam")
+t.write("foo/header.h", "\n")
+t.write("jamroot.jam", "")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/test.exe")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/explicit.py
==============================================================================
--- trunk/tools/build/v2/test/explicit.py (original)
+++ trunk/tools/build/v2/test/explicit.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,32 +4,26 @@
# 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)
-# This file is template for Boost.Build tests. It creates a simple
-# project that builds one exe from one source, and checks that the exe
-# is really created.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
-
explicit hello2 ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() {}
""")
t.run_build_system()
t.ignore("*.tds")
-t.expect_addition(List("bin/$toolset/debug/hello") * [".exe", ".obj"])
+t.expect_addition(BoostBuild.List("bin/$toolset/debug/hello") * \
+ [".exe", ".obj"])
t.expect_nothing_more()
t.run_build_system("hello2")
@@ -38,21 +32,21 @@
t.rm(".")
-# Test that 'explicit' used in a helper rule applies to the current project,
-# and not to the Jamfile where the helper rule is defined.
-t.write("Jamroot", """
+# Test that 'explicit' used in a helper rule applies to the current project, and
+# not to the Jamfile where the helper rule is defined.
+t.write("jamroot.jam", """
rule myinstall ( name : target )
{
install $(name)-bin : $(target) ;
explicit $(name)-bin ;
alias $(name) : $(name)-bin ;
-}
+}
""")
-t.write("sub/a.cpp", """
+t.write("sub/a.cpp", """
""")
-t.write("sub/Jamfile", """
+t.write("sub/jamfile.jam", """
myinstall dist : a.cpp ;
""")
@@ -61,14 +55,12 @@
t.rm("sub/dist-bin")
-t.write("sub/Jamfile", """
+t.write("sub/jamfile.jam", """
myinstall dist : a.cpp ;
explicit dist ;
-
""")
t.run_build_system(subdir="sub")
t.expect_nothing_more()
-
t.cleanup()
Modified: trunk/tools/build/v2/test/file_name_handling.py
==============================================================================
--- trunk/tools/build/v2/test/file_name_handling.py (original)
+++ trunk/tools/build/v2/test/file_name_handling.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -33,10 +33,9 @@
# prepare_file()
# --------------
#
-#
################################################################################
-def prepare_file(tester, target_name, age_in_seconds = 0):
+def prepare_file(tester, target_name, age_in_seconds=0):
"""Prepares a new file with the given name, optionally setting its last
access and modification timestamps to the given number of seconds in the
history.
Modified: trunk/tools/build/v2/test/free_features_request.py
==============================================================================
--- trunk/tools/build/v2/test/free_features_request.py (original)
+++ trunk/tools/build/v2/test/free_features_request.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,29 +1,26 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2007.
-# 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)
+# Copyright (C) Vladimir Prus 2007.
+# 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)
-# Tests that a free feature specified on the command
-# line applies to all targets ever built.
-from BoostBuild import Tester, List
+# Tests that a free feature specified on the command line applies to all targets
+# ever built.
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe hello : hello.cpp foo ;
lib foo : foo.cpp ;
""")
+
t.write("hello.cpp", """
extern void foo();
#ifdef FOO
-int main()
-{
- foo();
- return 0;
-}
+int main() { foo(); }
#endif
""")
@@ -36,8 +33,8 @@
#endif
""")
-# If FOO is not defined when compiling the 'foo'
-# target, we'll get a link error at this point.
+# If FOO is not defined when compiling the 'foo' target, we will get a link
+# error at this point.
t.run_build_system("hello define=FOO")
t.expect_addition("bin/$toolset/debug/hello.exe")
Modified: trunk/tools/build/v2/test/gcc_runtime.py
==============================================================================
--- trunk/tools/build/v2/test/gcc_runtime.py (original)
+++ trunk/tools/build/v2/test/gcc_runtime.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,28 +4,28 @@
# 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)
-# Tests that on gcc, we correctly report problem when static runtime
-# is requested when building DLL.
-from BoostBuild import Tester, List
+# Tests that on gcc, we correctly report problem when static runtime is
+# requested for building a shared library.
+
+import BoostBuild
import string
-t = Tester()
+t = BoostBuild.Tester()
+
+# Create the needed files.
+t.write("jamroot.jam", "")
-# Create the needed files
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
lib hello : hello.cpp ;
""")
+
t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+int main() { }
""")
t.run_build_system("runtime-link=static", status=1)
t.fail_test(string.find(t.stdout(),
- "On gcc, DLL can't be build with '<runtime-link>static'") == -1)
+ "On gcc, DLL can't be build with '<runtime-link>static'") == -1)
t.run_build_system("link=static runtime-link=static")
t.expect_addition("bin/$toolset/debug/link-static/runtime-link-static/hello.lib")
Deleted: trunk/tools/build/v2/test/generators-test/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/generators-test/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,19 +0,0 @@
-# Copyright 2002, 2003, 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)
-
-
-project
- # This is needed to supress gcc warning on flex output, which otherwise
- # results in test failure
- : requirements <define>YY_NO_UNPUT
- ;
-
-exe a : a.cpp b.cxx obj_1 obj_2 c.tui d.wd x.l y.x_pro lib//auxilliary ;
-# This should not cause second compilation of a.cpp
-exe f : a.cpp b.cxx obj_1 obj_2 lib//auxilliary ;
-
-obj obj_1 : z.cpp : <define>SELECT=1 ;
-obj obj_2 : z.cpp : <define>SELECT=2 ;
-
-nm-exe e : e.cpp ;
Deleted: trunk/tools/build/v2/test/generators-test/lib/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/generators-test/lib/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2002 Dave Abrahams
-# Copyright 2002 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)
-
-
-static-lib auxilliary : c.cpp ;
-
-lib auxilliary2 : c.cpp ;
Deleted: trunk/tools/build/v2/test/generators-test/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/generators-test/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,95 +0,0 @@
-# Copyright 2002, 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)
-
-
-import "class" : new ;
-
-import lex ;
-import qt ;
-import extra ;
-
-import type ;
-
-type.register tUI : tui ;
-type.register tUIC_H ;
-type.set-generated-target-suffix tUIC_H : : h ;
-
-type.register X1 : x1 ;
-type.register X2 : x2 ;
-type.register X_PRO : x_pro ;
-
-import generators ;
-
-generators.register-standard qt.uic : tUI tUIC_H : CPP ;
-generators.register-standard qt.uic-h : tUI : tUIC_H ;
-
-# That's an interesting example. Currently, X_PRO will be processed
-# twice.
-generators.register-standard extra.x : X1 X2 : CPP ;
-generators.register-standard extra.x_pro : X_PRO : X1 X2 ;
-
-# The point of this setup of to implement this functionality
-# "When main target type is EST_EXE, build OBJ from CPP-MARKED, not
-# for anything else (like CPP)
-# Unfortunately, this does not really works.
-
-#if $(no-var) {
-import nm ;
-
-type.register CPP_MARKED : marked_cpp : CPP ;
-type.register POSITIONS : positions ;
-type.register NM.TARGET.CPP : target_cpp : CPP ;
-type.register NM_EXE : : EXE ;
-
-generators.register-standard nm.target-source : CPP_MARKED : NM.TARGET.CPP ;
-generators.register-standard nm.cpp-mark : CPP : CPP_MARKED POSITIONS ;
-
-class nm::target::cpp-obj-generator : generator
-{
- rule __init__ ( )
- {
- generator.__init__ nm.target-obj : NM.TARGET.CPP : OBJ ;
- }
-
- rule requirements ( )
- {
- return <main-target-type>NM_EXE ;
- }
-
- # Consider: it it OK to ignore all other generated targets except for the first?
- rule run ( project name ? : properties * : source : multiple ? )
- {
- if [ $(source).type ] = CPP {
- local converted = [ generators.construct $(project) : NM.TARGET.CPP : $(properties) : $(source) ] ;
- if $(converted[1])
- {
- local result = [ generators.construct $(project) : OBJ : $(properties) : $(converted[2]) ] ;
- return $(result) ;
- }
- else
- {
- return ;
- }
- }
- else
- {
- return ;
- }
- }
-}
-
-generators.register [ new nm::target::cpp-obj-generator ] ;
-
-generators.override nm.target-obj : all ;
-
-#}
-
-
-
-
-
-
-
-
-
Modified: trunk/tools/build/v2/test/generators_test.py
==============================================================================
--- trunk/tools/build/v2/test/generators_test.py (original)
+++ trunk/tools/build/v2/test/generators_test.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -10,6 +10,7 @@
t = BoostBuild.Tester()
t.set_tree("generators-test")
+
t.run_build_system()
t.expect_addition( "bin/$toolset/debug/" * BoostBuild.List( "a.obj b.obj c.h "
Modified: trunk/tools/build/v2/test/implicit_dependency.py
==============================================================================
--- trunk/tools/build/v2/test/implicit_dependency.py (original)
+++ trunk/tools/build/v2/test/implicit_dependency.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,20 +1,18 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Test the <implicit-dependency> is respected even if the
-# target referred-to is not build itself, but only referred
-# to by <implicit-dependency>.
+# Test the <implicit-dependency> is respected even if the target referred to is
+# not built itself, but only referred to by <implicit-dependency>.
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
make a.h : : gen-header ;
explicit a.h ;
@@ -37,20 +35,14 @@
}
""")
-t.write("hello.cpp", """
+t.write("hello.cpp", """
#include "a.h"
-
-int main()
-{
- return i;
-}
+int main() { return i; }
""")
-
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/indirect_conditional.py
==============================================================================
--- trunk/tools/build/v2/test/indirect_conditional.py (original)
+++ trunk/tools/build/v2/test/indirect_conditional.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,16 +1,15 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe a1 : a1.cpp : <conditional>@a1-rule ;
rule a1-rule ( properties * )
@@ -21,7 +20,8 @@
}
}
-exe a2 : a2.cpp : <conditional>@$(__name__).a2-rule <variant>debug:<optimization>speed ;
+exe a2 : a2.cpp : <conditional>@$(__name__).a2-rule
+ <variant>debug:<optimization>speed ;
rule a2-rule ( properties * )
{
@@ -31,7 +31,8 @@
}
}
-exe a3 : a3.cpp : <conditional>@$(__name__).a3-rule-1 <conditional>@$(__name__).a3-rule-2 ;
+exe a3 : a3.cpp : <conditional>@$(__name__).a3-rule-1
+ <conditional>@$(__name__).a3-rule-2 ;
rule a3-rule-1 ( properties * )
{
@@ -48,32 +49,26 @@
return <optimization>speed ;
}
}
-
""")
-t.write("a1.cpp", """
+t.write("a1.cpp", """
#ifdef OK
int main() {}
#endif
-
""")
-t.write("a2.cpp", """
+t.write("a2.cpp", """
#ifdef OK
int main() {}
#endif
-
""")
-t.write("a3.cpp", """
+t.write("a3.cpp", """
#ifdef OK
int main() {}
#endif
-
""")
-
-
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a1.exe")
@@ -81,4 +76,3 @@
t.expect_addition("bin/$toolset/debug/optimization-speed/a3.exe")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/inherit_toolset.py
==============================================================================
--- trunk/tools/build/v2/test/inherit_toolset.py (original)
+++ trunk/tools/build/v2/test/inherit_toolset.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,76 +1,59 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-from BoostBuild import Tester, List
-from string import find
+import BoostBuild
+import string
-t = Tester(pass_toolset=0)
+t = BoostBuild.Tester(pass_toolset=0)
-t.write("a.cpp", """
+t.write("a.cpp", """
""")
-t.write("yfc1.jam", """
-import feature : extend ;
-import generators : register-standard ;
+t.write("yfc1.jam", """
+import feature ;
+import generators ;
feature.extend toolset : yfc1 ;
-
-rule init ( )
-{
-}
+rule init ( ) { }
generators.register-standard yfc1.compile : CPP : OBJ : <toolset>yfc1 ;
generators.register-standard yfc1.link : OBJ : EXE : <toolset>yfc1 ;
-actions compile
-{
- yfc1-compile
-}
-
-actions link
-{
- yfc1-link
-}
+actions compile { yfc1-compile }
+actions link { yfc1-link }
""")
-t.write("yfc2.jam", """
-import feature : extend ;
-import toolset : inherit ;
+t.write("yfc2.jam", """
+import feature ;
+import toolset ;
feature.extend toolset : yfc2 ;
toolset.inherit yfc2 : yfc1 ;
+rule init ( ) { }
-rule init ( )
-{
-}
-
-actions link
-{
- yfc2-link
-}
+actions link { yfc2-link }
""")
-t.write("Jamfile", """
-exe a : a.cpp ;
+t.write("jamfile.jam", """
+exe a : a.cpp ;
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
using yfc1 ;
""")
t.run_build_system("-n -d2 yfc1")
-t.fail_test(find(t.stdout(), "yfc1-link") == -1)
+t.fail_test(string.find(t.stdout(), "yfc1-link") == -1)
-# Make sure we don't have to explicit 'use' yfc1.
-t.write("project-root.jam", """
+# Make sure we do not have to explicitly 'use' yfc1.
+t.write("jamroot.jam", """
using yfc2 ;
""")
t.run_build_system("-n -d2 yfc2")
-t.fail_test(find(t.stdout(), "yfc2-link") == -1)
+t.fail_test(string.find(t.stdout(), "yfc2-link") == -1)
t.cleanup()
-
Modified: trunk/tools/build/v2/test/inherited_dependency.py
==============================================================================
--- trunk/tools/build/v2/test/inherited_dependency.py (original)
+++ trunk/tools/build/v2/test/inherited_dependency.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -6,36 +6,36 @@
# accompanying file LICENSE_1_0.txt) or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-from BoostBuild import Tester
+import BoostBuild
-tester = Tester()
+tester = BoostBuild.Tester()
-###############################################################################
+################################################################################
#
# Test without giving the project an explicit id.
#
-###############################################################################
+################################################################################
-tester.write("Jamroot", """
- lib test : test.cpp ;
- project : requirements <library>test ;
- build-project a ;
+tester.write("jamroot.jam", """
+lib test : test.cpp ;
+project : requirements <library>test ;
+build-project a ;
""")
tester.write("test.cpp", """
- #ifdef _WIN32
- __declspec(dllexport)
- #endif
- void foo() {}
+#ifdef _WIN32
+ __declspec(dllexport)
+#endif
+void foo() {}
""")
tester.write("a/test1.cpp", """
- int main() {}
+int main() {}
""")
-tester.write("a/Jamfile", """
- exe test1 : test1.cpp ;
+tester.write("a/jamfile.jam", """
+exe test1 : test1.cpp ;
""")
tester.run_build_system()
@@ -47,11 +47,11 @@
tester.rm("a/bin")
-###############################################################################
+################################################################################
#
# Run the same test from the "a" directory.
#
-###############################################################################
+################################################################################
tester.run_build_system(subdir="a")
@@ -62,16 +62,16 @@
tester.rm("a/bin")
-###############################################################################
+################################################################################
#
# This time, do give the project an id.
#
-###############################################################################
+################################################################################
-tester.write("Jamroot", """
- lib test : test.cpp ;
- project test_project : requirements <library>test ;
- build-project a ;
+tester.write("jamroot.jam", """
+lib test : test.cpp ;
+project test_project : requirements <library>test ;
+build-project a ;
""")
tester.run_build_system()
@@ -83,16 +83,16 @@
tester.rm("a/bin")
-###############################################################################
+################################################################################
#
# Now, give the project an id in its attributes.
#
-###############################################################################
+################################################################################
-tester.write("Jamroot", """
- lib test : test.cpp ;
- project : id test_project : requirements <library>test ;
- build-project a ;
+tester.write("jamroot.jam", """
+lib test : test.cpp ;
+project : id test_project : requirements <library>test ;
+build-project a ;
""")
tester.run_build_system()
@@ -104,16 +104,16 @@
tester.rm("a/bin")
-###############################################################################
+################################################################################
#
# Give the project an id in both ways at once.
#
-###############################################################################
+################################################################################
-tester.write("Jamroot", """
- lib test : test.cpp ;
- project test_project1 : id test_project : requirements <library>test ;
- build-project a ;
+tester.write("jamroot.jam", """
+lib test : test.cpp ;
+project test_project1 : id test_project : requirements <library>test ;
+build-project a ;
""")
tester.run_build_system()
@@ -125,19 +125,19 @@
tester.rm("a/bin")
-###############################################################################
+################################################################################
#
# Test an absolute path in native format.
#
-###############################################################################
+################################################################################
-tester.write("Jamroot", """
- import path ;
- path-constant here : . ;
- current-location =
- [ path.native [ path.root [ path.make $(here) ] [ path.pwd ] ] ] ;
- project test : requirements <source>$(current-location)/a/test1.cpp ;
- exe test : test.cpp ;
+tester.write("jamroot.jam", """
+import path ;
+path-constant here : . ;
+current-location = [ path.native [ path.root [ path.make $(here) ] [ path.pwd ]
+ ] ] ;
+project test : requirements <source>$(current-location)/a/test1.cpp ;
+exe test : test.cpp ;
""")
tester.run_build_system()
@@ -147,18 +147,18 @@
tester.rm("a/bin")
-###############################################################################
+################################################################################
#
# Test an absolute path in canonical format.
#
-###############################################################################
+################################################################################
-tester.write("Jamroot", """
- import path ;
- path-constant here : . ;
- current-location = [ path.root [ path.make $(here) ] [ path.pwd ] ] ;
- project test : requirements <source>$(current-location)/a/test1.cpp ;
- exe test : test.cpp ;
+tester.write("jamroot.jam", """
+import path ;
+path-constant here : . ;
+current-location = [ path.root [ path.make $(here) ] [ path.pwd ] ] ;
+project test : requirements <source>$(current-location)/a/test1.cpp ;
+exe test : test.cpp ;
""")
tester.run_build_system()
@@ -168,35 +168,35 @@
tester.rm("a/bin")
-###############################################################################
+################################################################################
#
# Test dependency properties (e.g. <source>) whose targets are specified using a
# relative path.
#
-###############################################################################
+################################################################################
-# Use Jamroot rather than Jamfile to avoid inheriting the <source> from the
-# parent as that would would make test3 a source of itself.
-tester.write("b/Jamroot", """
- obj test3 : test3.cpp ;
+# Use jamroot.jam rather than jamfile.jam to avoid inheriting the <source> from
+# the parent as that would would make test3 a source of itself.
+tester.write("b/jamroot.jam", """
+obj test3 : test3.cpp ;
""")
tester.write("b/test3.cpp", """
- void bar() {}
+void bar() {}
""")
-tester.write("Jamroot", """
- project test : requirements <source>b//test3 ;
- build-project a ;
+tester.write("jamroot.jam", """
+project test : requirements <source>b//test3 ;
+build-project a ;
""")
-tester.write("a/Jamfile", """
- exe test : test1.cpp ;
+tester.write("a/jamfile.jam", """
+exe test : test1.cpp ;
""")
tester.write("a/test1.cpp", """
- void bar();
- int main() { bar(); }
+void bar();
+int main() { bar(); }
""")
tester.run_build_system()
@@ -205,27 +205,27 @@
tester.rm("bin")
tester.rm("a")
-tester.rm("Jamroot")
+tester.rm("jamroot.jam")
tester.rm("test.cpp")
-###############################################################################
+################################################################################
#
-# Test that source-location is respected
+# Test that source-location is respected.
#
-###############################################################################
+################################################################################
-tester.write("build/Jamroot", """
- project : requirements <source>test.cpp : source-location ../src ;
+tester.write("build/jamroot.jam", """
+project : requirements <source>test.cpp : source-location ../src ;
""")
tester.write("src/test.cpp", """
- int main() {}
+int main() {}
""")
-tester.write("build/a/Jamfile", """
- project : source-location ../../a_src ;
- exe test : test1.cpp ;
+tester.write("build/a/jamfile.jam", """
+project : source-location ../../a_src ;
+exe test : test1.cpp ;
""")
tester.write("a_src/test1.cpp", """
Modified: trunk/tools/build/v2/test/inline.py
==============================================================================
--- trunk/tools/build/v2/test/inline.py (original)
+++ trunk/tools/build/v2/test/inline.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,31 +1,25 @@
#!/usr/bin/python
-# Copyright 2003, 2006 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, 2006 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
project : requirements <link>static ;
-exe a : a.cpp [ lib helper : helper.cpp ] ;
+exe a : a.cpp [ lib helper : helper.cpp ] ;
""")
t.write("a.cpp", """
extern void helper();
-int main()
-{
- return 0;
-}
-
+int main() {}
""")
t.write("helper.cpp", """
-void helper()
-{
-}
+void helper() {}
""")
t.run_build_system()
@@ -37,13 +31,13 @@
t.rm("bin")
-# Now check that inline targets with the same name but
-# present in different places are not confused between
-# each other, and with top-level targets.
-t.write("Jamroot", """
+
+# Now check that inline targets with the same name but present in different
+# places are not confused between each other, and with top-level targets.
+t.write("jamroot.jam", """
project : requirements <link>static ;
exe a : a.cpp [ lib helper : helper.cpp ] ;
-exe a2 : a.cpp [ lib helper : helper.cpp ] ;
+exe a2 : a.cpp [ lib helper : helper.cpp ] ;
""")
t.run_build_system()
@@ -51,9 +45,10 @@
t.expect_addition("bin/$toolset/debug/link-static/a__helper.lib")
t.expect_addition("bin/$toolset/debug/link-static/a2__helper.lib")
-# Check that the 'alias' target does not change name of
-# inline targets, and that inline targets are explicit.
-t.write("Jamroot", """
+
+# Check that the 'alias' target does not change the name of inline targets, and
+# that inline targets are explicit.
+t.write("jamroot.jam", """
project : requirements <link>static ;
alias a : [ lib helper : helper.cpp ] ;
explicit a ;
@@ -67,4 +62,3 @@
t.expect_addition("bin/$toolset/debug/link-static/helper.lib")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/lib_source_property.py
==============================================================================
--- trunk/tools/build/v2/test/lib_source_property.py (original)
+++ trunk/tools/build/v2/test/lib_source_property.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,28 +1,27 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
-
-# Regression test: if a library had no explicit sources, but
-# only <source> properties, it was built as it it were searched
-# library, and the specified sources were not compiled.
-from BoostBuild import Tester, List
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Create a temporary working directory
-t = Tester()
+# Regression test: if a library had no explicit sources, but only <source>
+# properties, it was built as if it were a searched library, and the specified
+# sources were not compiled.
-# Create the needed files
-t.write("Jamroot", """
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
lib a : : <source>a.cpp ;
""")
+
t.write("a.cpp", """
#ifdef _WIN32
__declspec(dllexport)
#endif
void foo() {}
-
""")
t.run_build_system()
@@ -30,8 +29,9 @@
t.rm("bin")
-# Now try with <conditional>
-t.write("Jamroot", """
+
+# Now try with <conditional>.
+t.write("jamroot.jam", """
rule test ( properties * )
{
return <source>a.cpp ;
Modified: trunk/tools/build/v2/test/library_chain.py
==============================================================================
--- trunk/tools/build/v2/test/library_chain.py (original)
+++ trunk/tools/build/v2/test/library_chain.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,34 +1,31 @@
#!/usr/bin/python
-# Copyright 2003, 2004, 2005, 2006 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)
-
-# Test that a chain of libraries work ok, not matter if we use static or
-# shared linking.
-from BoostBuild import Tester, List, get_toolset
+# Copyright 2003, 2004, 2005, 2006 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)
+
+# Test that a chain of libraries works ok, no matter if we use static or shared
+# linking.
+
+import BoostBuild
import string
import os
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamfile", """
-# Stage the binary, so that it will be relinked
-# without hardcode-dll-paths. That will chech that
-# we pass correct -rpath-link, even if not passing
-# -rpath.
+t.write("jamfile.jam", """
+# Stage the binary, so that it will be relinked without hardcode-dll-paths. That
+# will chech that we pass correct -rpath-link, even if not passing -rpath.
stage dist : main ;
-exe main : main.cpp b ;
+exe main : main.cpp b ;
""")
-t.write("main.cpp", """
+t.write("main.cpp", """
void foo();
-
-int main() { foo(); return 0; }
-
+int main() { foo(); }
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
""")
t.write("a/a.cpp", """
@@ -41,26 +38,24 @@
#if defined(_WIN32)
__declspec(dllexport)
#endif
-geek() {}
+geek() {}
""")
-t.write("a/Jamfile", """
-lib a : a.cpp ;
+t.write("a/jamfile.jam", """
+lib a : a.cpp ;
""")
-t.write("b/b.cpp", """
+t.write("b/b.cpp", """
void geek();
-
-void
+void
#if defined(_WIN32)
__declspec(dllexport)
#endif
foo() { geek(); }
-
""")
-t.write("b/Jamfile", """
-lib b : b.cpp ../a//a ;
+t.write("b/jamfile.jam", """
+lib b : b.cpp ../a//a ;
""")
t.run_build_system(stderr=None)
@@ -71,84 +66,92 @@
t.expect_addition("bin/$toolset/debug/link-static/main.exe")
t.rm(["bin", "a/bin", "b/bin"])
-# Check that <library> works for static linking.
-t.write("b/Jamfile", """
-lib b : b.cpp : <library>../a//a ;
+# Check that <library> works for static linking.
+t.write("b/jamfile.jam", """
+lib b : b.cpp : <library>../a//a ;
""")
+
t.run_build_system("link=static")
t.expect_addition("bin/$toolset/debug/link-static/main.exe")
t.rm(["bin", "a/bin", "b/bin"])
-t.write("b/Jamfile", """
-lib b : b.cpp ../a//a/<link>shared : <link>static ;
+
+t.write("b/jamfile.jam", """
+lib b : b.cpp ../a//a/<link>shared : <link>static ;
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.exe")
+
t.rm(["bin", "a/bin", "b/bin"])
-# Test that putting library in sources of a searched library
-# works.
-t.write("Jamfile", """
+
+# Test that putting a library in sources of a searched library works.
+t.write("jamfile.jam", """
exe main : main.cpp png ;
lib png : z : <name>png ;
lib z : : <name>zzz ;
""")
+
t.run_build_system("-a -d+2", status=None, stderr=None)
-# Try to find the "zzz" string either in response file
-# (for Windows compilers), or in standard output.
+# Try to find the "zzz" string either in response file (for Windows compilers),
+# or in the standard output.
rsp = t.adjust_names("bin/$toolset/debug/main.exe.rsp")[0]
-if os.path.exists(rsp) and string.find(open(rsp).read(), "zzz") != -1:
+if os.path.exists(rsp) and ( string.find(open(rsp).read(), "zzz") != -1 ):
pass
elif string.find(t.stdout(), "zzz") != -1:
pass
else:
t.fail_test(1)
-#
-# Test main -> libb -> liba chain
-# in the case where liba is a file, not a Boost.Build target.
-#
+# Test main -> libb -> liba chain in the case where liba is a file and not a
+# Boost.Build target.
t.rm(".")
-t.write("Jamroot", "")
-t.write("a/Jamfile", """
+
+t.write("jamroot.jam", "")
+
+t.write("a/jamfile.jam", """
lib a : a.cpp ;
install dist : a ;
""")
+
t.write("a/a.cpp", """
#if defined(_WIN32)
__declspec(dllexport)
#endif
void a() {}
""")
+
t.run_build_system(subdir="a")
t.expect_addition("a/dist/a.dll")
-if (os.name == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc':
+if ( ( os.name == 'nt' ) or os.uname()[0].lower().startswith('cygwin') ) and \
+ ( BoostBuild.get_toolset() != 'gcc' ):
# This is windows import library -- we know the exact name.
file = "a/dist/a.lib"
else:
file = t.adjust_names(["a/dist/a.dll"])[0]
-t.write("b/Jamfile", """
+t.write("b/jamfile.jam", """
lib b : b.cpp ../%s ;
""" % file)
+
t.write("b/b.cpp", """
#if defined(_WIN32)
__declspec(dllimport)
#endif
void a();
-
#if defined(_WIN32)
__declspec(dllexport)
#endif
void b() { a(); }
""")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe main : main.cpp b//b ;
""")
+
t.write("main.cpp", """
#if defined(_WIN32)
__declspec(dllimport)
@@ -160,6 +163,4 @@
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.exe")
-
-
t.cleanup()
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 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,81 +1,61 @@
#!/usr/bin/python
-# Copyright 2004 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 2004 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)
-from BoostBuild import Tester, List
+# Test that on compilers sensitive to library order on linker's command line, we
+# generate the correct order.
+
+import BoostBuild
import string
-# Test that on compilers which are sensitive to library order on
-# linker's command line, we generate the right order.
-t = Tester()
+t = BoostBuild.Tester()
-t.write("a.cpp", """
+t.write("a.cpp", """
void b();
-
-void a()
-{
- b();
-}
-
+void a() { b(); }
""")
-t.write("b.cpp", """
+t.write("b.cpp", """
void c();
-
-void b()
-{
- c();
-}
+void b() { c(); }
""")
-t.write("c.cpp", """
+t.write("c.cpp", """
void d();
-
-void c()
-{
- 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 ourselfs.
-t.write("Jamfile", """
+# 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", """
exe main : main.cpp libd libc libb liba ;
lib libd : d.cpp ;
lib libc : c.cpp : <link>static <use>libd ;
lib libb : b.cpp : <use>libc ;
lib liba : a.cpp : <use>libb ;
-
""")
-t.write("main.cpp", """
+t.write("main.cpp", """
void a();
-
-int main()
-{
- a();
- return 0;
-}
-
+int main() { a(); }
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.exe")
-# Test the order between searched libraries
-t.write("Jamfile", """
+
+# Test the order between searched libraries.
+t.write("jamfile.jam", """
exe main : main.cpp png z ;
lib png : z : <name>png ;
lib z : : <name>zzz ;
@@ -84,7 +64,7 @@
t.run_build_system("-a -n -d+2")
t.fail_test(string.find(t.stdout(), "png") > string.find(t.stdout(), "zzz"))
-t.write("Jamfile", """
+t.write("jamfile.jam", """
exe main : main.cpp png z ;
lib png : : <name>png ;
lib z : png : <name>zzz ;
@@ -93,12 +73,13 @@
t.run_build_system("-a -n -d+2")
t.fail_test(string.find(t.stdout(), "png") < string.find(t.stdout(), "zzz"))
-# Test the order between prebuilt libraries
+# Test the order between prebuilt libraries.
t.write("first.a", "")
+
t.write("second.a", "")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
exe main : main.cpp first second ;
lib first : second : <file>first.a ;
lib second : : <file>second.a ;
@@ -107,7 +88,7 @@
t.run_build_system("-a -n -d+2")
t.fail_test(string.find(t.stdout(), "first") > string.find(t.stdout(), "second"))
-t.write("Jamfile", """
+t.write("jamfile.jam", """
exe main : main.cpp first second ;
lib first : : <file>first.a ;
lib second : first : <file>second.a ;
@@ -116,7 +97,4 @@
t.run_build_system("-a -n -d+2")
t.fail_test(string.find(t.stdout(), "first") < string.find(t.stdout(), "second"))
-
-
-
t.cleanup()
Modified: trunk/tools/build/v2/test/library_property.py
==============================================================================
--- trunk/tools/build/v2/test/library_property.py (original)
+++ trunk/tools/build/v2/test/library_property.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,28 +1,26 @@
#!/usr/bin/python
-# Copyright 2004 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 2004 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)
-# Test that the <library> property has no effect on "obj" targets.
-# Previously, it affected all targets, so
+# Test that the <library> property has no effect on "obj" targets. Previously,
+# it affected all targets, so
#
-# project : requirements <library>foo ;
-# exe a : a.cpp helper ;
-# obj helper : helper.cpp : <optimization>off ;
+# project : requirements <library>foo ;
+# exe a : a.cpp helper ;
+# obj helper : helper.cpp : <optimization>off ;
#
-# caused 'foo' to be built with and without optimization.
-from BoostBuild import Tester, List
+# caused 'foo' to be built with and without optimization.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
-t.write("Jamfile", """
-project
- : requirements <library>lib//x
- ;
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
+project : requirements <library>lib//x ;
exe a : a.cpp foo ;
-obj foo : foo.cpp : <variant>release ;
+obj foo : foo.cpp : <variant>release ;
""")
t.write("a.cpp", """
@@ -35,9 +33,6 @@
void aux() { gee(); }
""")
-t.write("project-root.jam", """
-""")
-
t.write("lib/x.cpp", """
void
#if defined(_WIN32)
@@ -46,17 +41,16 @@
gee() {}
""")
-t.write("lib/Jamfile", """
+t.write("lib/jamfile.jam", """
lib x : x.cpp ;
""")
-t.write("lib/project-root.jam", """
+t.write("lib/jamroot.jam", """
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
t.expect_nothing("lib/bin/$toolset/release/x.obj")
-t.cleanup()
-
+t.cleanup()
Modified: trunk/tools/build/v2/test/load_dir.py
==============================================================================
--- trunk/tools/build/v2/test/load_dir.py (original)
+++ trunk/tools/build/v2/test/load_dir.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,9 +1,8 @@
#!/usr/bin/python
"""
-Traverses a directory and output the code that would
-create the same directory structure during testing.
-Assumes that the instance of Tester is called 't'.
+Traverses a directory and output the code that would create the same directory
+structure during testing. Assumes that the instance of Tester is called 't'.
"""
import sys
@@ -14,6 +13,7 @@
def usage():
print "usage: load_dir.py directory"
+
def remove_first_component(path):
result = [path]
while 1:
@@ -22,8 +22,7 @@
break
result[:1] = list(s)
return apply(os.path.join, result[1:])
-
-
+
def create_file(arg, dirname, fnames):
for n in fnames:
@@ -35,17 +34,17 @@
print l,
print '\n""")\n'
-header = """#!/usr/bin/python
+
+header = """#!/usr/bin/python
# Copyright (C) FILL SOMETHING HERE 2005.
# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
"""
footer = """
@@ -56,7 +55,8 @@
t.cleanup()
"""
-
+
+
def main():
if len(sys.argv) != 2:
usage()
@@ -69,16 +69,13 @@
if not os.path.isdir(path):
print "Path '%s' is not a directory" % (path,)
-
+
print header
-
+
os.path.walk(path, create_file, None)
print footer
+
if __name__ == '__main__':
main()
-
-
-
-
Modified: trunk/tools/build/v2/test/load_order.py
==============================================================================
--- trunk/tools/build/v2/test/load_order.py (original)
+++ trunk/tools/build/v2/test/load_order.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,71 +5,60 @@
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-# Test that we load parent projects before loading children.
-from BoostBuild import Tester, List
-from string import find
+# Test that we load parent projects before loading children.
-t = Tester()
+import BoostBuild
+import string
-t.write("Jamfile", """
-use-project /child : child ;
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
+use-project /child : child ;
ECHO "Setting parent requirements" ;
-project
- : requirements <define>PASS_THE_TEST
- ;
-
-alias x : child//main ;
+project : requirements <define>PASS_THE_TEST ;
+alias x : child//main ;
""")
-t.write("project-root.jam", """
-""")
-
-t.write("child/Jamfile", """
+t.write("child/jamfile.jam", """
ECHO "Setting child requirements" ;
project /child ;
-
-exe main : main.cpp ;
+exe main : main.cpp ;
""")
-t.write("child/main.cpp", """
+t.write("child/main.cpp", """
#if defined(PASS_THE_TEST)
-int main() { return 0; }
+int main() {}
#endif
-
""")
t.run_build_system()
-
t.expect_addition("child/bin/$toolset/debug/main.exe")
-t.fail_test(find(t.stdout(), "Setting child requirements") <
- find(t.stdout(), "Setting parent requirements"))
+t.fail_test(string.find(t.stdout(), "Setting child requirements") <
+ string.find(t.stdout(), "Setting parent requirements"))
-# Regression test: parent requirements were ignored in some cases
+# Regression test: parent requirements were ignored in some cases.
t.rm(".")
-t.write("Jamroot", """
-build-project src ;
+t.write("jamroot.jam", """
+build-project src ;
""")
-t.write("src/Jamfile", """
-project : requirements <define>EVERYTHING_OK ;
+t.write("src/jamfile.jam", """
+project : requirements <define>EVERYTHING_OK ;
""")
-t.write("src/app/Jamfile", """
-exe test : test.cpp ;
+t.write("src/app/jamfile.jam", """
+exe test : test.cpp ;
""")
-t.write("src/app/test.cpp", """
+t.write("src/app/test.cpp", """
#ifdef EVERYTHING_OK
int main() {}
#endif
-
""")
t.run_build_system(subdir="src/app")
t.expect_addition("src/app/bin/$toolset/debug/test.exe")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/loop.py
==============================================================================
--- trunk/tools/build/v2/test/loop.py (original)
+++ trunk/tools/build/v2/test/loop.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,27 +1,26 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-from BoostBuild import Tester, List
-from string import find
+import BoostBuild
+import string
-t = Tester()
-
-
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
lib main : main.cpp l ;
-lib l : l.cpp main ;
+lib l : l.cpp main ;
""")
t.write("main.cpp", "")
+
t.write("l.cpp", "")
t.run_build_system("--no-error-backtrace", status=1)
-t.fail_test(find(t.stdout(), "error: Recursion in main target references") == -1)
-t.fail_test(find(t.stdout(), "./main ./l ./main") == -1)
+t.fail_test(string.find(t.stdout(),
+ "error: Recursion in main target references") == -1)
+t.fail_test(string.find(t.stdout(), "./main ./l ./main") == -1)
t.cleanup()
Modified: trunk/tools/build/v2/test/m1-01.py
==============================================================================
--- trunk/tools/build/v2/test/m1-01.py (original)
+++ trunk/tools/build/v2/test/m1-01.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,19 +1,18 @@
#!/usr/bin/python
-# Copyright 2002 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 2002 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)
# Test the very basic 'make' functionality.
-from BoostBuild import Tester, List
-
-t = Tester()
-t.set_tree("test1")
+import BoostBuild
+t = BoostBuild.Tester()
-# Check that we can build something
+t.set_tree("test1")
+# Check that we can build something.
t.run_build_system("-sTOOLSET=yfc")
t.expect_addition("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
@@ -33,18 +32,16 @@
a.cpp
""")
-# Check that we have vanilla target names available
-
+# Check that we have vanilla target names available.
t.touch("a.cpp")
t.run_build_system("-sTOOLSET a.obj")
t.expect_touch("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
t.expect_no_modification("bin/a/yfc/debug/runtime-link-dynamic/a")
-# Check that if build request cannot be completely matches, a warning is
-# issued and subvariant with link-compatible properties is used
-
-t.write("Jamfile", t.read("Jamfile2"))
+# Check that if a build request cannot be completely matches, a warning is
+# issued and a subvariant with link-compatible properties is used.
+t.write("jamfile.jam", t.read("jamfile2.jam"))
stdout="""Warning: cannot exactly satisfy request for ./a with properties
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
Using
@@ -54,7 +51,7 @@
t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
# Check that conflicting link-incompatible requirements prevent building.
-t.write("Jamfile", t.read("Jamfile3"))
+t.write("jamfile.jam", t.read("jamfile3.jam"))
stdout="""Warning: cannot satisfy request for ./a with properties
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
Nothing will be built.
@@ -62,4 +59,3 @@
t.run_build_system("-sTOOLSET=yfc", stdout=stdout, status=1)
t.pass_test()
-
Modified: trunk/tools/build/v2/test/m1-02.py
==============================================================================
--- trunk/tools/build/v2/test/m1-02.py (original)
+++ trunk/tools/build/v2/test/m1-02.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,12 +4,13 @@
# 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)
-# Tests that 'make' accepts target from other directories and that
-# build request for those targets can be overriden.
+# Tests that 'make' accepts targets from other directories and that build
+# requests for those targets can be overriden.
-from BoostBuild import Tester, List
+import BoostBuild
+
+t = BoostBuild.Tester()
-t = Tester()
t.set_tree("test1")
t.run_build_system("-sTOOLSET=yfc")
@@ -31,7 +32,6 @@
b.cpp
""")
-
t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
@@ -41,8 +41,7 @@
b.cpp
""")
-# Check that we have vanilla target names available in subdirs
-
+# Check that we have vanilla target names available in subdirs.
t.touch("auxillary/b.cpp")
t.run_build_system("-sTOOLSET b.obj", subdir="auxillary")
t.expect_touch("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj")
@@ -50,9 +49,8 @@
t.expect_no_modification("bin/a/yfc/debug/runtime-link-dynamic/a")
-# Check that we cannot request link-incompatible property for source target
-
-t.write('Jamfile', t.read('Jamfile2'))
+# Check that we can not request link-incompatible property for source target.
+t.write('jamfile.jam', t.read('jamfile2.jam'))
stdout="""Error: subvariant of target ./a with properties
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
requests link-incompatible property
@@ -61,14 +59,15 @@
"""
t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
-# Check that if we request link-compatible property then requirement for
-# the source target will override it, with warning. This is similar to
-# the way build requests are satisfied (see the first test)
-# CONSIDER: should be print the main target which requests this one
-# (and modifies requiremenets)?
-t.write('Jamfile3', t.read('Jamfile3'))
-t.write('auxillary/Jamfile3', t.read('auxillary/Jamfile3'))
+# Check that if we request link-compatible property then requirement for the
+# source target will override it, with a warning. This is similar to the way
+# build requests are satisfied (see the first test).
+#
+# CONSIDER: should be print the main target which requests this one (and
+# modifies requirements)?
+t.write('jamfile.jam', t.read('jamfile3.jam'))
+t.write('auxillary/jamfile.jam', t.read('auxillary/jamfile3.jam'))
stdout="""Warning: cannot exactly satisfy request for auxillary/b.obj with properties
<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
Using
@@ -78,15 +77,14 @@
t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
-# Check for link-incompatible properties
-
-t.write('Jamfile4', t.read('Jamfile4'))
-t.write('auxillary/Jamfile4', t.read('auxillary/Jamfile4'))
+# Check for link-incompatible properties.
+t.write('jamfile.jam', t.read('jamfile4.jam'))
+t.write('auxillary/jamfile.jam', t.read('auxillary/jamfile4.jam'))
stdout="""Warning: cannot satisfy request for auxillary/b.obj with properties
<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
Nothing will be built.
-""")
+"""
+t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
t.pass_test()
-
Modified: trunk/tools/build/v2/test/m1-03.py
==============================================================================
--- trunk/tools/build/v2/test/m1-03.py (original)
+++ trunk/tools/build/v2/test/m1-03.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,16 +1,16 @@
#!/usr/bin/python
-# Copyright 2002 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 2002 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)
-# Tests that we can use objects from other projects
-# (i.e. with other project root)
-# Test also that we can refer to those target using project-id.
+# Tests that we can use objects from other projects, i.e. with other project
+# root. Test also that we can refer to those target using project-id.
-from BoostBuild import Tester, List
+import BoostBuild
+
+t = BoostBuild.Tester()
-t = Tester()
t.set_tree("test1")
t.run_build_system("-sTOOLSET=yfc", subdir="p1")
@@ -39,7 +39,6 @@
a.cpp
""")
-
t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
@@ -55,7 +54,4 @@
# TODO: need to write test cases for referring to targets using project-id.
-
-
t.pass_test()
-
Modified: trunk/tools/build/v2/test/make_rule.py
==============================================================================
--- trunk/tools/build/v2/test/make_rule.py (original)
+++ trunk/tools/build/v2/test/make_rule.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,19 +1,18 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2003, 2006 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 Dave Abrahams
+# Copyright 2003, 2006 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)
-# Test the 'make' rule
+# Test the 'make' rule.
-from BoostBuild import Tester
-from string import find
+import BoostBuild
+import string
-t = Tester(pass_toolset=1)
-
-t.write("Jamroot", """
+t = BoostBuild.Tester(pass_toolset=1)
+t.write("jamroot.jam", """
import feature ;
feature.feature test_feature : : free ;
@@ -30,32 +29,29 @@
t.run_build_system()
t.expect_addition("bin/$toolset/debug/foo.bar")
-t.fail_test(find(t.read("bin/$toolset/debug/foo.bar"), "12345678") == -1)
+t.fail_test(string.find(t.read("bin/$toolset/debug/foo.bar"), "12345678") == -1)
+
-# Regression test. Make sure that if main target requested two times,
-# and build request differ only in incidental properties, the main target
-# if created only once. The bug was discovered by Kirill Lapshin.
-
-t.write("Jamroot", """
-# Make sure that incidental property does not
-# cause second creation of 'hello1.cpp'.
+# Regression test. Make sure that if a main target is requested two times, and
+# build requests differ only in incidental properties, the main target is
+# created only once. The bug was discovered by Kirill Lapshin.
+t.write("jamroot.jam", """
+# Make sure that incidental property does not cause second creation of
+# 'hello1.cpp'.
exe a : dir//hello1.cpp ;
-exe b : dir//hello1.cpp/<hardcode-dll-paths>true ;
+exe b : dir//hello1.cpp/<hardcode-dll-paths>true ;
""")
-t.write("dir/Jamfile", """
+t.write("dir/jamfile.jam", """
import common ;
make hello1.cpp : hello.cpp : common.copy ;
-
""")
t.write("dir/hello.cpp", """
-int main()
-{
- return 1;
-}
+int main() { return 1; }
""")
-# Show only names of the actions.
+
+# Show only action names.
t.run_build_system("-d1 -n")
t.fail_test(t.stdout().count("copy") != 1)
Modified: trunk/tools/build/v2/test/module_actions.py
==============================================================================
--- trunk/tools/build/v2/test/module_actions.py (original)
+++ trunk/tools/build/v2/test/module_actions.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -46,7 +46,7 @@
# Accomodate for that fact.
if os.name != 'nt':
expected_output = re.sub(spaces_re, " ", expected_output)
- expected_output = re.sub(trailing_spaces_re, "\n", expected_output)
+ expected_output = re.sub(trailing_spaces_re, "\n", expected_output)
t.run_build_system(stdout=expected_output)
t.expect_nothing_more()
Modified: trunk/tools/build/v2/test/ndebug.py
==============================================================================
--- trunk/tools/build/v2/test/ndebug.py (original)
+++ trunk/tools/build/v2/test/ndebug.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,35 +1,30 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-# Test that building with optimization brings NDEBUG define, and, more
-# importantly, that dependency targets are built with NDEBUG as well,
-# even if they are not directly requested.
+# Test that building with optimization brings NDEBUG define, and, more
+# importantly, that dependency targets are built with NDEBUG as well, even if
+# they are not directly requested.
+import BoostBuild
-from BoostBuild import Tester, List
+t = BoostBuild.Tester()
-
-t = Tester()
-
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamroot.jam", """
exe hello : hello.cpp lib//lib1 ;
""")
+
t.write("hello.cpp", """
#ifdef NDEBUG
void foo();
-int main()
-{
- foo();
- return 0;
-}
+int main() { foo(); }
#endif
""")
-t.write("lib/Jamfile", """
-lib lib1 : lib1.cpp ;
+
+t.write("lib/jamfile.jam", """
+lib lib1 : lib1.cpp ;
""")
t.write("lib/lib1.cpp", """
#ifdef NDEBUG
@@ -37,10 +32,8 @@
#endif
""")
-# 'release' builds should get NDEBUG define
-# use static linking to avoid messing with
-# imports/exports on windows.
+# 'release' builds should get the NDEBUG define. We use static linking to avoid
+# messing with imports/exports on windows.
t.run_build_system("link=static release")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/no_type.py
==============================================================================
--- trunk/tools/build/v2/test/no_type.py (original)
+++ trunk/tools/build/v2/test/no_type.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,17 +4,18 @@
# 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 we cannot specify targets of unknown type as sources.
-# This is based on the fact that Unix 'ar' will happily consume
-# just about anything.
+# Test that we cannot specify targets of unknown type as sources. This is based
+# on the fact that Unix 'ar' will happily consume just about anything.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", """
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
+import gcc ;
static-lib a : a.foo ;
""")
+
t.write("a.foo", "")
t.run_build_system(status=1)
Modified: trunk/tools/build/v2/test/notfile.py
==============================================================================
--- trunk/tools/build/v2/test/notfile.py (original)
+++ trunk/tools/build/v2/test/notfile.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,22 +1,20 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2005.
-# 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)
+# Copyright (C) Vladimir Prus 2005.
+# 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)
-# Basic tests for the 'notfile' rule.
+# Basic tests for the 'notfile' rule.
-from BoostBuild import Tester, List
+import BoostBuild
import string
import os
-import fnmatch
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
import notfile ;
-
notfile say : "echo hi" ;
exe hello : hello.cpp ;
@@ -26,19 +24,15 @@
{
valgrind $(>)
}
-
""")
t.write("hello.cpp", """
-
#include <iostream>
-
int main()
{
std::cout << "Hello!\\n";
return 1;
}
-
""")
@@ -51,6 +45,4 @@
c = "valgrind " + name
t.expect_output_line(c)
-
t.cleanup()
-
Modified: trunk/tools/build/v2/test/ordered_include.py
==============================================================================
--- trunk/tools/build/v2/test/ordered_include.py (original)
+++ trunk/tools/build/v2/test/ordered_include.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -6,20 +6,18 @@
# accompanying file LICENSE_1_0.txt) or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-from BoostBuild import Tester
+import BoostBuild
-tester = Tester()
+tester = BoostBuild.Tester()
-tester.write("Jamroot", """
- obj test : test.cpp : <include>a&&b ;
+tester.write("jamroot.jam", """
+obj test : test.cpp : <include>a&&b ;
""")
tester.write("test.cpp", """
- #include <test1.hpp>
- #include <test2.hpp>
-
- int main() {
- }
+#include <test1.hpp>
+#include <test2.hpp>
+int main() {}
""")
tester.write("a/test1.hpp", """
Modified: trunk/tools/build/v2/test/ordered_properties.py
==============================================================================
--- trunk/tools/build/v2/test/ordered_properties.py (original)
+++ trunk/tools/build/v2/test/ordered_properties.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,42 +1,30 @@
#!/usr/bin/python
-# Copyright 2004 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)
-
-# This file is template for Boost.Build tests. It creates a simple
-# project that builds one exe from one source, and checks that the exe
-# is really created.
-from BoostBuild import Tester, List
+# Copyright 2004 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)
# This checks that Boost.Build does not reorder <include> properties
# lexicographically.
-t = Tester()
-t.write("a.cpp", """
-#include <a.h>
-
-int main()
-{
- foo();
- return 0;
-}
+import BoostBuild
-""")
+t = BoostBuild.Tester()
-t.write("Jamfile", """
-exe a : a.cpp : <include>d2 <include>d1 ;
+t.write("a.cpp", """
+#include <a.h>
+int main() { foo(); }
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
+exe a : a.cpp : <include>d2 <include>d1 ;
""")
-t.write("d1/a.h", """
+t.write("d1/a.h", """
""")
-t.write("d2/a.h", """
+t.write("d2/a.h", """
inline void foo() {}
-
""")
t.run_build_system()
Modified: trunk/tools/build/v2/test/out_of_tree.py
==============================================================================
--- trunk/tools/build/v2/test/out_of_tree.py (original)
+++ trunk/tools/build/v2/test/out_of_tree.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,41 +1,34 @@
#!/usr/bin/python
-# Copyright (C) FILL SOMETHING HERE 2005.
-# 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)
-
-# Tests that we can build a project when the current directory is outside of
-# that project tree, that is:
-# bjam some_dir
-# works.
-from BoostBuild import Tester, List
+# Copyright (C) FILL SOMETHING HERE 2005.
+# 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)
-# Create a temporary working directory
-t = Tester()
+# Tests that we can build a project when the current directory is outside of
+# that project tree, that is 'bjam some_dir' works.
-# Create the needed files
-t.write("p1/Jamroot", """
+import BoostBuild
+
+# Create a temporary working directory.
+t = BoostBuild.Tester()
+
+# Create the needed files.
+t.write("p1/jamroot.jam", """
exe hello : hello.cpp ;
""")
-t.write("p1/hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("p1/hello.cpp", """
+int main() {}
""")
-t.write("p2/Jamroot", """
+t.write("p2/jamroot.jam", """
exe hello2 : hello.cpp ;
exe hello3 : hello.cpp ;
""")
-t.write("p2/hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("p2/hello.cpp", """
+int main() {}
""")
t.run_build_system("p1 p2//hello3")
Modified: trunk/tools/build/v2/test/path_features.py
==============================================================================
--- trunk/tools/build/v2/test/path_features.py (original)
+++ trunk/tools/build/v2/test/path_features.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,11 +5,12 @@
# 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)
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", "lib a : a.cpp : <include>. ;")
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "import gcc ;")
+t.write("jamfile.jam", "lib a : a.cpp : <include>. ;")
t.write("a.cpp", """
#include <a.h>
void
@@ -20,21 +21,23 @@
""")
t.write("a.h", "//empty file\n")
-t.write("d/Jamfile", "exe b : b.cpp ..//a ; ")
+t.write("d/jamfile.jam", "exe b : b.cpp ..//a ; ")
t.write("d/b.cpp", """
- void foo();
- int main() { foo(); }
+void foo();
+int main() { foo(); }
""")
t.run_build_system(subdir="d")
-# Now test the path features with condition work as well
-t.write("Jamfile", "lib a : a.cpp : <variant>debug:<include>. ;")
+# Now test the path features with condition work as well.
+t.write("jamfile.jam", "lib a : a.cpp : <variant>debug:<include>. ;")
t.rm("bin")
t.run_build_system(subdir="d")
-# Test path features with condtion in usage requirements
-t.write("Jamfile", "lib a : a.cpp : <include>. : : <variant>debug:<include>. ;")
+# Test path features with condition in usage requirements.
+t.write("jamfile.jam", """
+lib a : a.cpp : <include>. : : <variant>debug:<include>. ;
+""")
t.write("d/b.cpp", """
#include <a.h>
void foo();
@@ -43,11 +46,11 @@
t.rm("d/bin")
t.run_build_system(subdir="d")
-# Test that absolute paths inside requirements are ok. The problem
-# appear only when building targets in subprojects.
-t.write("project-root.jam", "")
-t.write("Jamfile", "build-project x ; ")
-t.write("x/Jamfile", """
+# Test that absolute paths inside requirements are ok. The problems appeared
+# only when building targets in subprojects.
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", "build-project x ; ")
+t.write("x/jamfile.jam", """
local pwd = [ PWD ] ;
project : requirements <include>$(pwd)/x/include ;
exe m : m.cpp : <include>$(pwd)/x/include2 ;
@@ -55,7 +58,6 @@
t.write("x/m.cpp", """
#include <h1.hpp>
#include <h2.hpp>
-
int main() {}
""")
t.write("x/include/h1.hpp", "\n")
@@ -66,8 +68,8 @@
# Test that "&&" in path features is handled correctly.
t.rm("bin")
-t.write("Jamfile", "build-project sub ;")
-t.write("sub/Jamfile", """
+t.write("jamfile.jam", "build-project sub ;")
+t.write("sub/jamfile.jam", """
exe a : a.cpp : <include>../h1&&../h2 ;
""")
t.write("sub/a.cpp", """
Modified: trunk/tools/build/v2/test/pch.py
==============================================================================
--- trunk/tools/build/v2/test/pch.py (original)
+++ trunk/tools/build/v2/test/pch.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,63 +1,49 @@
#!/usr/bin/python
-# Copyright 2006 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)
-
-from BoostBuild import Tester, List
-import string
-import os
+# Copyright 2006 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)
-t = Tester()
+import BoostBuild
-t.write("Jamroot", """
-import pch ;
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
+import pch ;
cpp-pch pch : pch.hpp : <toolset>msvc:<source>pch.cpp <include>. ;
-
-exe hello : hello.cpp pch : <include>. ;
+exe hello : hello.cpp pch : <include>. ;
""")
-t.write("pch.hpp.bad", """
-THIS WON'T COMPILE
+t.write("pch.hpp.bad", """
+THIS WILL NOT COMPILE
""")
-# Note that pch.hpp is written after pch.hpp.bad, so its timestamp won't
-# be less than timestamp of pch.hpp.bad.
-t.write("pch.hpp", """
-class TestClass {
+# Note that pch.hpp is written after pch.hpp.bad, so its timestamp will not be
+# less than timestamp of pch.hpp.bad.
+t.write("pch.hpp", """
+class TestClass
+{
public:
- TestClass(int, int) {}
+ TestClass( int, int ) {}
};
-
""")
-
-
-t.write("pch.cpp", """ #include <pch.hpp>
-
+t.write("pch.cpp", """#include <pch.hpp>
""")
-t.write("hello.cpp", """ #include <pch.hpp>
-
-int main()
-{
- TestClass c(1, 2);
- return 0;
-}
-
+t.write("hello.cpp", """#include <pch.hpp>
+int main() { TestClass c(1, 2); }
""")
t.run_build_system()
-
t.expect_addition("bin/$toolset/debug/hello.exe")
-# Now make the header unusable, without changing timestamp.
-# If everything is OK, Boost.Build won't recreate PCH, and
-# compiler will happily use pre-compiled header, not noticing
-# that the real header is bad.
+
+# Now make the header unusable, without changing timestamp. If everything is OK,
+# Boost.Build will not recreate PCH, and compiler will happily use pre-compiled
+# header, not noticing that the real header is bad.
t.copy_preserving_timestamp("pch.hpp.bad", "pch.hpp")
@@ -67,4 +53,3 @@
t.expect_addition("bin/$toolset/debug/hello.obj")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/prebuilt.py
==============================================================================
--- trunk/tools/build/v2/test/prebuilt.py (original)
+++ trunk/tools/build/v2/test/prebuilt.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -6,38 +6,38 @@
# Test that we can use already built sources
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree('prebuilt')
-t.expand_toolset("ext/project-root.jam")
-t.expand_toolset("project-root.jam")
-# First, build the external project
-t.run_build_system("debug release", subdir="ext")
+t.expand_toolset("ext/jamroot.jam")
+t.expand_toolset("jamroot.jam")
-# Then pretend that we don't have the sources for the external project,
-# and can only use compiled binaries
-t.copy("ext/Jamfile2", "ext/Jamfile")
-t.expand_toolset("ext/Jamfile")
-
-# Now check that we can build the main project, and that
-# correct prebuilt file is picked, depending of variant.
-# This also checks that correct includes for prebuilt
-# libraries are used.
+# First, build the external project.
+t.run_build_system("debug release", subdir="ext")
+# Then pretend that we do not have the sources for the external project, and can
+# only use compiled binaries.
+t.copy("ext/jamfile2.jam", "ext/jamfile.jam")
+t.expand_toolset("ext/jamfile.jam")
+
+# Now check that we can build the main project, and that correct prebuilt file
+# is picked, depending of variant. This also checks that correct includes for
+# prebuilt libraries are used.
t.run_build_system("debug release")
t.expect_addition("bin/$toolset/debug/hello.exe")
t.expect_addition("bin/$toolset/release/hello.exe")
t.rm("bin")
-# Now test that prebuilt file specified by absolute name
-# works too.
-t.copy("ext/Jamfile3", "ext/Jamfile")
-t.expand_toolset("ext/Jamfile")
+
+
+# Now test that prebuilt file specified by absolute name works too.
+t.copy("ext/jamfile3.jam", "ext/jamfile.jam")
+t.expand_toolset("ext/jamfile.jam")
t.run_build_system("debug release")
t.expect_addition("bin/$toolset/debug/hello.exe")
t.expect_addition("bin/$toolset/release/hello.exe")
-
t.cleanup()
Deleted: trunk/tools/build/v2/test/prebuilt/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/prebuilt/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2002, 2003 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)
-
-
-project test
- : requirements <variant>release:<define>RELEASE
- ;
-
-use-project /ext : ext ;
-
-exe hello : hello.cpp /ext//a ;
-
Deleted: trunk/tools/build/v2/test/prebuilt/ext/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/prebuilt/ext/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2002 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)
-
-
-project ext
- : requirements <variant>release:<define>RELEASE
- ;
-
-lib a : a.cpp ;
-
-install dist : a : <variant>release:<location>release
- <variant>debug:<location>debug ;
Deleted: trunk/tools/build/v2/test/prebuilt/ext/Jamfile2
==============================================================================
--- trunk/tools/build/v2/test/prebuilt/ext/Jamfile2 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,39 +0,0 @@
-
-import modules ;
-
-local dll-suffix = so ;
-local prefix = "" ;
-if [ modules.peek : OS ] in CYGWIN NT
-{
- if $toolset = gcc
- {
- dll-suffix = dll ;
- }
- else
- {
- dll-suffix = lib ;
- }
-}
-else
-{
- prefix = "lib" ;
-}
-if $toolset = darwin
-{
- dll-suffix = dylib ;
-}
-
-project ext ;
-
-lib a :
- : <file>debug/$(prefix)a.$(dll-suffix) <variant>debug
- :
- : <include>debug
- ;
-
-lib a :
- : <file>release/$(prefix)a.$(dll-suffix) <variant>release
- :
- : <include>release
- ;
-
Deleted: trunk/tools/build/v2/test/prebuilt/ext/Jamfile3
==============================================================================
--- trunk/tools/build/v2/test/prebuilt/ext/Jamfile3 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,46 +0,0 @@
-
-# This Jamfile is the same as Jamfile2, except that
-# it tries to access prebuilt targets using absolute
-# paths. It used to be broken on Windows.
-
-import modules ;
-
-local dll-suffix = so ;
-local prefix = "" ;
-if [ modules.peek : OS ] in CYGWIN NT
-{
- if $toolset = gcc
- {
- dll-suffix = dll ;
- }
- else
- {
- dll-suffix = lib ;
- }
-}
-else
-{
- prefix = "lib" ;
-}
-if $toolset = darwin
-{
- dll-suffix = dylib ;
-}
-
-project ext ;
-
-# Assumed bjam was invoked from the project root
-local pwd = [ PWD ] ;
-
-lib a :
- : <file>$(pwd)/ext/debug/$(prefix)a.$(dll-suffix) <variant>debug
- :
- : <include>debug
- ;
-
-lib a :
- : <file>$(pwd)/ext/release/$(prefix)a.$(dll-suffix) <variant>release
- :
- : <include>release
- ;
-
Deleted: trunk/tools/build/v2/test/prebuilt/ext/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/prebuilt/ext/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-# Copyright 2002, 2004 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)
-
-
Deleted: trunk/tools/build/v2/test/prebuilt/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/prebuilt/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-# Copyright 2002, 2004 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)
-
Modified: trunk/tools/build/v2/test/print.py
==============================================================================
--- trunk/tools/build/v2/test/print.py (original)
+++ trunk/tools/build/v2/test/print.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,12 +5,13 @@
# 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", """
+t.write("jamroot.jam", "import gcc ;")
+
+t.write("jamfile.jam", """
import print ;
print.output foo ;
print.text \\\"Something\\\" ;
@@ -21,7 +22,7 @@
t.run_build_system()
t.expect_content("foo", """\"Something\"""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
import print ;
print.output foo ;
print.text \\\n\\\"Somethingelse\\\" ;
@@ -33,7 +34,7 @@
t.expect_content("foo", """\"Something\"
\"Somethingelse\"""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
import print ;
print.output foo ;
print.text \\\"Different\\\" : true ;
Deleted: trunk/tools/build/v2/test/project-test1/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test1/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,10 +0,0 @@
-# Copyright 2002 Dave Abrahams
-# Copyright 2002 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)
-
-project /boost-build-test-project-1
- : requirements <threading>multi <include>/home/ghost/local/include ;
-
-build-project dir2 ;
-build-project dir ;
Deleted: trunk/tools/build/v2/test/project-test1/dir/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test1/dir/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,10 +0,0 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2002 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)
-
-
-project /boost-build-test-project-1/dir
- : source-location src
- : default-build release
- ;
Deleted: trunk/tools/build/v2/test/project-test1/dir2/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test1/dir2/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2004 Rene Rivera
-# Copyright 2002, 2003 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)
-
-
-project /cool-library
- : requirements <include>/home/ghost/build/boost-cvs
- ;
Deleted: trunk/tools/build/v2/test/project-test1/dir2/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/project-test1/dir2/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-# Copyright 2002 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)
-
Deleted: trunk/tools/build/v2/test/project-test1/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/project-test1/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-# Copyright 2002 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)
-
-
-import builtin ;
Deleted: trunk/tools/build/v2/test/project-test3/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test3/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2002, 2003 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)
-
-
-use-project /lib2 : lib2 ;
-use-project /lib3 : lib3 ;
-
-make a.exe : a.obj lib//b.obj /lib2//c.obj lib2//d.obj lib2/helper//e.obj /lib3//f.obj : yfc-link ;
-make a.obj : a.cpp : yfc-compile ;
-
-build-project lib2 ;
-build-project lib ;
Deleted: trunk/tools/build/v2/test/project-test3/lib/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test3/lib/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2002, 2003 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)
-
-
-use-project /lib2 : ../lib2 ;
-
-make b.obj : b.cpp : yfc-compile ;
-make m.exe : b.obj /lib2//c.obj : yfc-link ;
Deleted: trunk/tools/build/v2/test/project-test3/lib2/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test3/lib2/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,11 +0,0 @@
-# Copyright 2002, 2003 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)
-
-
-project lib2 ;
-use-project /lib2/helper : helper ;
-
-make c.obj : c.cpp : yfc-compile ;
-make d.obj : d.cpp : yfc-compile ;
-make l.exe : c.obj ..//a.obj : yfc-link ;
Deleted: trunk/tools/build/v2/test/project-test3/lib2/helper/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test3/lib2/helper/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2002 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)
-
-
-project lib2/helper ;
-
-make e.obj : e.cpp : yfc-compile ;
-
Deleted: trunk/tools/build/v2/test/project-test3/lib3/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test3/lib3/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,37 +0,0 @@
-# Copyright 2003, 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)
-
-# This project-root.jam also serves the role of Jamfile
-project lib3 ;
-
-use-project /lib2/helper : ../lib2/helper ;
-
-import property ;
-
-rule properties-as-path ( properties * )
-{
- local r ;
- for local p in $(properties)
- {
- if $(p:G) != <action>
- {
- r += $(p) ;
- }
- }
- return [ property.as-path
- [ property.remove incidental : $(r) ] ] ;
-}
-
-rule mfc-compile ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions mfc-compile
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-make f.obj : f.cpp /lib2/helper//e.obj : mfc-compile ;
Deleted: trunk/tools/build/v2/test/project-test3/lib3/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/project-test3/lib3/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-# Copyright 2002 Rene Rivera
-# Copyright 2002, 2003 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)
-
Deleted: trunk/tools/build/v2/test/project-test3/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/project-test3/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,46 +0,0 @@
-# Copyright 2002-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 gcc ;
-import property ;
-
-rule properties-as-path ( properties * )
-{
- local r ;
- for local p in $(properties)
- {
- if $(p:G) != <action>
- {
- r += $(p) ;
- }
- }
- return [ property.as-path
- [ property.remove incidental : $(r) ] ] ;
-}
-
-rule yfc-compile ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions yfc-compile
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-rule yfc-link ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions yfc-link
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-
-IMPORT $(__name__) : yfc-compile yfc-link : : yfc-compile yfc-link ;
Deleted: trunk/tools/build/v2/test/project-test4/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test4/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,11 +0,0 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003 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)
-
-
-project test : requirements <include>everything <threading>single ;
-
-make a.exe : a.obj lib//b.obj/<optimization>speed : yfc-link ;
-make b.exe : a.obj : yfc-link : <define>MACROS ;
-make a.obj : a.cpp : yfc-compile ;
Deleted: trunk/tools/build/v2/test/project-test4/Jamfile3
==============================================================================
--- trunk/tools/build/v2/test/project-test4/Jamfile3 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-
-make a.exe : a.obj lib//b.obj/<optimization>on a_gcc.obj : yfc-link : <toolset>gcc ;
-make a.exe : a.obj lib//b.obj/<optimization>on : yfc-link : <threading>multi ;
-make a.obj : a.cpp : yfc-compile ;
-make a_gcc.obj : a_gcc.cpp : yfc-compile ;
Deleted: trunk/tools/build/v2/test/project-test4/Jamfile4
==============================================================================
--- trunk/tools/build/v2/test/project-test4/Jamfile4 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-
-project test : requirements <include>everything <threading>single ;
-
-build-project lib2 ;
Deleted: trunk/tools/build/v2/test/project-test4/Jamfile5
==============================================================================
--- trunk/tools/build/v2/test/project-test4/Jamfile5 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-
-project test : requirements <include>everything <threading>single ;
-
-make a.exe : a.obj lib//b.obj/<variant>release : yfc-link ;
-make b.exe : a.obj : yfc-link : <define>MACROS ;
-make a.obj : a.cpp : yfc-compile ;
Deleted: trunk/tools/build/v2/test/project-test4/lib/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test4/lib/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-# Copyright 2002 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)
-
-
-make b.obj : b.cpp : yfc-compile ;
Deleted: trunk/tools/build/v2/test/project-test4/lib/Jamfile1
==============================================================================
--- trunk/tools/build/v2/test/project-test4/lib/Jamfile1 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,2 +0,0 @@
-
-make b.obj : b.cpp : yfc-compile ;
Deleted: trunk/tools/build/v2/test/project-test4/lib/Jamfile2
==============================================================================
--- trunk/tools/build/v2/test/project-test4/lib/Jamfile2 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-
-project lib : requirements <threading>multi ;
-
-make b.obj : b.cpp : yfc-compile ;
Deleted: trunk/tools/build/v2/test/project-test4/lib/Jamfile3
==============================================================================
--- trunk/tools/build/v2/test/project-test4/lib/Jamfile3 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,2 +0,0 @@
-
-make b.obj : b.cpp : yfc-compile : <rtti>off ;
Deleted: trunk/tools/build/v2/test/project-test4/lib2/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/project-test4/lib2/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,8 +0,0 @@
-# Copyright 2002 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)
-
-
-project
- : requirements <rtti>off
- ;
Deleted: trunk/tools/build/v2/test/project-test4/lib2/Jamfile2
==============================================================================
--- trunk/tools/build/v2/test/project-test4/lib2/Jamfile2 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-
-project mylib
- : requirements <rtti>off
- ;
Deleted: trunk/tools/build/v2/test/project-test4/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/project-test4/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,47 +0,0 @@
-# Copyright 2002, 2003, 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)
-
-
-import gcc ;
-import property ;
-
-rule properties-as-path ( properties * )
-{
- local r ;
- for local p in $(properties)
- {
- if $(p:G) != <action>
- {
- r += $(p) ;
- }
- }
- return [ property.as-path
- [ property.remove incidental : $(r) ] ] ;
-}
-
-
-rule yfc-compile ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions yfc-compile
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-rule yfc-link ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions yfc-link
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-
-IMPORT $(__name__) : yfc-compile yfc-link : : yfc-compile yfc-link ;
Modified: trunk/tools/build/v2/test/project_dependencies.py
==============================================================================
--- trunk/tools/build/v2/test/project_dependencies.py (original)
+++ trunk/tools/build/v2/test/project_dependencies.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,51 +1,51 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004 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 Dave Abrahams
+# Copyright 2002, 2003, 2004 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)
-# Test that we can specify a dependency property
-# in project requirements, and that it won't
-# cause every main target in the project to
-# be generated in it's own subdirectory.
+# Test that we can specify a dependency property in project requirements, and
+# that it will not cause every main target in the project to be generated in its
+# own subdirectory.
-# The whole test is somewhat moot now.
+# The whole test is somewhat moot now.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "build-project src ;")
+
+t.write("lib/jamfile.jam", "lib lib1 : lib1.cpp ;")
-t.write("Jamroot", "build-project src ;")
-t.write("lib/Jamfile", "lib lib1 : lib1.cpp ;")
t.write("lib/lib1.cpp", """
#ifdef _WIN32
__declspec(dllexport)
#endif
void foo() {}\n
""")
-t.write("src/Jamfile", """
-project
- : requirements <library>../lib//lib1
- ;
-
+
+t.write("src/jamfile.jam", """
+project : requirements <library>../lib//lib1 ;
exe a : a.cpp ;
-exe b : b.cpp ;
+exe b : b.cpp ;
""")
+
t.write("src/a.cpp", """
#ifdef _WIN32
__declspec(dllimport)
#endif
void foo();
-int main() { foo(); return 0; }
+int main() { foo(); }
""")
+
t.copy("src/a.cpp", "src/b.cpp")
t.run_build_system()
-# Test that there's no "main-target-a" part.
+# Test that there is no "main-target-a" part.
# t.expect_addition("src/bin/$toolset/debug/a.exe")
# t.expect_addition("src/bin/$toolset/debug/b.exe")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/project_glob.py
==============================================================================
--- trunk/tools/build/v2/test/project_glob.py (original)
+++ trunk/tools/build/v2/test/project_glob.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,48 +5,41 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-# Test the 'glob' rule in Jamfile context.
-from BoostBuild import Tester, List
-import os
-import string
+# Test the 'glob' rule in Jamfile context.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", """
-""")
+# Create a temporary working directory.
+t = BoostBuild.Tester()
-t.write("Jamfile", """
+t.write("jamroot.jam", """
""")
-t.write("d1/a.cpp", """
-int main() { return 0; }
-
+t.write("d1/a.cpp", """
+int main() {}
""")
-t.write("d1/Jamfile", """
-exe a : [ glob *.cpp ] ../d2/d//l ;
+t.write("d1/jamfile.jam", """
+exe a : [ glob *.cpp ] ../d2/d//l ;
""")
-t.write("d2/d/l.cpp", """
+t.write("d2/d/l.cpp", """
#if defined(_WIN32)
__declspec(dllexport)
void force_import_lib_creation() {}
#endif
""")
-t.write("d2/d/Jamfile", """
-lib l : [ glob *.cpp ] ;
+t.write("d2/d/jamfile.jam", """
+lib l : [ glob *.cpp ] ;
""")
-t.write("d3/d/Jamfile", """
+t.write("d3/d/jamfile.jam", """
exe a : [ glob ../*.cpp ] ;
""")
+
t.write("d3/a.cpp", """
-int main()
-{
- return 0;
-}
+int main() {}
""")
t.run_build_system(subdir="d1")
@@ -56,49 +49,46 @@
t.expect_addition("d3/d/bin/$toolset/debug/a.exe")
t.rm("d2/d/bin")
+
t.run_build_system(subdir="d2/d")
t.expect_addition("d2/d/bin/$toolset/debug/l.dll")
-# Test that when 'source-location' is explicitly-specified
-# glob works relatively to source location
-t.rm("d1")
-t.write("d1/src/a.cpp", """
-int main() { return 0; }
+# Test that when 'source-location' is explicitly-specified glob works relatively
+# to the source location.
+t.rm("d1")
+t.write("d1/src/a.cpp", """
+int main() {}
""")
-t.write("d1/Jamfile", """
+t.write("d1/jamfile.jam", """
project : source-location src ;
-exe a : [ glob *.cpp ] ../d2/d//l ;
+exe a : [ glob *.cpp ] ../d2/d//l ;
""")
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")
-# Test that wildcards can include directories. Also
-# test exclusion patterns.
+# Test that wildcards can include directories. Also test exclusion patterns.
t.rm("d1")
t.write("d1/src/foo/a.cpp", """
void bar();
-int main() { bar(); return 0; }
-
+int main() { bar(); }
""")
t.write("d1/src/bar/b.cpp", """
void bar() {}
-
""")
t.write("d1/src/bar/bad.cpp", """
very bad non-compilable file
""")
-
-t.write("d1/Jamfile", """
+t.write("d1/jamfile.jam", """
project : source-location src ;
-exe a : [ glob foo/*.cpp bar/*.cpp : bar/bad* ] ../d2/d//l ;
+exe a : [ glob foo/*.cpp bar/*.cpp : bar/bad* ] ../d2/d//l ;
""")
t.run_build_system(subdir="d1")
@@ -107,18 +97,20 @@
# Test that 'glob-tree' works.
t.rm("d1/bin/$toolset/debug/a.exe")
-t.write("d1/Jamfile", """
+
+t.write("d1/jamfile.jam", """
project : source-location src ;
-exe a : [ glob-tree *.cpp : bad* ] ../d2/d//l ;
+exe a : [ glob-tree *.cpp : bad* ] ../d2/d//l ;
""")
+
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")
-# Test that directory names in patterns for
-# 'glob-tree' are rejected.
-t.write("d1/Jamfile", """
+
+# Test that directory names in patterns for 'glob-tree' are rejected.
+t.write("d1/jamfile.jam", """
project : source-location src ;
-exe a : [ glob-tree foo/*.cpp bar/*.cpp : bad* ] ../d2/d//l ;
+exe a : [ glob-tree foo/*.cpp bar/*.cpp : bad* ] ../d2/d//l ;
""")
t.run_build_system(subdir="d1", status=1)
@@ -127,51 +119,40 @@
t.rm("d1/src/bar/bad.cpp")
-# Test that 'glob' works with absolute names
+# Test that 'glob' works with absolute names.
t.rm("d1/bin")
-# Note that to get current dir, we use bjam's PWD,
-# not Python's os.getcwd, because the former will
-# always return long path. The latter might return
-# short path, and that will confuse path.glob.
-t.write("d1/Jamfile", """
+# Note that to get current dir, we use bjam's PWD, not Python's os.getcwd(),
+# because the former will always return long path while the latter might return
+# a short path, and that will confuse path.glob.
+t.write("d1/jamfile.jam", """
project : source-location src ;
-local pwd = [ PWD ] ; # Always absolute
-exe a : [ glob $(pwd)/src/foo/*.cpp $(pwd)/src/bar/*.cpp ] ../d2/d//l ;
+local pwd = [ PWD ] ; # Always absolute
+exe a : [ glob $(pwd)/src/foo/*.cpp $(pwd)/src/bar/*.cpp ] ../d2/d//l ;
""")
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")
-# Regression test: glob excludes used to be broken
-# when building from a subdirectory.
+
+# Regression test: glob excludes used to be broken when building from a
+# subdirectory.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
build-project p ;
""")
-t.write("p/p.c", """
-int main()
-{
- return 0;
-}
-
-
+t.write("p/p.c", """
+int main() {}
""")
-t.write("p/p_x.c", """
-int main()
-{
- return 0;
-}
-
+t.write("p/p_x.c", """
+int main() {}
""")
-t.write("p/Jamfile", """
-exe p :
- [ glob *.c : p_x.c ]
- ;
+t.write("p/jamfile.jam", """
+exe p : [ glob *.c : p_x.c ] ;
""")
t.run_build_system(subdir="p")
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 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,26 +4,25 @@
# 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)
-from BoostBuild import Tester, List
-from string import find
+import BoostBuild
+import string
-# Create a temporary working directory
-t = Tester()
+# Create a temporary working directory.
+t = BoostBuild.Tester()
-# Create the needed files
-t.write("project-root.jam", """
+# Create the needed files.
+t.write("jamroot.jam", """
constant FOO : foobar gee ;
ECHO $(FOO) ;
""")
-t.write("Jamfile", """
-""")
t.run_build_system()
-t.fail_test(find(t.stdout(), "foobar gee") == -1)
+t.fail_test(string.find(t.stdout(), "foobar gee") == -1)
# Regression test: when absolute paths were passed to path-constant rule,
-# Boost.Build failed to recognize path as absolute and prepended current dir.
-t.write("project-root.jam", """
+# Boost.Build failed to recognize path as absolute and prepended the current
+# dir.
+t.write("jamroot.jam", """
import path ;
local here = [ path.native [ path.pwd ] ] ;
path-constant HERE : $(here) ;
@@ -34,25 +33,24 @@
EXIT ;
}
""")
-t.write("Jamfile", "")
+t.write("jamfile.jam", "")
t.run_build_system()
-t.write("Jamfile", """
-# This tests that rule 'hello' will be imported
-# to children unlocalized, and will still access
-# variables in this Jamfile
+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 ;
constant FOO : foo ;
rule hello ( ) { ECHO "Hello $(x)" ; }
""")
-t.write("d/Jamfile", """
+t.write("d/jamfile.jam", """
ECHO "d: $(FOO)" ;
constant BAR : bar ;
""")
-t.write("d/d2/Jamfile", """
+t.write("d/d2/jamfile.jam", """
ECHO "d2: $(FOO)" ;
ECHO "d2: $(BAR)" ;
hello ;
Modified: trunk/tools/build/v2/test/project_root_rule.py
==============================================================================
--- trunk/tools/build/v2/test/project_root_rule.py (original)
+++ trunk/tools/build/v2/test/project_root_rule.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,34 +1,29 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2005.
-# 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)
-
-# Tests that we can declare a rule in Jamroot that will be
-# can be called in child Jamfile to declare a target. Specifically
-# test for use of 'glob' in that rule.
-#
+# Copyright (C) Vladimir Prus 2005.
+# 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)
-from BoostBuild import Tester, List
-import string
+# Tests that we can declare a rule in Jamroot that will be can be called in
+# child Jamfile to declare a target. Specifically test for use of 'glob' in that
+# rule.
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
-t.write("Jamroot", """
-project : requirements <link>static ;
-rule my-lib ( name )
-{
- lib $(name) : [ glob *.cpp ] ;
-}
+t.write("jamroot.jam", """
+project : requirements <link>static ;
+rule my-lib ( name ) { lib $(name) : [ glob *.cpp ] ; }
""")
-t.write("sub/a.cpp", """
+t.write("sub/a.cpp", """
""")
-t.write("sub/Jamfile", """
-my-lib foo ;
+t.write("sub/jamfile.jam", """
+my-lib foo ;
""")
@@ -37,4 +32,3 @@
t.expect_addition("sub/bin/$toolset/debug/link-static/foo.lib")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/project_test1.py
==============================================================================
--- trunk/tools/build/v2/test/project_test1.py (original)
+++ trunk/tools/build/v2/test/project_test1.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,16 +5,15 @@
# 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)
-from BoostBuild import Tester
+import BoostBuild
import os
-t = Tester("--build-system=project-test1", boost_build_path='', pass_toolset=0)
-
-# This test does no modifications, so run in in the invocation dir
+t = BoostBuild.Tester("--build-system=project-test1", boost_build_path='',
+ pass_toolset=0)
+# This test does no modifications, so run in in the invocation dir.
os.chdir(t.original_workdir)
-
expected_output1="""Project Roots:
"""
@@ -59,16 +58,16 @@
"""
-# Test that correct project structure is created when jam is invoked
-# outside of the source tree.
+# Test that correct project structure is created when jam is invoked outside of
+# the source tree.
expected = (expected_output1 + expected_output2 + expected_output3) % \
{"root-dir": "project-test1",
"root-dir-prefix": "project-test1/" }
t.run_build_system(stdout=expected)
-# Test that correct project structure is created when jam is invoked
-# at the top of the source tree.
+# Test that correct project structure is created when jam is invoked at the top
+# of the source tree.
expected = (expected_output1 + expected_output3 + expected_output2) % \
{"root-dir": ".",
"root-dir-prefix": "" }
Modified: trunk/tools/build/v2/test/project_test3.py
==============================================================================
--- trunk/tools/build/v2/test/project_test3.py (original)
+++ trunk/tools/build/v2/test/project_test3.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,19 +1,18 @@
#!/usr/bin/python
-# Copyright 2002, 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004, 2006 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 2002, 2003 Dave Abrahams
+# Copyright 2002, 2003, 2004, 2006 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)
-from BoostBuild import Tester, List
+import BoostBuild
import os
-from string import strip
-t = Tester(translate_suffixes=0)
+t = BoostBuild.Tester(translate_suffixes=0)
-# First check some startup
+# First check some startup.
t.set_tree("project-test3")
-os.remove("project-root.jam")
+os.remove("jamroot.jam")
t.run_build_system(status=1, stdout=
"""error: Could not find parent for project at '.'
error: Did not find Jamfile.jam or Jamroot.jam in any parent directory.
@@ -79,7 +78,6 @@
"""$toolset/debug
lib3/f.cpp lib2/helper/bin/$toolset/debug/e.obj
""")
-
t.touch("a.cpp")
t.run_build_system()
@@ -87,11 +85,10 @@
"bin/$toolset/debug/a.exe",
"lib2/bin/$toolset/debug/l.exe"])
-
t.run_build_system(extra_args="release optimization=off,speed")
-t.expect_addition(["bin/$toolset/release/a.exe",
- "bin/$toolset/release/a.obj",
- "bin/$toolset/release/optimization-off/a.exe",
+t.expect_addition(["bin/$toolset/release/a.exe",
+ "bin/$toolset/release/a.obj",
+ "bin/$toolset/release/optimization-off/a.exe",
"bin/$toolset/release/optimization-off/a.obj"])
t.run_build_system(extra_args='--clean-all')
@@ -102,10 +99,9 @@
"lib2/bin/$toolset/debug/c.obj",
"lib2/bin/$toolset/debug/d.obj",
"lib2/bin/$toolset/debug/l.exe",
- "lib3/bin/$toolset/debug/f.obj",
- ])
+ "lib3/bin/$toolset/debug/f.obj"])
-# Now test target ids in command line
+# Now test target ids in command line.
t.set_tree("project-test3")
t.run_build_system("lib//b.obj")
t.expect_addition("lib/bin/$toolset/debug/b.obj")
@@ -119,22 +115,20 @@
t.expect_addition("lib/bin/$toolset/debug/b.obj")
t.expect_nothing_more()
-
t.run_build_system("release lib2/helper//e.obj /lib3//f.obj")
t.expect_addition("lib2/helper/bin/$toolset/release/e.obj")
t.expect_addition("lib3/bin/$toolset/release/f.obj")
t.expect_nothing_more()
-# Test project ids in command line work as well
+# Test project ids in command line work as well.
t.set_tree("project-test3")
t.run_build_system("/lib2")
-t.expect_addition("lib2/bin/$toolset/debug/" * List("c.obj d.obj l.exe"))
+t.expect_addition("lib2/bin/$toolset/debug/" * BoostBuild.List("c.obj d.obj l.exe"))
t.expect_addition("bin/$toolset/debug/a.obj")
t.expect_nothing_more()
-
t.run_build_system("lib")
-t.expect_addition("lib/bin/$toolset/debug/" * List("b.obj m.exe"))
+t.expect_addition("lib/bin/$toolset/debug/" * BoostBuild.List("b.obj m.exe"))
t.expect_nothing_more()
t.cleanup()
Modified: trunk/tools/build/v2/test/project_test4.py
==============================================================================
--- trunk/tools/build/v2/test/project_test4.py (original)
+++ trunk/tools/build/v2/test/project_test4.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,15 +1,13 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004 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)
-
-from BoostBuild import Tester
-import os
-from string import strip, find
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2004 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)
-t = Tester(translate_suffixes=0)
+import BoostBuild
+
+t = BoostBuild.Tester(translate_suffixes=0)
t.set_tree("project-test4")
@@ -40,20 +38,20 @@
"bin/$toolset/debug/a.obj\n"
)
-
-t.copy("lib/Jamfile3", "lib/Jamfile")
+t.copy("lib/jamfile3.jam", "lib/jamfile.jam")
# Link-compatibility check for rtti is disabled...
#t.run_build_system(status=None)
-#t.fail_test(find(t.stdout(),
+#import string
+#t.fail_test(string.find(t.stdout(),
#"""warning: targets produced from b.obj are link incompatible
#warning: with main target a.exe""") !=-0)
-# Test that if we specified composite property in target reference,
-# everything works OK.
+# Test that if we specified composite property in target reference, everything
+# works OK.
-t.copy("lib/Jamfile1", "lib/Jamfile")
-t.copy("Jamfile5", "Jamfile")
+t.copy("lib/jamfile1.jam", "lib/jamfile.jam")
+t.copy("jamfile5.jam", "jamfile.jam")
t.run_build_system()
@@ -64,5 +62,4 @@
"bin/$toolset/debug/a.obj lib/bin/$toolset/release/b.obj\n"
)
-
t.cleanup()
Modified: trunk/tools/build/v2/test/property_expansion.py
==============================================================================
--- trunk/tools/build/v2/test/property_expansion.py (original)
+++ trunk/tools/build/v2/test/property_expansion.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,31 +4,26 @@
# 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)
-from BoostBuild import Tester, List
+# Test that free property inside.
-# Test that free property inside
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "")
-t.write("Jamfile", """
-project ;
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
+project ;
variant debug-AA : debug : <define>AA ;
-
alias all : hello ;
exe hello : hello.cpp ;
explicit hello ;
""")
+
t.write("hello.cpp", """
#ifdef AA
-int main()
-{
- return 0;
-}
+int main() {}
#endif
""")
t.run_build_system("debug-AA")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/qt4.py
==============================================================================
--- trunk/tools/build/v2/test/qt4.py (original)
+++ trunk/tools/build/v2/test/qt4.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,18 +1,19 @@
#!/usr/bin/python
-# (c) Copyright Juergen Hunold 2008
-# Use, modification, and distribution are subject to 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)
+# (c) Copyright Juergen Hunold 2008
+# Use, modification, and distribution are subject to 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 os
-from BoostBuild import Tester
-
-# Run test in real directory in order to find Boost.Test via Boost Top-Level Jamroot
+# Run test in real directory in order to find Boost.Test via Boost Top-Level
+# Jamroot.
qt4_dir = os.getcwd() + "/qt4"
-t = Tester(workdir=qt4_dir)
+t = BoostBuild.Tester(workdir=qt4_dir)
t.run_build_system()
+
t.cleanup()
Deleted: trunk/tools/build/v2/test/qt4/Jamroot
==============================================================================
--- trunk/tools/build/v2/test/qt4/Jamroot 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,56 +0,0 @@
-# (c) Copyright Juergen Hunold 2008
-# Use, modification, and distribution are subject to 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 qt4 ;
-import testing ;
-import cast ;
-
-
-
-if [ qt4.initialized ]
-{
- use-project /boost : ../../../../.. ;
-
- project qttest
- : requirements
- <library>/boost/test//boost_unit_test_framework
- ;
-
- alias qt-tests :
- # Check for explicit libraries, <use>/qt should not link any lib
- [ link-fail qtcorefail.cpp : <use>/qt ]
-
- [ run qtcore.cpp /qt//QtCore ]
- [ run qtsql.cpp /qt//QtSql ]
- [ run qtxml.cpp /qt//QtXml ]
- [ run qtnetwork.cpp /qt//QtNetwork ]
- [ run qtscript.cpp /qt//QtScript ]
- [ run qtxmlpatterns.cpp /qt//QtXmlPatterns ]
-
- # ToDo: runable example code
- [ link qtsvg.cpp /qt//QtSvg ]
- [ link qtgui.cpp /qt//QtGui ]
-
- # Multimedia toolkits.
- [ link qtwebkit.cpp /qt//QtWebKit ]
- [ link phonon.cpp /qt//phonon ]
-
- # Help systems.
- [ link qthelp.cpp /qt//QtHelp ]
- [ link qtassistant.cpp /qt//QtAssistantClient ]
-
- # Check working and disabled Qt3Support
- [ link qt3support.cpp /qt//Qt3Support : <qt3support>on ]
- [ compile-fail qt3support.cpp /qt//Qt3Support : <qt3support>off ]
-
- # Testing using QtTest. Simple sample
- # ToDo: better support for "automoc" aka '#include "qttest.moc"'
- [ run qttest.cpp [ cast _ moccable-cpp : qttest.cpp ] /qt//QtTest ]
-
- : # requirements
- : # default-build
- : # usage-requirements
- ;
-}
Modified: trunk/tools/build/v2/test/railsys.py
==============================================================================
--- trunk/tools/build/v2/test/railsys.py (original)
+++ trunk/tools/build/v2/test/railsys.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,12 +1,12 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("railsys")
t.run_build_system("--v2", subdir="program")
Deleted: trunk/tools/build/v2/test/railsys/libx/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/railsys/libx/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright (c) 2002 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-# Tell that Qt3 should be used. QTDIR will give installation prefix.
-using qt3 ;
-
-
Deleted: trunk/tools/build/v2/test/railsys/libx/src/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/railsys/libx/src/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,19 +0,0 @@
-# Copyright (c) 2003 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-#
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-project libx
- : requirements
- <include>../include
- : usage-requirements
- <include>../include
- ;
-
-
-lib libx : test_libx.cpp ;
Deleted: trunk/tools/build/v2/test/railsys/program/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/railsys/program/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,45 +0,0 @@
-# ================================================================
-#
-# Railsys
-# --------------
-#
-# Copyright (c) 2002 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-#
-# 02/21/02! Jürgen Hunold
-#
-# $Id$
-#
-# ================================================================
-
-local BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
-
-use-project /libx : ../libx/src ;
-
-project program
- : requirements
- <include>$(BOOST_ROOT)
- <threading>multi
- <library>/qt3//qt
- <hardcode-dll-paths>true
- <stdlib>stlport
- <use>/libx
- <library>/libx//libx
-
- : usage-requirements
- <include>$(BOOST_ROOT)
- :
- default-build release
- <threading>multi
- <library>/qt3//qt
- <hardcode-dll-paths>true
- ;
-
-build-project main ;
-
Deleted: trunk/tools/build/v2/test/railsys/program/liba/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/railsys/program/liba/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,14 +0,0 @@
-# Copyright (c) 2003 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-project liba ;
-
-lib liba : test ../include/test_a.h ;
-
-obj test : test_a.cpp : <optimization>off ;
Deleted: trunk/tools/build/v2/test/railsys/program/main/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/railsys/program/main/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,12 +0,0 @@
-# Copyright (c) 2002 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-project main ;
-
-exe test_a : main.cpp ../liba//liba /libx ;
Deleted: trunk/tools/build/v2/test/railsys/program/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/railsys/program/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,14 +0,0 @@
-# Copyright (c) 2002 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-# Tell that Qt3 should be used. QTDIR will give installation prefix.
-using qt3 ;
-
-# Not that good, but sufficient for testing
-using stlport : : /path/to/stlport ;
Modified: trunk/tools/build/v2/test/rebuilds.py
==============================================================================
--- trunk/tools/build/v2/test/rebuilds.py (original)
+++ trunk/tools/build/v2/test/rebuilds.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,10 +1,8 @@
#!/usr/bin/python
-# Copyright 2005 Dave Abrahams
-# 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)
-
-# This tests the typechecking facilities.
+# Copyright 2005 Dave Abrahams
+# 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)
import BoostBuild
Modified: trunk/tools/build/v2/test/regression.py
==============================================================================
--- trunk/tools/build/v2/test/regression.py (original)
+++ trunk/tools/build/v2/test/regression.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,52 +5,45 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-# Test for the regression testing framework.
-from BoostBuild import Tester, List
+# Test for the regression testing framework.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
-t.write("c.cpp", "")
+# Create a temporary working directory.
+t = BoostBuild.Tester()
-t.write("r.cpp", """
+t.write("c.cpp", "\n")
+t.write("r.cpp", """
void helper();
#include <iostream>
-int main(int ac, char* av[])
+int main( int ac, char * av[] )
{
helper();
-
- for (int i = 1; i < ac; ++i)
- std::cout << av[i] << '\\n';
- return 0;
-}
+ for ( int i = 1; i < ac; ++i )
+ std::cout << av[ i ] << '\\n';
+}
""")
-t.write("c-f.cpp", """
-int
+t.write("c-f.cpp", """
+int
""")
-t.write("r-f.cpp", """
-int main()
-{
- return 1;
-}
+t.write("r-f.cpp", """
+int main() { return 1; }
""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
import testing ;
-
compile c.cpp ;
compile-fail c-f.cpp ;
run r.cpp libs//helper : foo bar ;
run-fail r-f.cpp ;
-
""")
-t.write("libs/Jamfile", """
+t.write("libs/jamfile.jam", """
lib helper : helper.cpp ;
""")
@@ -60,10 +53,9 @@
__declspec(dllexport)
#endif
helper() {}
-
""")
-t.write("project-root.jam", "")
+t.write("jamroot.jam", "")
# First test that when outcomes are expected, all .test files are created.
t.run_build_system("hardcode-dll-paths=false", stderr=None, status=None)
@@ -74,28 +66,28 @@
# Make sure args are handled.
t.expect_content("bin/r.test/$toolset/debug/r.output",
- "foo\nbar\n*\nEXIT STATUS: 0*\n",True)
+ "foo\nbar\n*\nEXIT STATUS: 0*\n", True)
# Test that input file is handled as well.
t.write("r.cpp", """
#include <iostream>
#include <fstream>
-int main(int ac, char* av[])
+int main( int ac, char * av[] )
{
- for (int i = 1; i < ac; ++i) {
- std::ifstream ifs(av[i]);
+ for ( int i = 1; i < ac; ++i )
+ {
+ std::ifstream ifs( av[ i ] );
std::cout << ifs.rdbuf();
}
return 0;
-}
+}
""")
t.write("dir/input.txt", "test input")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
import testing ;
-
compile c.cpp ;
obj c-obj : c.cpp ;
compile-fail c-f.cpp ;
@@ -112,9 +104,9 @@
t.expect_addition('bin/$toolset/debug/execution.time')
t.expect_addition('bin/$toolset/debug/compilation.time')
-# Make sure test failures are detected. Reverse expectation and see
-# if .test files are created or not.
-t.write("Jamfile", """
+# Make sure test failures are detected. Reverse expectation and see if .test
+# files are created or not.
+t.write("jamfile.jam", """
import testing ;
compile-fail c.cpp ;
@@ -123,7 +115,7 @@
run r-f.cpp ;
""")
-t.touch(List("c.cpp c-f.cpp r.cpp r-f.cpp"))
+t.touch(BoostBuild.List("c.cpp c-f.cpp r.cpp r-f.cpp"))
t.run_build_system("hardcode-dll-paths=false", stderr=None, status=1)
t.expect_removal("bin/c.test/$toolset/debug/c.test")
Modified: trunk/tools/build/v2/test/relative_sources.py
==============================================================================
--- trunk/tools/build/v2/test/relative_sources.py (original)
+++ trunk/tools/build/v2/test/relative_sources.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,18 +1,19 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2006 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 Dave Abrahams
+# Copyright 2002, 2006 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)
# Test that we can specify sources using relative names.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", "exe a : src/a.cpp ;")
-t.write("src/a.cpp", "int main() { return 0; }\n")
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "import gcc ;")
+t.write("jamfile.jam", "exe a : src/a.cpp ;")
+t.write("src/a.cpp", "int main() {}\n")
t.run_build_system()
Modified: trunk/tools/build/v2/test/remove_requirement.py
==============================================================================
--- trunk/tools/build/v2/test/remove_requirement.py (original)
+++ trunk/tools/build/v2/test/remove_requirement.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,76 +1,58 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
project : requirements <threading>multi <variant>debug:<link>static ;
build-project sub ;
build-project sub2 ;
build-project sub3 ;
-build-project sub4 ;
+build-project sub4 ;
""")
-t.write("sub/Jamfile", """
-exe hello : hello.cpp : -<threading>multi ;
+t.write("sub/jamfile.jam", """
+exe hello : hello.cpp : -<threading>multi ;
""")
-t.write("sub/hello.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("sub/hello.cpp", """
+int main() {}
""")
-t.write("sub2/Jamfile", """
+t.write("sub2/jamfile.jam", """
project : requirements -<threading>multi ;
-exe hello : hello.cpp ;
+exe hello : hello.cpp ;
""")
-t.write("sub2/hello.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("sub2/hello.cpp", """
+int main() {}
""")
-t.write("sub3/hello.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("sub3/hello.cpp", """
+int main() {}
""")
-t.write("sub3/Jamfile", """
-exe hello : hello.cpp : -<variant>debug:<link>static ;
+t.write("sub3/jamfile.jam", """
+exe hello : hello.cpp : -<variant>debug:<link>static ;
""")
-t.write("sub4/hello.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("sub4/hello.cpp", """
+int main() {}
""")
-t.write("sub4/Jamfile", """
+t.write("sub4/jamfile.jam", """
project : requirements -<variant>debug:<link>static ;
-exe hello : hello.cpp ;
+exe hello : hello.cpp ;
""")
-
-
t.run_build_system()
t.expect_addition("sub/bin/$toolset/debug/link-static/hello.exe")
@@ -81,29 +63,22 @@
t.rm(".")
# Now test that path requirements can be removed as well.
-t.write("Jamroot", """
+t.write("jamroot.jam", """
build-project sub ;
-
""")
-t.write("sub/Jamfile", """
+t.write("sub/jamfile.jam", """
project : requirements <include>broken ;
-
-exe hello : hello.cpp : -<include>broken ;
+exe hello : hello.cpp : -<include>broken ;
""")
-t.write("sub/hello.cpp", """
+t.write("sub/hello.cpp", """
#include "math.h"
-
-int main()
-{
- return 0;
-}
-
+int main() {}
""")
-t.write("sub/broken/math.h", """
-Broken
+t.write("sub/broken/math.h", """
+Broken
""")
@@ -112,4 +87,3 @@
t.expect_addition("sub/bin/$toolset/debug/hello.exe")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/resolution.py
==============================================================================
--- trunk/tools/build/v2/test/resolution.py (original)
+++ trunk/tools/build/v2/test/resolution.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,28 +1,27 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2006.
-# 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)
+# Copyright (C) Vladimir Prus 2006.
+# 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)
-# Tests for the target id resolution process.
-from BoostBuild import Tester, List
+# Tests for the target id resolution process.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+# Create a temporary working directory.
+t = BoostBuild.Tester()
# Create the needed files
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe hello : hello.cpp ;
-# This should use the 'hello' target, even if there's
-# 'hello' file in current dir.
+# This should use the 'hello' target, even if there is a 'hello' file in the
+# current dir.
install s : hello : <location>. ;
""")
+
t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+int main() {}
""")
t.run_build_system()
@@ -31,8 +30,8 @@
t.touch("hello.cpp")
t.run_build_system("s")
-# If 'hello' in the 's' target resolved to file in
-# current dir, nothing will be rebuilt.
+# If 'hello' in the 's' target resolved to file in the current dir, nothing will
+# be rebuilt.
t.expect_touch("bin/$toolset/debug/hello.obj")
t.cleanup()
Modified: trunk/tools/build/v2/test/searched_lib.py
==============================================================================
--- trunk/tools/build/v2/test/searched_lib.py (original)
+++ trunk/tools/build/v2/test/searched_lib.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -8,14 +8,16 @@
# Test usage of searched-libs: one which are found via -l
# switch to the linker/compiler.
-from BoostBuild import Tester, get_toolset
-import string
+import BoostBuild
import os
-t = Tester()
+import string
+
+t = BoostBuild.Tester()
+
# To start with, we have to prepare a library to link with.
-t.write("lib/project-root.jam", "")
-t.write("lib/Jamfile", "lib test_lib : test_lib.cpp ;")
+t.write("lib/jamroot.jam", "")
+t.write("lib/jamfile.jam", "lib test_lib : test_lib.cpp ;")
t.write("lib/test_lib.cpp", """
#ifdef _WIN32
__declspec(dllexport)
@@ -26,9 +28,11 @@
t.run_build_system(subdir="lib")
t.expect_addition("lib/bin/$toolset/debug/test_lib.dll")
+
# Auto adjusting of suffixes does not work, since we need to
# change dll to lib.
-if (os.name == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc':
+if ( ( os.name == "nt" ) or os.uname()[0].lower().startswith("cygwin") ) and \
+ ( BoostBuild.get_toolset() != "gcc" ):
t.copy("lib/bin/$toolset/debug/test_lib.implib", "lib/test_lib.implib")
t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll")
else:
@@ -36,9 +40,9 @@
# Test that the simplest usage of searched library works.
-t.write('project-root.jam', '')
-t.write('Jamfile', """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
import path ;
import project ;
@@ -49,26 +53,28 @@
lib helper : helper.cpp test_lib ;
lib test_lib : : <name>test_lib <search>lib ;
""")
+
t.write("main.cpp", """
void helper();
int main() { helper(); return 0; }
""")
+
t.write("helper.cpp", """
void foo();
-
void
#if defined(_WIN32)
__declspec(dllexport)
#endif
helper() { foo(); }
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.exe")
t.rm("bin/$toolset/debug/main.exe")
-# Test that 'unit-test' will correctly add runtime paths
-# to searched libraries.
-t.write('Jamfile', """
+
+# Test that 'unit-test' will correctly add runtime paths to searched libraries.
+t.write("jamfile.jam", """
import path ;
import project ;
@@ -83,44 +89,43 @@
lib helper : helper.cpp test_lib ;
lib test_lib : : <name>test_lib <search>lib ;
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.passed")
t.rm("bin/$toolset/debug/main.exe")
-# Now try using searched lib from static lib. Request shared version
-# of searched lib, since we don't have static one handy.
-t.write('Jamfile', """
+# Now try using searched lib from static lib. Request shared version of searched
+# lib, since we do not have a static one handy.
+t.write("jamfile.jam", """
exe main : main.cpp helper ;
lib helper : helper.cpp test_lib/<link>shared : <link>static ;
lib test_lib : : <name>test_lib <search>lib ;
""")
+
t.run_build_system(stderr=None)
t.expect_addition("bin/$toolset/debug/main.exe")
t.expect_addition("bin/$toolset/debug/link-static/helper.lib")
t.rm("bin/$toolset/debug/main.exe")
-# A regression test: <library>property referring to
-# searched-lib was mishandled. As the result, we were
-# putting target name to the command line!
+# A regression test: <library>property referring to searched-lib was being
+# mishandled. As the result, we were putting target name to the command line!
# Note that
# g++ ...... <.>z
-# works nicely in some cases, sending output from compiler
-# to file 'z'.
-# This problem shows up when searched libs are in usage
-# requirements.
-
-t.write('Jamfile', 'exe main : main.cpp d/d2//a ;')
-t.write('main.cpp',"""
+# works nicely in some cases, sending output from compiler to file 'z'. This
+# problem shows up when searched libs are in usage requirements.
+t.write("jamfile.jam", "exe main : main.cpp d/d2//a ;")
+t.write("main.cpp", """
void foo();
int main() { foo(); return 0; }
-
""")
-t.write('d/d2/Jamfile', """
+
+t.write("d/d2/jamfile.jam", """
lib test_lib : : <name>test_lib <search>../../lib ;
lib a : a.cpp : : : <library>test_lib ;
""")
-t.write('d/d2/a.cpp', """
+
+t.write("d/d2/a.cpp", """
#ifdef _WIN32
__declspec(dllexport) int force_library_creation_for_a;
#endif
@@ -128,39 +133,36 @@
t.run_build_system()
-# A regression test. Searched targets were not associated
-# with any properties. For that reason, if the same searched
-# lib is generated with two different properties, we had an
-# error saying they are actualized to the same Jam target name.
-t.write("project-root.jam", "")
+# A regression test. Searched targets were not associated with any properties.
+# For that reason, if the same searched lib is generated with two different
+# properties, we had an error saying they are actualized to the same Jam target
+# name.
+t.write("jamroot.jam", "")
t.write("a.cpp", "")
-# The 'l' library will be built in two variants:
-# 'debug' (directly requested) and 'release' (requested
-# from 'a').
-t.write("Jamfile", """
+# The 'l' library will be built in two variants: 'debug' (directly requested)
+# and 'release' (requested from 'a').
+t.write("jamfile.jam", """
exe a : a.cpp l/<variant>release ;
-
lib l : : <name>l_d <variant>debug ;
lib l : : <name>l_r <variant>release ;
""")
t.run_build_system("-n")
-# A regression test. Two virtual target with the same properties
-# were created for 'l' target, which caused and error to be reported
-# when actualizing targets. The final error is correct, but we should
-# not create two duplicated targets. Thanks to Andre Hentz
-# for finding this bug.
-t.write("project-root.jam", "")
+
+# A regression test. Two virtual target with the same properties were created
+# for 'l' target, which caused and error to be reported when actualizing
+# targets. The final error is correct, but we should not create two duplicated
+# targets. Thanks to Andre Hentz for finding this bug.
+t.write("jamroot.jam", "")
t.write("a.cpp", "")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
project a : requirements <runtime-link>static ;
-
static-lib a : a.cpp l ;
lib l : : <name>l_f ;
""")
@@ -168,19 +170,22 @@
t.run_build_system("-n")
-# Make sure that plain "lib foobar ; " works.
-t.write("Jamfile", """
+# Make sure plain "lib foobar ; " works.
+t.write("jamfile.jam", """
exe a : a.cpp foobar ;
lib foobar ;
""")
+
t.run_build_system("-n -d2")
t.fail_test(string.find(t.stdout(), "foobar") == -1)
-# Make sure that plain "lib foo bar ; " works.
-t.write("Jamfile", """
+
+# Make sure plain "lib foo bar ; " works.
+t.write("jamfile.jam", """
exe a : a.cpp foo bar ;
lib foo bar ;
""")
+
t.run_build_system("-n -d2")
t.fail_test(string.find(t.stdout(), "foo") == -1)
t.fail_test(string.find(t.stdout(), "bar") == -1)
Modified: trunk/tools/build/v2/test/skipping.py
==============================================================================
--- trunk/tools/build/v2/test/skipping.py (original)
+++ trunk/tools/build/v2/test/skipping.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,40 +1,36 @@
#!/usr/bin/python
-# Copyright 2003 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)
-
-# Test that V2 does not fail gracelessy when any target is skipped.
-from BoostBuild import Tester, List
-
-# Create a temporary working directory
-t = Tester()
-t.write("a.cpp", """
-int main() {}
-""")
+# Copyright 2003 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)
-t.write("b.cpp", """
-int main() {}
-""")
+# Test that V2 does not fail gracelessy when any target is skipped.
+
+import BoostBuild
-t.write("c.cpp", """
-int main() {}
+# Create a temporary working directory.
+t = BoostBuild.Tester()
+
+t.write("a.cpp", """
+int main() {}
""")
-t.write("Jamfile", """
-import feature : feature ;
+t.write("b.cpp", """
+int main() {}
+""")
-feature foo : 1 2 : link-incompatible ;
+t.write("c.cpp", """
+int main() {}
+""")
+t.write("jamroot.jam", """
+import feature ;
+feature.feature foo : 1 2 : link-incompatible ;
exe a : a.cpp : <foo>1 ;
exe b : b.cpp : <foo>2 ;
-exe c : c.cpp ;
-""")
-
-t.write("project-root.jam", """
+exe c : c.cpp ;
""")
t.run_build_system("foo=1")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/sort_rule.py
==============================================================================
--- trunk/tools/build/v2/test/sort_rule.py (original)
+++ trunk/tools/build/v2/test/sort_rule.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -20,7 +20,8 @@
def testSORTCorrectness():
"""Testing that Boost Jam's SORT builtin rule actually sorts correctly.
"""
- t = BoostBuild.Tester("-f test.jam -d1", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("-f test.jam -d1", pass_toolset=False,
+ use_test_config=False)
t.write("test.jam", """
NOCARE all ;
@@ -57,7 +58,8 @@
"""Regression test making sure Boost Jam's SORT builtin rule does not get
quadratic behaviour again in this use case.
"""
- t = BoostBuild.Tester("-f test.jam -d1", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("-f test.jam -d1", pass_toolset=False,
+ use_test_config=False)
f = open(t.workpath("test.jam"), "w")
print >> f, "data = "
Modified: trunk/tools/build/v2/test/source_locations.py
==============================================================================
--- trunk/tools/build/v2/test/source_locations.py (original)
+++ trunk/tools/build/v2/test/source_locations.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -7,45 +7,34 @@
# Test that projects with multiple source-location directories are handled OK.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("Jamroot", """
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
path-constant SRC1 : "./src1" ;
path-constant SRC2 : "./src2" ;
path-constant SRC3 : "./src3" ;
path-constant BUILD : "build" ;
-project
- : requirements
- <include>$(SRC1)/include
- <threading>multi
- : build-dir $(BUILD)
- ;
+project : requirements <include>$(SRC1)/include <threading>multi
+ : build-dir $(BUILD) ;
build-project project1 ;
-
""")
-t.write("project1/Jamfile", """
-project project1
- : source-location $(SRC1)
- $(SRC2)
- $(SRC3)
- ;
-
-SRCS = s1.cpp
- s2.cpp
- testfoo.cpp
- ;
+
+t.write("project1/jamfile.jam", """
+project project1 : source-location $(SRC1) $(SRC2) $(SRC3) ;
+SRCS = s1.cpp s2.cpp testfoo.cpp ;
exe test : $(SRCS) ;
""")
-t.write("src1/s1.cpp", "int main() { return 0; }\n")
+t.write("src1/s1.cpp", "int main() {}\n")
t.write("src2/s2.cpp", "void hello() {}\n")
t.write("src3/testfoo.cpp", "void testfoo() {}\n")
-# This file should not be picked up, because "src2" is before
-# "src3" in the list of source directories.
+# This file should not be picked up, because "src2" is before "src3" in the list
+# of source directories.
t.write("src3/s2.cpp", "void hello() {}\n")
t.run_build_system()
Modified: trunk/tools/build/v2/test/stage.py
==============================================================================
--- trunk/tools/build/v2/test/stage.py (original)
+++ trunk/tools/build/v2/test/stage.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,20 +1,19 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004, 2005, 2006 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 Dave Abrahams
+# Copyright 2002, 2003, 2004, 2005, 2006 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)
-# Test staging
+# Test staging.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
+t = BoostBuild.Tester()
-t.write(
- "Jamfile",
-"""
+t.write("jamroot.jam", "import gcc ;")
+
+t.write("jamfile.jam", """
lib a : a.cpp ;
stage dist : a a.h auxilliary/1 ;
""")
@@ -36,25 +35,21 @@
t.expect_addition(["dist/a.dll", "dist/a.h", "dist/1"])
-# Regression test: the following was causing the "duplicate target name"
-# error.
-t.write(
- "Jamfile",
-"""
+# Regression test: the following was causing the "duplicate target name" error.
+t.write("jamfile.jam", """
project : requirements <hardcode-dll-paths>true ;
lib a : a.cpp ;
stage dist : a a.h auxilliary/1 ;
alias dist-alias : dist ;
""")
+
t.run_build_system()
-# Test the <location> property
-t.write("Jamfile", """
+# Test the <location> property.
+t.write("jamfile.jam", """
lib a : a.cpp ;
-stage dist : a
- : <variant>debug:<location>ds <variant>release:<location>rs
- ;
+stage dist : a : <variant>debug:<location>ds <variant>release:<location>rs ;
""")
t.run_build_system()
@@ -63,62 +58,60 @@
t.run_build_system("release")
t.expect_addition("rs/a.dll")
-# Test the <location> property in subprojects.
-# Thanks to Kirill Lapshin for bug report.
-t.write("project-root.jam", """
+# Test the <location> property in subprojects. Thanks to Kirill Lapshin for the
+# bug report.
+
+t.write("jamroot.jam", """
path-constant DIST : dist ;
""")
-t.write("Jamfile", "build-project d ;")
+t.write("jamfile.jam", "build-project d ;")
-t.write(
- "d/Jamfile",
-"""
+t.write("d/jamfile.jam", """
exe a : a.cpp ;
stage dist : a : <location>$(DIST) ;
""")
-t.write("d/a.cpp", "int main() { return 0;}\n")
+t.write("d/a.cpp", "int main() {}\n")
t.run_build_system()
t.expect_addition("dist/a.exe")
t.rm("dist")
-# Workaround a BIG BUG: the response file is not deleted,
-# even if application *is* deleted. We'll try to use the
-# same response file when building from subdir, with very
-# bad results.
+
+# Workaround a BIG BUG: the response file is not deleted, even if application
+# *is* deleted. We will try to use the same response file when building from
+# subdir, with very bad results.
t.rm("d/bin")
t.run_build_system(subdir="d")
t.expect_addition("dist/a.exe")
# Check that 'stage' does not incorrectly reset target suffixes.
-t.write("a.cpp", """
-int main() {}
+t.write("a.cpp", """
+int main() {}
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
import type ;
type.register MYEXE : : EXE ;
-type.set-generated-target-suffix MYEXE : <optimization>off : myexe ;
+type.set-generated-target-suffix MYEXE : <optimization>off : myexe ;
""")
-# Since <optimization>off is in properties when 'a' is built, and staged,
-# it's suffix should be "myexe".
-t.write("Jamfile", """
+# Since <optimization>off is in properties when 'a' is built, and staged, its
+# suffix should be "myexe".
+t.write("jamfile.jam", """
stage dist : a ;
-myexe a : a.cpp ;
+myexe a : a.cpp ;
""")
t.run_build_system()
t.expect_addition("dist/a.myexe")
# Test 'stage's ability to traverse dependencies.
-t.write("a.cpp", """
-int main() { return 0; }
-
+t.write("a.cpp", """
+int main() {}
""")
t.write("l.cpp", """
@@ -126,43 +119,45 @@
#if defined(_WIN32)
__declspec(dllexport)
#endif
-foo() { }
-
+foo() {}
""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
lib l : l.cpp ;
exe a : a.cpp l ;
-stage dist : a : <install-dependencies>on <install-type>EXE <install-type>LIB ;
+stage dist : a : <install-dependencies>on <install-type>EXE <install-type>LIB ;
""")
-t.write("project-root.jam", "")
+t.write("jamroot.jam", "")
t.rm("dist")
+
t.run_build_system()
t.expect_addition("dist/a.exe")
t.expect_addition("dist/l.dll")
-# Check that <use> properties are ignored the traversing
-# target for staging.
+# Check that <use> properties are ignored the traversing target for staging.
t.copy("l.cpp", "l2.cpp")
+
t.copy("l.cpp", "l3.cpp")
-t.write("Jamfile", """
+
+t.write("jamfile.jam", """
lib l2 : l2.cpp ;
lib l3 : l3.cpp ;
lib l : l.cpp : <use>l2 <dependency>l3 ;
exe a : a.cpp l ;
-stage dist : a : <install-dependencies>on <install-type>EXE <install-type>LIB ;
+stage dist : a : <install-dependencies>on <install-type>EXE <install-type>LIB ;
""")
t.rm("dist")
+
t.run_build_system()
t.expect_addition("dist/l3.dll")
t.expect_nothing("dist/l2.dll")
# Check if <dependency> on 'stage' works.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
stage a1 : a1.txt : <location>dist ;
stage a2 : a2.txt : <location>dist <dependency>a1 ;
""")
@@ -171,77 +166,93 @@
t.run_build_system("a2")
t.expect_addition(["dist/a1.txt", "dist/a2.txt"])
-# Regression test: check if <location>. works
+# Regression test: check that <location>. works.
t.rm(".")
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
stage a1 : d/a1.txt : <location>. ;
""")
+
t.write("d/a1.txt", "")
+
t.run_build_system()
t.expect_addition("a1.txt")
-# Test that relative paths of sources can be preserved
+# Test that relative paths of sources can be preserved.
t.rm(".")
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
install dist : a/b/c.h : <install-source-root>. ;
""")
+
t.write("a/b/c.h", "")
+
t.run_build_system()
t.expect_addition("dist/a/b/c.h")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
install dist : a/b/c.h : <install-source-root>a ;
""")
+
t.write("a/b/c.h", "")
+
t.run_build_system()
t.expect_addition("dist/b/c.h")
t.rm(".")
-t.write("build/Jamroot", """
-install dist : ../a/b/c.h
- : <location>../dist <install-source-root>../a ;
+t.write("build/jamroot.jam", """
+install dist : ../a/b/c.h : <location>../dist <install-source-root>../a ;
""")
+
t.write("a/b/c.h", "")
+
t.run_build_system(subdir="build")
t.expect_addition("dist/b/c.h")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
install dist2 : a/b/c.h : <install-source-root>a ;
""")
+
t.write("a/b/c.h", "")
-t.write("sub/Jamfile", """
+
+t.write("sub/jamfile.jam", """
alias h : ..//dist2 ;
""")
+
t.run_build_system(subdir="sub")
t.expect_addition("dist2/b/c.h")
-# Test that when installing .cpp files, we don't scan
-# include dependencies.
+# Test that when installing .cpp files, we do not scan include dependencies.
t.rm(".")
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
install dist : a.cpp ;
""")
+
t.write("a.cpp", """
#include "a.h"
""")
+
t.write("a.h", "")
+
t.run_build_system()
t.expect_addition("dist/a.cpp")
t.touch("a.h")
+
t.run_build_system()
t.expect_nothing("dist/a.cpp")
-# Test that <name> property works, when there's just
-# one file in sources.
+# Test that <name> property works, when there is just one file in sources.
t.rm(".")
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
install dist : a.cpp : <name>b.cpp ;
""")
+
t.write("a.cpp", "test file")
-t.run_build_system()
+t.run_build_system()
t.expect_addition("dist/b.cpp")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/standalone.py
==============================================================================
--- trunk/tools/build/v2/test/standalone.py (original)
+++ trunk/tools/build/v2/test/standalone.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,29 +1,26 @@
#!/usr/bin/python
-# Copyright 2003 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 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-# Regression tests: standalone project were not able to refer to targets
-# declared in themselfs!
-t.write("a.cpp", """
-int main()
-{
- return 0;
-}
+# Regression tests: standalone project were not able to refer to targets
+# declared in themselves.
+t.write("a.cpp", """
+int main() {}
""")
-t.write("project-root.jam", """
-import standalone ;
+t.write("jamroot.jam", """
+import standalone ;
""")
-t.write("standalone.jam", """
+t.write("standalone.jam", """
import project ;
project.initialize $(__name__) ;
@@ -33,14 +30,13 @@
alias x : $(pwd)/../a.cpp ;
alias runtime : x ;
-
""")
-t.write("sub/Jamfile", """
-stage bin : /standalone//runtime ;
+t.write("sub/jamfile.jam", """
+stage bin : /standalone//runtime ;
""")
t.run_build_system(subdir="sub")
t.expect_addition("sub/bin/a.cpp")
-t.cleanup()
+t.cleanup()
Modified: trunk/tools/build/v2/test/startup_v1.py
==============================================================================
--- trunk/tools/build/v2/test/startup_v1.py (original)
+++ trunk/tools/build/v2/test/startup_v1.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,27 +1,23 @@
#!/usr/bin/python
-# Copyright 2002 Dave Abrahams
-# 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 2002 Dave Abrahams
+# 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)
-from BoostBuild import Tester
+import BoostBuild
import os
import re
-def expect_substring(actual,expected):
+def expect_substring(actual, expected):
return actual.find(expected) != -1
-def match_re(actual,expected):
- return re.match(expected,actual,re.DOTALL) != None
+def match_re(actual, expected):
+ return re.match(expected, actual, re.DOTALL) != None
-# Test the v1 startup behavior
-t = Tester(
- executable='bjam'
- , match=match_re
- , boost_build_path=''
- , pass_toolset=0
- )
+# Test the v1 startup behavior.
+t = BoostBuild.Tester(executable='bjam', match=match_re, boost_build_path='',
+ pass_toolset=0)
t.set_tree('startup')
@@ -29,71 +25,57 @@
# t.run_build_system(
# status=1, stdout="You didn't set BOOST_ROOT", match = expect_substring)
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost\.Build: could not find "boost-build\.jam".'''
- )
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost\.Build: could not find ''' +
+ r'''"boost-build\.jam".''')
os.chdir('no-bootstrap1')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+ r'''.*attempted to load the build system by invoking'''
+ r'''.*'boost-build ;'.*'''
- + r'''but we were unable to find "bootstrap\.jam"'''
- )
+ + r'''but we were unable to find "bootstrap\.jam"''')
# Descend to a subdirectory which /doesn't/ contain a boost-build.jam
# file, and try again to test the crawl-up behavior.
os.chdir('subdir')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+ r'''.*attempted to load the build system by invoking'''
+ r'''.*'boost-build ;'.*'''
- + r'''but we were unable to find "bootstrap\.jam"'''
- )
+ + r'''but we were unable to find "bootstrap\.jam"''')
os.chdir('../../no-bootstrap2')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+ r'''.*attempted to load the build system by invoking'''
+ r'''.*'boost-build \. ;'.*'''
- + r'''but we were unable to find "bootstrap\.jam"'''
- )
+ + r'''but we were unable to find "bootstrap\.jam"''')
os.chdir('../no-bootstrap3')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost.Build
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost.Build
.*boost-build.jam" was found.*
-However, it failed to call the "boost-build" rule'''
- )
+However, it failed to call the "boost-build" rule''')
# test bootstrapping based on BOOST_BUILD_PATH
os.chdir('../bootstrap-env')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=../boost-root -sBOOST_BUILD_PATH=../boost-root/build'
- , stdout = 'build system bootstrapped'
- )
+t.run_build_system(extra_args='-sBOOST_ROOT=../boost-root ' +
+ '-sBOOST_BUILD_PATH=../boost-root/build',
+ stdout='build system bootstrapped')
# test bootstrapping based on an explicit path in boost-build.jam
os.chdir('../bootstrap-explicit')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=../boost-root'
- , stdout = 'build system bootstrapped'
- )
+t.run_build_system(extra_args='-sBOOST_ROOT=../boost-root',
+ stdout='build system bootstrapped')
# test bootstrapping based on BOOST_ROOT
os.chdir('../bootstrap-implicit')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=../boost-root'
- , stdout = 'build system bootstrapped'
- )
+t.run_build_system(extra_args='-sBOOST_ROOT=../boost-root',
+ stdout='build system bootstrapped')
t.cleanup()
Modified: trunk/tools/build/v2/test/startup_v2.py
==============================================================================
--- trunk/tools/build/v2/test/startup_v2.py (original)
+++ trunk/tools/build/v2/test/startup_v2.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,23 +1,20 @@
#!/usr/bin/python
-# Copyright 2002 Dave Abrahams
-# Copyright 2003, 2004 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 2002 Dave Abrahams
+# Copyright 2003, 2004 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)
-from BoostBuild import Tester
+import BoostBuild
import os
import re
+
def match_re(actual,expected):
return re.match(expected,actual,re.DOTALL) != None
-# Test the v1 startup behavior
-t = Tester(
- match= match_re
- , boost_build_path=''
- , pass_toolset=0
- )
+# Test the v1 startup behavior.
+t = BoostBuild.Tester(match=match_re, boost_build_path='', pass_toolset=0)
t.set_tree('startup')
@@ -35,8 +32,8 @@
+ r'''but we were unable to find "bootstrap\.jam"'''
)
-# Descend to a subdirectory which /doesn't/ contain a boost-build.jam
-# file, and try again to test the crawl-up behavior.
+# Descend to a subdirectory which /doesn't/ contain a boost-build.jam file, and
+# try again to test the crawl-up behavior.
os.chdir('subdir')
t.run_build_system(
@@ -66,18 +63,17 @@
However, it failed to call the "boost-build" rule'''
)
-# test bootstrapping based on BOOST_BUILD_PATH
+# Test bootstrapping based on BOOST_BUILD_PATH.
os.chdir('../bootstrap-env')
t.run_build_system(
extra_args = '-sBOOST_BUILD_PATH=../boost-root/build'
, stdout = 'build system bootstrapped'
)
-# test bootstrapping based on an explicit path in boost-build.jam
+# Test bootstrapping based on an explicit path in boost-build.jam.
os.chdir('../bootstrap-explicit')
t.run_build_system(
stdout = 'build system bootstrapped'
)
t.cleanup()
-
Modified: trunk/tools/build/v2/test/suffix.py
==============================================================================
--- trunk/tools/build/v2/test/suffix.py (original)
+++ trunk/tools/build/v2/test/suffix.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,33 +1,32 @@
#!/usr/bin/python
-# Copyright 2003, 2004 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 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-# Regression test: when staging V2 used to change suffixes on targets
-# corresponding to real files.
-t.write("Jamfile", """
+# Regression test: when staging V2 used to change suffixes on targets
+# corresponding to real files.
+t.write("jamfile.jam", """
import type : register ;
register A : a1 a2 a3 ;
-
-stage a : a.a3 ;
+stage a : a.a3 ;
""")
-t.write("project-root.jam", "")
+t.write("jamroot.jam", "")
t.write("a.a3", "")
t.run_build_system()
t.expect_addition("a/a.a3");
-# Regression test: we should be able to specify empty suffix for
-# derived target type, even if base type has non-empty suffix.
+# Regression test: we should be able to specify empty suffix for derived target
+# type, even if base type has non-empty suffix.
t.write("a.cpp", "")
-t.write("suffixes.jam", """
+t.write("suffixes.jam", """
import type ;
import generators ;
import common ;
@@ -46,19 +45,17 @@
{
$(TOUCH) $(<)
}
-
""")
-t.write("project-root.jam", """
-import suffixes ;
+t.write("jamroot.jam", """
+import suffixes ;
""")
-t.write("Jamfile", """
-second a : a.cpp ;
+t.write("jamfile.jam", """
+second a : a.cpp ;
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/svn_tree.py
==============================================================================
--- trunk/tools/build/v2/test/svn_tree.py (original)
+++ trunk/tools/build/v2/test/svn_tree.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -16,8 +16,8 @@
#
######################################################################
-# This file was modified by Vladimir Prus to store modification times in
-# tree nodes.
+# This file was modified by Vladimir Prus to store modification times in tree
+# nodes.
import re
import string
@@ -26,7 +26,6 @@
import stat
-
#========================================================================
# ===> Overview of our Datastructures <===
@@ -498,7 +497,7 @@
def dump_tree(n,indent=""):
"Print out a nice representation of the tree's structure."
- # Code partially stolen from Dave Beazley
+ # Code partially stolen from Dave Beazley.
if n.children is None:
tmp_children = []
else:
@@ -509,12 +508,11 @@
else:
print "%s%s" % (indent, n.name)
- indent = indent.replace("-"," ")
- indent = indent.replace("+"," ")
+ indent = indent.replace("-", " ")
+ indent = indent.replace("+", " ")
for i in range(len(tmp_children)):
c = tmp_children[i]
- if i == len(tmp_children
- )-1:
+ if i == len(tmp_children) - 1:
dump_tree(c,indent + " +-- ")
else:
dump_tree(c,indent + " |-- ")
Modified: trunk/tools/build/v2/test/symlink.py
==============================================================================
--- trunk/tools/build/v2/test/symlink.py (original)
+++ trunk/tools/build/v2/test/symlink.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,36 +1,41 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2003 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 Dave Abrahams
+# Copyright 2003 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)
-# Test the 'symlink' rule
+# Test the 'symlink' rule.
-from BoostBuild import Tester, List
import os
-t = Tester()
+import BoostBuild
+
if os.name != 'posix':
- print "The symlink tests can be run on posix only"
+ print "The symlink tests can be run on posix only."
+ import sys
sys.exit(1)
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", """
+
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "import gcc ;")
+
+t.write("jamfile.jam", """
exe hello : hello.cpp ;
-symlink hello_release : hello/<variant>release ;
+symlink hello_release : hello/<variant>release ;
symlink hello_debug : hello/<variant>debug ;
-symlink links/hello_release : hello/<variant>release ;
+symlink links/hello_release : hello/<variant>release ;
""")
+
t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+int main() {}
""")
t.run_build_system()
-t.expect_addition(List('hello_debug.exe hello_release.exe links/hello_release.exe'))
-
+t.expect_addition([
+ 'hello_debug.exe',
+ 'hello_release.exe',
+ 'links/hello_release.exe'])
t.cleanup()
Modified: trunk/tools/build/v2/test/tag.py
==============================================================================
--- trunk/tools/build/v2/test/tag.py (original)
+++ trunk/tools/build/v2/test/tag.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (C) Pedro Ferreira 2003. Permission to copy, use, modify, sell and
-# distribute this software is granted provided this copyright notice appears in
-# all copies. This software is provided "as is" without express or implied
-# warranty, and with no claim as to its suitability for any purpose.
+# Copyright (C) Pedro Ferreira 2003. Permission to copy, use, modify, sell and
+# distribute this software is granted provided this copyright notice appears in
+# all copies. This software is provided "as is" without express or implied
+# warranty, and with no claim as to its suitability for any purpose.
import BoostBuild
@@ -20,13 +20,13 @@
a dot in their name.
"""
- t.write("version-1.32.0/Jamroot.jam", """
+ t.write("version-1.32.0/jamroot.jam", """
project test : requirements <tag>@$(__name__).tag ;
rule tag ( name : type ? : property-set )
{
# Do nothing, just make sure the rule is invoked OK.
- ECHO "The tag rule was invoked" ;
+ ECHO "The tag rule has been invoked." ;
}
exe a : a.cpp ;
""")
@@ -34,7 +34,7 @@
t.run_build_system(subdir="version-1.32.0")
t.expect_addition("version-1.32.0/bin/$toolset/debug/a.exe")
- t.expect_output_line("The tag rule was invoked")
+ t.expect_output_line("The tag rule has been invoked.")
################################################################################
@@ -48,7 +48,7 @@
"""Basic tag property test.
"""
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import virtual-target ;
rule tag ( name : type ? : property-set )
@@ -78,11 +78,7 @@
""")
t.write("a.cpp", """
-int main()
-{
- return 0;
-}
-
+int main() {}
#ifdef _MSC_VER
__declspec (dllexport) void x () {}
#endif
Modified: trunk/tools/build/v2/test/template.py
==============================================================================
--- trunk/tools/build/v2/test/template.py (original)
+++ trunk/tools/build/v2/test/template.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,41 +1,42 @@
#!/usr/bin/python
-# Copyright (C) FILL SOMETHING HERE 2006.
-# 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)
-
-# This file is template for Boost.Build tests. It creates a simple
-# project that builds one exe from one source, and checks that the exe
-# is really created.
-from BoostBuild import Tester, List
+# Copyright (C) FILL SOMETHING HERE 2006.
+# 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)
-# Create a temporary working directory
-t = Tester()
+# This file is template for Boost.Build tests. It creates a simple project that
+# builds one exe from one source, and checks that the exe is really created.
-# Create the needed files
-t.write("Jamroot", """
+import BoostBuild
+
+
+# Create a temporary working directory.
+t = BoostBuild.Tester()
+
+# Create the needed files.
+t.write("jamroot.jam", """
exe hello : hello.cpp ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
-""")
+t.write("hello.cpp", """
+int main() {}
+"""
+# Run the build.
t.run_build_system()
-# First, create a list of three pathnames
-file_list = List("bin/$toolset/debug/") * List("hello.exe hello.obj")
-# Second, assert that those files were added as result of the last build system invocation.
+# First, create a list of three pathnames.
+file_list = BoostBuild.List("bin/$toolset/debug/") * \
+ BoostBuild.List("hello.exe hello.obj")
+# Second, assert that those files were added as result of the last build system
+# invocation.
t.expect_addition(file_list)
-# Invoke the build system once again
+# Invoke the build system once again.
t.run_build_system("clean")
# Check if the files added previously were removed.
t.expect_removal(file_list)
-# Remove temporary directories
+# Remove temporary directories.
t.cleanup()
Modified: trunk/tools/build/v2/test/test1.py
==============================================================================
--- trunk/tools/build/v2/test/test1.py (original)
+++ trunk/tools/build/v2/test/test1.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -8,8 +8,9 @@
t = BoostBuild.Tester()
-t.write("test.jam","""
-actions unbuilt { } unbuilt all ;
+t.write("test.jam", """
+actions unbuilt { }
+unbuilt all ;
ECHO "Hi" ;
""")
Modified: trunk/tools/build/v2/test/test2.py
==============================================================================
--- trunk/tools/build/v2/test/test2.py (original)
+++ trunk/tools/build/v2/test/test2.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,24 +1,25 @@
#!/usr/bin/python
-# Copyright 2002, 2003 Dave Abrahams
-# Copyright 2002, 2003 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 2002, 2003 Dave Abrahams
+# Copyright 2002, 2003 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)
-from BoostBuild import Tester, List
-from time import sleep
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("test2")
-t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
-file_list = 'bin/foo/$toolset/debug/runtime-link-dynamic/' * List("foo foo.o")
+file_list = 'bin/foo/$toolset/debug/runtime-link-dynamic/' * \
+ BoostBuild.List("foo foo.o")
+
+t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
t.expect_addition(file_list)
-t.write("foo.cpp", "int main(int, char**) { return 0; }\n")
+t.write("foo.cpp", "int main() {}\n")
t.run_build_system("-d2 -sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
t.expect_touch(file_list)
-t.pass_test()
+t.pass_test()
Deleted: trunk/tools/build/v2/test/test2/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/test2/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,8 +0,0 @@
-# Copyright 2002 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)
-
-
-project-root ;
-
-exe foo : foo.cpp ;
Modified: trunk/tools/build/v2/test/test_all.py
==============================================================================
--- trunk/tools/build/v2/test/test_all.py (original)
+++ trunk/tools/build/v2/test/test_all.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -6,17 +6,16 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-import os, sys, string
+import os
+import sys
+import string
import BoostBuild
-from BoostBuild import get_toolset
-# clear environment for testing
-#
-for s in (
- 'BOOST_ROOT','BOOST_BUILD_PATH','JAM_TOOLSET','BCCROOT',
- 'MSVCDir','MSVC','MSVCNT','MINGW','watcom'
- ):
+# Clear environment for testing.
+#
+for s in ('BOOST_ROOT', 'BOOST_BUILD_PATH', 'JAM_TOOLSET', 'BCCROOT', 'MSVCDir',
+ 'MSVC', 'MSVCNT', 'MINGW', 'watcom' ):
try:
del os.environ[s]
except:
@@ -24,12 +23,13 @@
BoostBuild.set_defer_annotations(1)
+
def run_tests(critical_tests, other_tests):
"""Runs first critical tests and then other_tests.
Stops on first error, and write the name of failed test to
- test_results.txt. Critical tests are run in the specified order,
- other tests are run starting with the one that failed the last time.
+ test_results.txt. Critical tests are run in the specified order, other
+ tests are run starting with the one that failed the last time.
"""
last_failed = last_failed_test()
other_tests = reorder_tests(other_tests, last_failed)
@@ -50,17 +50,16 @@
f.write(i)
f.close()
failures_count = failures_count + 1
- # Restore the current directory, which might be changed by the
- # test
+ # Restore the current directory, which might be changed by the test.
os.chdir(invocation_dir)
BoostBuild.flush_annotations();
continue
print "PASSED"
BoostBuild.flush_annotations();
pass_count = pass_count + 1
- sys.stdout.flush() # makes testing under emacs more entertaining.
+ sys.stdout.flush() # Makes testing under emacs more entertaining.
- # Erase the file on success
+ # Erase the file on success.
if failures_count == 0:
open('test_results.txt', 'w')
@@ -80,6 +79,7 @@
except:
return None
+
def reorder_tests(tests, first_test):
try:
n = tests.index(first_test)
@@ -176,26 +176,25 @@
if os.name == 'posix':
tests.append("symlink")
- # On windows, library order is not important, so skip this test
- # Besides, it fails ;-)
- # Further, the test relies on the fact that on Linux, one
- # can build a shared library with unresolved symbols. This is
- # not true on Windows (even with cygwin gcc).
+ # On windows, library order is not important, so skip this test. Besides, it
+ # fails ;-). Further, the test relies on the fact that on Linux, one can
+ # build a shared library with unresolved symbols. This is not true on
+ # Windows (even with cygwin gcc).
if string.find(os.uname()[0], "CYGWIN") == -1:
tests.append("library_order")
-if string.find(get_toolset(), 'gcc') == 0:
+if string.find(BoostBuild.get_toolset(), 'gcc') == 0:
tests.append("gcc_runtime")
-if string.find(get_toolset(), 'gcc') == 0 or string.find(get_toolset(), 'msvc') == 0:
+if ( string.find(BoostBuild.get_toolset(), 'gcc') == 0 )or \
+ ( string.find(BoostBuild.get_toolset(), 'msvc') == 0 ):
tests.append("pch")
if "--extras" in sys.argv:
tests.append("boostbook")
tests.append("qt4")
tests.append("example_qt4")
- # Requires ./whatever.py to work, so is
- # not guaranted to work everywhere.
+ # Requires ./whatever.py to work, so is not guaranted to work everywhere.
tests.append("example_customization")
# Requires gettext tools.
tests.append("example_gettext")
Modified: trunk/tools/build/v2/test/test_system.html
==============================================================================
--- trunk/tools/build/v2/test/test_system.html (original)
+++ trunk/tools/build/v2/test/test_system.html 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -112,12 +112,11 @@
"../../../jam/index.html">$boost_build_root/jam/index.html</a> for
instructions.</li>
- <li>Configure at least one toolset. You can edit
- <tt>site-config.jam</tt> or <tt>user-config.jam</tt> to add new
- toolsets. Or you can create file <tt>test-config.jam</tt> in
- <tt>$boost_build_root/test</tt> directory. In this case,
- <tt>site-config.jam</tt> and <tt>user-config.jam</tt> will be ignored
- for testing.</li>
+ <li>Configure at least one toolset. You can edit <tt>site-config.jam</tt>
+ or <tt>user-config.jam</tt> to add new toolsets. Or you can create file
+ <tt>test-config.jam</tt> in <tt>$boost_build_root/test</tt> directory. In
+ this case, <tt>site-config.jam</tt> and <tt>user-config.jam</tt> will be
+ ignored for testing.</li>
</ol>
<p>When all is set, you can run all the tests using the <tt>test_all.py</tt>
@@ -211,14 +210,14 @@
<p>The "hello.py" module might contain:</p>
<pre class="example">
-from BoostBuild import Tester, List
+from BoostBuild import List
# Create a temporary working directory
-t = Tester()
+t = BoostBuild.Tester()
# Create the needed files
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
exe hello : hello.cpp ;
""")
t.write("hello.cpp", """
Modified: trunk/tools/build/v2/test/testing_primitives.py
==============================================================================
--- trunk/tools/build/v2/test/testing_primitives.py (original)
+++ trunk/tools/build/v2/test/testing_primitives.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,34 +4,27 @@
# 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)
-from BoostBuild import Tester, List
-import os
-from string import strip
+import BoostBuild
import re
-def match_re(actual,expected):
- return re.match(expected,actual,re.DOTALL) != None
+def match_re(actual, expected):
+ return re.match(expected, actual, re.DOTALL) != None
-t = Tester(match = match_re)
+t = BoostBuild.Tester(match=match_re)
t.set_tree('testing-primitives')
-# We expect t5 and t7's output to be dumped to stdout
+# We expect t5 and t7's output to be dumped to stdout.
t.run_build_system(stdout=r'''.*failing t5.*failing t7''')
t.expect_addition('t2.txt')
t.expect_addition('t3.txt')
-
t.expect_addition('t5.out')
-
t.expect_addition('t6.out')
t.expect_addition('t6.txt')
-
t.expect_addition('t7.out')
t.expect_addition('t7.txt')
-
t.expect_addition('t8.out')
-
t.expect_nothing_more()
+
t.cleanup()
-print 'tesing complete'
Modified: trunk/tools/build/v2/test/timedata.py
==============================================================================
--- trunk/tools/build/v2/test/timedata.py (original)
+++ trunk/tools/build/v2/test/timedata.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -40,7 +40,6 @@
echo made from $(>) >> $(<)
}
-
time foo : bar ;
make bar : baz ;
""")
Modified: trunk/tools/build/v2/test/tree.py
==============================================================================
--- trunk/tools/build/v2/test/tree.py (original)
+++ trunk/tools/build/v2/test/tree.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,7 +1,7 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2001, 2002 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 Dave Abrahams
+# Copyright 2001, 2002 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)
# This file is based in part on the content of svn_tree.py.
@@ -20,7 +20,7 @@
self.removed_files.extend(other.removed_files)
self.modified_files.extend(other.modified_files)
self.touched_files.extend(other.touched_files)
-
+
def ignore_directories(self):
"Removes directories for list of found differences"
@@ -33,13 +33,15 @@
def pprint(self, f=None):
print >> f, "Added files :", self.added_files
- print >> f,"Removed files :", self.removed_files
+ print >> f, "Removed files :", self.removed_files
print >> f, "Modified files:", self.modified_files
print >> f, "Touched files :", self.touched_files
def empty(self):
- return (len(self.added_files) == 0 and len(self.removed_files) == 0)\
- and len(self.modified_files) == 0 and len(self.touched_files) == 0
+ return ( len(self.added_files) == 0 ) and \
+ ( len(self.removed_files) == 0 ) and \
+ ( len(self.modified_files) == 0 ) and \
+ ( len(self.touched_files) == 0 )
def build_tree(dir):
return svn_tree.build_tree_from_wc(dir, load_props=0, ignore_svn=1)
Modified: trunk/tools/build/v2/test/unit_test.py
==============================================================================
--- trunk/tools/build/v2/test/unit_test.py (original)
+++ trunk/tools/build/v2/test/unit_test.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,13 +4,14 @@
# 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 the unit_test rule
+# Test the unit_test rule.
+
import BoostBuild
t = BoostBuild.Tester()
# Create the needed files.
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
using testing ;
lib helper : helper.cpp ;
unit-test test : test.cpp : <library>helper ;
Modified: trunk/tools/build/v2/test/unit_tests.py
==============================================================================
--- trunk/tools/build/v2/test/unit_tests.py (original)
+++ trunk/tools/build/v2/test/unit_tests.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -4,9 +4,10 @@
# 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)
-from BoostBuild import Tester
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0)
-t = Tester(pass_toolset=0)
t.run_build_system(extra_args="--debug --build-system=test")
t.cleanup()
Modified: trunk/tools/build/v2/test/unused.py
==============================================================================
--- trunk/tools/build/v2/test/unused.py (original)
+++ trunk/tools/build/v2/test/unused.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -6,26 +6,26 @@
# Test that unused sources are at least reported.
-from BoostBuild import Tester
+import BoostBuild
from string import find
-t = Tester()
+
+t = BoostBuild.Tester()
t.set_tree("unused")
t.run_build_system()
-# The second invocation should do nothing, and produce
-# no warning. The previous invocation might have printed
-# executed actions and other things, so it's not easy
-# to check if warning was issued or not.
+# The second invocation should do nothing, and produce no warning. The previous
+# invocation might have printed executed actions and other things, so it is not
+# easy to check if warning was issued or not.
t.run_build_system()
t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)
t.run_build_system("-sGENERATE_ONLY_UNUSABLE=1")
t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)
-# Now check that even if main target generates nothing, its
-# usage requirements are still propagated to dependents.
-t.write("a.cpp","""
+# Now check that even if main target generates nothing, its usage requirements
+# are still propagated to dependants.
+t.write("a.cpp", """
#ifdef FOO
int main() {}
#endif
@@ -33,4 +33,3 @@
t.run_build_system("-sGENERATE_NOTHING=1")
t.cleanup()
-
Deleted: trunk/tools/build/v2/test/unused/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/unused/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,11 +0,0 @@
-# Copyright 2003 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)
-
-
-exe a : a.cpp b c ;
-
-make-b-main-target ;
-
-# Expands to nothing, intentionally.
-alias c ;
Deleted: trunk/tools/build/v2/test/unused/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/unused/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,57 +0,0 @@
-# Copyright 2003 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)
-
-
-import type ;
-import generators ;
-import print ;
-import virtual-target ;
-import "class" : new ;
-import modules ;
-import targets ;
-
-
-type.register X : x ;
-
-class test-target-class : basic-target
-{
- rule __init__ ( name : project )
- {
- basic-target.__init__ $(name) : $(project) ;
- }
-
- rule construct ( source-targets * : property-set )
- {
- if [ modules.peek : GENERATE_NOTHING ]
- {
- return ;
- }
- else if [ modules.peek : GENERATE_ONLY_UNUSABLE ]
- {
- return [ virtual-target.from-file b.x : $(self.project) ]
- ;
- }
- else
- {
- return [ virtual-target.from-file b.x : $(self.project) ]
- [ virtual-target.from-file b.cpp : $(self.project) ]
- ;
- }
- }
-
- rule compute-usage-requirements ( rproperties : targets * )
- {
- return [ property-set.create <define>FOO ] ;
- }
-}
-
-rule make-b-main-target
-{
- local project = [ CALLER_MODULE ] ;
-
- targets.main-target-alternative
- [ new test-target-class b : $(project) ] ;
-}
-
-IMPORT $(__name__) : make-b-main-target : : make-b-main-target ;
Modified: trunk/tools/build/v2/test/use_requirements.py
==============================================================================
--- trunk/tools/build/v2/test/use_requirements.py (original)
+++ trunk/tools/build/v2/test/use_requirements.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,33 +1,29 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004, 2006 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)
-
-from BoostBuild import Tester
-t = Tester()
-
-# Test that use requirements on main target work
-# (and a propagated all the way up, not only to direct
-# dependents)
-t.write("project-root.jam", "import gcc ;")
-
-# Note: 'lib cc ..', not 'lib c', If using 'lib c: ...' the HP-CXX
-# linker will confuse it with the system C runtime.
-t.write(
- "Jamfile",
-"""
- lib b : b.cpp : <link>shared:<define>SHARED_B
- : : <define>FOO <link>shared:<define>SHARED_B
- ;
- lib cc : c.cpp b ;
- exe a : a.cpp cc ;
-""")
-
-t.write(
- "b.cpp",
-"""
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2004, 2006 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+
+# Test that use requirements on main target work (and a propagated all the way
+# up, not only to direct dependants).
+t.write("jamroot.jam", "import gcc ;")
+
+# Note: 'lib cc ..', not 'lib c'. If using 'lib c: ...' the HP-CXX linker will
+# confuse it with the system C runtime.
+t.write("jamfile.jam", """
+lib b : b.cpp : <link>shared:<define>SHARED_B : :
+ <define>FOO <link>shared:<define>SHARED_B ;
+lib cc : c.cpp b ;
+exe a : a.cpp cc ;
+""")
+
+t.write("b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -35,9 +31,7 @@
foo() {}\n
""")
-t.write(
- "c.cpp",
-"""
+t.write("c.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -45,10 +39,7 @@
create_lib_please() {}\n
""")
-
-t.write(
- "a.cpp",
-"""
+t.write("a.cpp", """
#ifdef FOO
void
# if defined(_WIN32) && defined(SHARED_B)
@@ -56,30 +47,24 @@
# endif
foo() {}
#endif
-
int main() { foo(); }
""")
t.run_build_system()
-
t.run_build_system("--clean")
+
# Test that use requirements on main target work, when they are referred using
# 'dependency' features.
-t.write("project-root.jam", "import gcc ;")
+t.write("jamroot.jam", "import gcc ;")
-t.write(
- "Jamfile",
-"""
- lib b : b.cpp : <link>shared:<define>SHARED_B
- : : <define>FOO <link>shared:<define>SHARED_B
- ;
- exe a : a.cpp : <use>b ;
+t.write("jamfile.jam", """
+lib b : b.cpp : <link>shared:<define>SHARED_B : : <define>FOO
+ <link>shared:<define>SHARED_B ;
+exe a : a.cpp : <use>b ;
""")
-t.write(
- "b.cpp",
-"""
+t.write("b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -87,9 +72,7 @@
foo() {}
""")
-t.write(
- "a.cpp",
-"""
+t.write("a.cpp", """
#ifdef FOO
int main() { return 0; }
#endif
@@ -100,22 +83,17 @@
t.run_build_system("--clean")
-# Test that use requirement on project work
-t.write("Jamfile", "exe a : a.cpp lib//b ;")
+# Test that usage requirements on a project work.
+t.write("jamfile.jam", "exe a : a.cpp lib//b ;")
-t.write(
- "lib/Jamfile",
-"""
+t.write("lib/jamfile.jam", """
project
: requirements <link>shared:<define>SHARED_B
- : usage-requirements <define>FOO <link>shared:<define>SHARED_B
- ;
+ : usage-requirements <define>FOO <link>shared:<define>SHARED_B ;
lib b : b.cpp ;
""")
-t.write(
- "lib/b.cpp",
-"""
+t.write("lib/b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -125,42 +103,29 @@
t.run_build_system()
-# Test that use requirements are inherited correctly
-t.write("Jamfile", "exe a : a.cpp lib/1//b ;")
+# Test that use requirements are inherited correctly.
+t.write("jamfile.jam", "exe a : a.cpp lib/1//b ;")
-t.write(
- "a.cpp",
-"""
+t.write("a.cpp", """
#if defined(FOO) && defined(ZOO)
void foo() {}
#endif
-
int main() { foo(); }
""")
-t.write(
- "lib/Jamfile",
-"""
-project
- : requirements
- : usage-requirements <define>FOO
- ;
+t.write("lib/jamfile.jam", """
+project : requirements : usage-requirements <define>FOO ;
""")
-t.write(
- "lib/1/Jamfile",
-"""
+t.write("lib/1/jamfile.jam", """
project
: requirements <link>shared:<define>SHARED_B
- : usage-requirements <define>ZOO <link>shared:<define>SHARED_B
- ;
+ : usage-requirements <define>ZOO <link>shared:<define>SHARED_B ;
lib b : b.cpp ;
""")
-t.write(
- "lib/1/b.cpp",
-"""
+t.write("lib/1/b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -171,29 +136,22 @@
t.run_build_system()
t.run_build_system("--clean")
-# Test that we correctly handle dependency features
-# in use requirements on target
-t.write(
- "Jamfile",
-"""
- lib b : b.cpp : <link>shared:<define>SHARED_B
- : : <define>FOO <link>shared:<define>SHARED_B
- ;
-
- # Here's the test: we should correctly
- # handle dependency feature and get
- # use requirements from 'b'.
- lib cc : c.cpp : <link>shared:<define>SHARED_C : : <library>b ;
-
- # This will build only if <define>FOO
- # was propagated from 'c'.
- exe a : a.cpp cc ;
-""")
-
-t.write(
- "a.cpp",
-"""
+# Test that we correctly handle dependency features in use requirements on
+# target.
+t.write("jamfile.jam", """
+lib b : b.cpp : <link>shared:<define>SHARED_B : : <define>FOO
+ <link>shared:<define>SHARED_B ;
+
+# Here's the test: we should correctly handle dependency feature and get usage
+# requirements from 'b'.
+lib cc : c.cpp : <link>shared:<define>SHARED_C : : <library>b ;
+
+# This will build only if <define>FOO was propagated from 'c'.
+exe a : a.cpp cc ;
+""")
+
+t.write("a.cpp", """
#ifdef FOO
void
# if defined(_WIN32) && defined(SHARED_B)
@@ -205,10 +163,8 @@
int main() { foo(); }
""")
-t.write(
- "c.cpp",
-"""
-int
+t.write("c.cpp", """
+int
#if defined(_WIN32) && defined(SHARED_C)
__declspec(dllexport)
#endif
@@ -218,119 +174,97 @@
t.run_build_system()
t.run_build_system("--clean")
-# Test correct handling of dependency features in
-# project requirements.
-t.write(
- "Jamfile",
-"""
- exe a : a.cpp lib1//cc ;
+
+# Test correct handling of dependency features in project requirements.
+t.write("jamfile.jam", """
+exe a : a.cpp lib1//cc ;
""")
-t.write(
- "lib1/Jamfile",
-"""
- project
+t.write("lib1/jamfile.jam", """
+project
: requirements <link>shared:<define>SHARED_C
- : usage-requirements <library>../lib2//b <link>shared:<define>SHARED_C
- ;
-
- lib cc : c.cpp ;
+ : usage-requirements <library>../lib2//b <link>shared:<define>SHARED_C ;
+lib cc : c.cpp ;
""")
-t.write(
- "lib1/c.cpp",
-"""
-int
+t.write("lib1/c.cpp", """
+int
#if defined(_WIN32) && defined(SHARED_C)
__declspec(dllexport)
#endif
must_export_something;
""")
-t.write(
- "lib2/Jamfile",
-"""
- lib b : b.cpp : <link>shared:<define>SHARED_B
- : : <define>FOO <link>shared:<define>SHARED_B ;
+t.write("lib2/jamfile.jam", """
+lib b : b.cpp : <link>shared:<define>SHARED_B : : <define>FOO
+ <link>shared:<define>SHARED_B ;
""")
t.copy("b.cpp", "lib2/b.cpp")
t.run_build_system()
-# Test that dependency feature in use requirements are built
-# with the correct properties
+
+# Test that dependency feature in use requirements are built with the correct
+# properties.
t.rm(".")
-t.write(
- "Jamfile",
-"""
-lib main : main.cpp : <use>libs//lib1 : : <library>libs//lib1 ;
+t.write("jamfile.jam", """
+lib main : main.cpp : <use>libs//lib1 : : <library>libs//lib1 ;
exe hello : hello.cpp main : ;
""")
-t.write(
- "main.cpp",
-"""
+t.write("main.cpp", """
void
#if defined(_WIN32) && defined(SHARED_LIB1)
__declspec(dllimport)
#endif
foo();
-int main() { foo(); return 0; }
+int main() { foo(); }
""")
t.write("hello.cpp", "\n")
-t.write(
- "project-root.jam",
-"""
-import gcc ;
+t.write("jamroot.jam", """
+import gcc ;
""")
-t.write(
- "libs/a.cpp",
-"""
+t.write("libs/a.cpp", """
void
#if defined(_WIN32) && defined(SHARED_LIB1)
__declspec(dllexport)
#endif
-foo() {}
+foo() {}
""")
-# This library should be build with the same properties as
-# 'main'. There were a bug when they were generated with
-# empty properties, and there were ambiguity between variants.
-t.write(
- "libs/Jamfile",
-"""
-lib lib1 : a_d.cpp : <variant>debug <link>shared:<define>SHARED_LIB1
-: : <link>shared:<define>SHARED_LIB1 ;
-lib lib1 : a.cpp : <variant>release <link>shared:<define>SHARED_LIB1
-: : <link>shared:<define>SHARED_LIB1 ;
+# This library should be build with the same properties as 'main'. This is a
+# regression test for a bug when they were generated with empty properties, and
+# there were ambiguity between variants.
+t.write("libs/jamfile.jam", """
+lib lib1 : a_d.cpp : <variant>debug <link>shared:<define>SHARED_LIB1 : :
+ <link>shared:<define>SHARED_LIB1 ;
+lib lib1 : a.cpp : <variant>release <link>shared:<define>SHARED_LIB1 : :
+ <link>shared:<define>SHARED_LIB1 ;
""")
-t.write(
- "libs/a_d.cpp",
-"""
+t.write("libs/a_d.cpp", """
void
#if defined(_WIN32) && defined(SHARED_LIB1)
__declspec(dllexport)
#endif
-foo() {}
+foo() {}
""")
t.run_build_system("link=static")
t.expect_addition("libs/bin/$toolset/debug/link-static/a_d.obj")
-# Test that indirect conditionals are respected in
-# usage requirements.
+# Test that indirect conditionals are respected in usage requirements.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
rule has-foo ( properties * )
{
return <define>HAS_FOO ;
@@ -339,12 +273,14 @@
exe a : a.cpp b ;
lib b : b.cpp : <link>static : : <conditional>@has-foo ;
""")
+
t.write("a.cpp", """
#ifdef HAS_FOO
void foo();
int main() { foo(); }
#endif
""")
+
t.write("b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
@@ -352,8 +288,8 @@
#endif
foo() {}\n
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
-
t.cleanup()
Modified: trunk/tools/build/v2/test/using.py
==============================================================================
--- trunk/tools/build/v2/test/using.py (original)
+++ trunk/tools/build/v2/test/using.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,43 +1,33 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2005.
-# 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)
+# Copyright (C) Vladimir Prus 2005.
+# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
-
-t.write("sub/a.cpp", """
-int main() { return 0; }
+t = BoostBuild.Tester()
+t.write("sub/a.cpp", """
+int main() {}
""")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
using some_tool ;
""")
-t.write("some_tool.jam", """
+t.write("some_tool.jam", """
import project ;
project.initialize $(__name__) ;
-
-rule init ( )
-{
-}
-
+rule init ( ) { }
""")
-t.write("sub/Jamfile", """
-exe a : a.cpp ;
+t.write("sub/jamfile.jam", """
+exe a : a.cpp ;
""")
-
-
t.run_build_system(subdir="sub")
-
t.expect_addition("sub/bin/$toolset/debug/a.exe")
t.cleanup()
-
Deleted: trunk/tools/build/v2/test/v1-testing/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/v1-testing/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,26 +0,0 @@
-# Copyright 2002, 2003 Dave Abrahams
-# 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)
-
-import testing ;
-
-# A number of tests which should succeed
-compile a.cpp ;
-compile-fail b.cpp ;
-link-fail a.cpp : : link-no ;
-link c.cpp : : link-yes ;
-run c.cpp : : : : run-yes ;
-run-fail c.cpp : : : <define>RESULTCODE=1 : run-no ;
-
-# some tests which should fail
-
-compile-fail a.cpp : : fail-compile-no ;
-compile b.cpp : : fail-compile-yes ;
-link a.cpp : : fail-link-yes ;
-link-fail c.cpp : : fail-link-no ;
-run-fail c.cpp : : : : fail-run-no ;
-run c.cpp : : : <define>RESULTCODE=1 : fail-run-yes ;
-
-# Make sure we still fail if a dependency of an expected-failure test
-# fails.
-link-fail b.cpp : : fail-link-no-dependency ;
Modified: trunk/tools/build/v2/test/v1_testing.py
==============================================================================
--- trunk/tools/build/v2/test/v1_testing.py (original)
+++ trunk/tools/build/v2/test/v1_testing.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,11 +1,11 @@
#!/usr/bin/python
-# Copyright 2002 Dave Abrahams
-# Copyright 2004 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 2002 Dave Abrahams
+# Copyright 2004 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)
-from BoostBuild import Tester, List
+import BoostBuild
import os
from string import strip
import re
@@ -14,7 +14,7 @@
def match_re(actual,expected):
return re.match(expected,actual,re.DOTALL) != None
-t = Tester(match = match_re, boost_build_path = os.path.join(os.getcwd(), ".."))
+t = BoostBuild.Tester(match = match_re, boost_build_path = os.path.join(os.getcwd(), ".."))
t.set_tree('v1_testing')
os.environ['TOOLS'] = 'gcc'
@@ -59,11 +59,11 @@
# function, but we actually need to spell out a lot more than
# what we currently have to do that.
-# 4) Introduced error into one of the library files, causing a library build
-# compile to fail. path_test.test was deleted, so the reporting programs
-# would know that failure occurred. Excellent! This is the case that has
-# caused regression testing to report the wrong results in the past, so it
-# was good news to see it working correctly now. We probably should figure
+# 4) Introduced error into one of the library files, causing a library build
+# compile to fail. path_test.test was deleted, so the reporting programs
+# would know that failure occurred. Excellent! This is the case that has
+# caused regression testing to report the wrong results in the past, so it
+# was good news to see it working correctly now. We probably should figure
# out some other test cases just to be sure it is working for full coverage.
t.rename('lib.cpp', 'lib.cpp.bak')
t.rename('lib-err.cpp', 'lib.cpp')
@@ -74,9 +74,9 @@
, 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
, 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
-# 5) Fixed the error in the library file. The library build then worked, and
-# path_test.exe was relinked, without first recompiling path_test.obj. Test
-# was rerun. Exactly right behavior!
+# 5) Fixed the error in the library file. The library build then worked, and
+# path_test.exe was relinked, without first recompiling path_test.obj. Test was
+# rerun. Exactly the right behavior!
t.rename('lib.cpp.bak', 'lib.cpp')
t.run_build_system(arguments = 'test', status = 0)
t.expect_addition(
@@ -85,4 +85,4 @@
, 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
t.cleanup()
-print 'tesing complete'
+print 'testing complete'
Deleted: trunk/tools/build/v2/test/v1_testing/Jamfile
==============================================================================
--- trunk/tools/build/v2/test/v1_testing/Jamfile 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,23 +0,0 @@
-# Copyright 2002, 2003 Dave Abrahams
-# 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)
-
-TOOLS = $(TOOLS[1]) ;
-project-root ;
-
-# bring in rules for testing
-import testing ;
-
-lib mylib : lib.cpp ;
-
-compile foo.cpp : : compile ;
-compile-fail foo.cpp : <define>NOCOMPILE : nocompile ;
-
-link foo.cpp <lib>mylib : : link ;
-link-fail foo.cpp <lib>mylib : <define>NOLINK : nolink ;
-
-run foo.cpp <lib>mylib
- : # args
- : # input-files
- : <define>RUN
- : run ;
Deleted: trunk/tools/build/v2/test/v1_testing/project-root.jam
==============================================================================
--- trunk/tools/build/v2/test/v1_testing/project-root.jam 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-# Copyright 2002 Dave Abrahams
-# 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)
-
-# just label the project root
Modified: trunk/tools/build/v2/test/wrapper.py
==============================================================================
--- trunk/tools/build/v2/test/wrapper.py (original)
+++ trunk/tools/build/v2/test/wrapper.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -1,46 +1,38 @@
#!/usr/bin/python
-# Copyright 2004 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 2004 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)
-# Test that the user can define his own rule that will call builtin main
-# target rule and that this will work.
+# Test that the user can define his own rule that will call built-in main target
+# rule and that this will work.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
-
-t.write("Jamfile", """ my-test : test.cpp ;
+t = BoostBuild.Tester()
+t.write("jamfile.jam", """
+my-test : test.cpp ;
""")
-t.write("test.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("test.cpp", """
+int main() {}
""")
-t.write("project-root.jam", """ using testing ;
+t.write("jamroot.jam", """
+using testing ;
rule my-test ( name ? : sources + )
{
- {
- name ?= test ;
- unit-test $(name) : $(sources) ; # /site-config//cppunit /util//testMain ;
- }
+ name ?= test ;
+ unit-test $(name) : $(sources) ; # /site-config//cppunit /util//testMain ;
}
IMPORT $(__name__) : my-test : : my-test ;
-
-
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/test.passed")
t.cleanup()
-
Modified: trunk/tools/build/v2/test/wrong_project.py
==============================================================================
--- trunk/tools/build/v2/test/wrong_project.py (original)
+++ trunk/tools/build/v2/test/wrong_project.py 2008-08-31 17:42:27 EDT (Sun, 31 Aug 2008)
@@ -5,39 +5,30 @@
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
-# Regression test. When Jamfile contained "using whatever ; " and the
-# 'whatever' module declared a project, then all targets in Jamfile were
-# considered to be declared in the project associated with 'whatever',
-# not with the Jamfile.
+# Regression test. When Jamfile contained "using whatever ; " and the 'whatever'
+# module declared a project, then all targets in Jamfile were considered to be
+# declared in the project associated with 'whatever', not with the Jamfile.
-from BoostBuild import Tester, List
+import BoostBuild
+t = BoostBuild.Tester()
-t = Tester()
-# Remove temporary directories
-
-t.write("a.cpp", """
+t.write("a.cpp", """
int main() { return 0; }
-
""")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
using some_tool ;
-exe a : a.cpp ;
+exe a : a.cpp ;
""")
-t.write("some_tool.jam", """
+t.write("some_tool.jam", """
import project ;
project.initialize $(__name__) ;
-
-rule init ( )
-{
-}
-
+rule init ( ) { }
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
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