#!/usr/bin/python # Copyright 2002-2005 Dave Abrahams. # Copyright 2002-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) import os import sys import string import BoostBuild xml = "--xml" in sys.argv toolset = BoostBuild.get_toolset() # 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: pass BoostBuild.set_defer_annotations(1) def run_tests(critical_tests, other_tests): """Runs first critical tests and then other_tests.
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) #endif void foo() {} """) 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 \ ( 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: t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll") # Test that the simplest usage of searched library works. t.write("jamroot.jam", "") t.write( "jamfile.jam", """ import path ; import project ; local here = [ project.attribute $(__name__) location ] ; here = [ path.root $(here) [ path.pwd ] ] ;
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 \ ( 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.jam", """ lib b : b.cpp ../%s ; """ % file) t.write("b/b.cpp", """ #if defined(_WIN32) __declspec(dllimport) #endif void a(); #if defined(_WIN32)
#!/usr/bin/python # Copyright 2002-2005 Dave Abrahams. # Copyright 2002-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) import os import sys import string import BoostBuild xml = "--xml" in sys.argv toolset = BoostBuild.get_toolset() # 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: pass BoostBuild.set_defer_annotations(1) def run_tests(critical_tests, other_tests): """Runs first critical tests and then other_tests.
""") pch_content = """\ #undef HELLO class TestClass { public: TestClass( int, int ) {} }; """ t.write("pch.hpp", pch_content) t.write("pch.cpp", """#include <pch.hpp> """) toolset = BoostBuild.get_toolset() for name in ("hello.cpp", "hello-afx.cpp", "hello-msvc-source.cpp"): t.write(name, """int main() { TestClass c(1, 2); } """) t.run_build_system() t.expect_addition("bin/$toolset/debug*/hello.exe") t.expect_addition("bin/$toolset/debug*/hello-afx.exe") t.expect_addition("bin/$toolset/debug*/hello-msvc-source.exe") # Now make the header unusable, replace its content with some garbage, but # preserve the size and timestamp to fool the compiler. If everything is OK, # B2 will not recreate PCH, and compiler will happily use pre-compiled # header, not noticing that the real header is bad. t.rename("pch.hpp", "pch.hpp.orig")
#!/usr/bin/python # Copyright 2002-2005 Dave Abrahams. # Copyright 2002-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) import BoostBuild import os import os.path import sys xml = "--xml" in sys.argv toolset = BoostBuild.get_toolset() # 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: pass BoostBuild.set_defer_annotations(1) def run_tests(critical_tests, other_tests): """
"lib/test_lib.cpp", """ #ifdef _WIN32 __declspec(dllexport) #endif void foo() {} """, ) 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 (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: t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll") # Test that the simplest usage of searched library works. t.write("jamroot.jam", "") t.write( "jamfile.jam", """ import path ; import project ;
#!/usr/bin/python # Copyright 2002-2005 Dave Abrahams. # Copyright 2002-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) import os import sys import string import BoostBuild xml = "--xml" in sys.argv toolset = BoostBuild.get_toolset() # 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: pass BoostBuild.set_defer_annotations(1) def run_tests(critical_tests, other_tests): """Runs first critical tests and then other_tests.
t.write("lib/jamfile.jam", "lib test_lib : test_lib.cpp ;") t.write("lib/test_lib.cpp", """ #ifdef _WIN32 __declspec(dllexport) #endif void foo() {} """); 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 \ ( 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: t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll") # Test that the simplest usage of searched library works. t.write("jamroot.jam", "") t.write("jamfile.jam", """ import path ; import project ; local here = [ project.attribute $(__name__) location ] ; here = [ path.root $(here) [ path.pwd ] ] ;
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 \ ( 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.jam", """ lib b : b.cpp ../%s ; """ % file) t.write( "b/b.cpp", """ #if defined(_WIN32) __declspec(dllimport) #endif void a();