valgrind $(>) } """) t.write("hello.cpp", """ #include <iostream> int main() { std::cout << "Hello!\\n"; return 1; } """) t.run_build_system("-n -d+2") t.fail_test(string.find(t.stdout(), "echo hi") == -1) name = t.adjust_names(["bin/$toolset/debug/hello.exe"])[0] name = apply(os.path.join, string.split(name, "/")); c = "valgrind " + name t.fail_test(string.find(t.stdout(), c) == -1) t.cleanup()
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", """ 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. rsp = t.adjust_names("bin/$toolset/debug/main.exe.rsp")[0] 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. # t.rm(".") t.write("Jamroot", "") t.write("a/Jamfile", """ lib a : a.cpp ;
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", """ 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. rsp = t.adjust_names("bin/$toolset/debug/main.exe.rsp")[0] 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. # t.rm(".") t.write("Jamroot", "") t.write("a/Jamfile", """ lib a : a.cpp ;
actions valgrind { valgrind $(>) } """) t.write( "hello.cpp", """ #include <iostream> int main() { std::cout << "Hello!\\n"; return 1; } """) t.run_build_system("-n -d+2") t.fail_test(string.find(t.stdout(), "echo hi") == -1) name = t.adjust_names(["bin/$toolset/debug/hello.exe"])[0] name = apply(os.path.join, string.split(name, "/")) c = "valgrind " + name t.expect_output_line(c) t.cleanup()
lib a : a.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.run_build_system("hardcode-dll-paths=true") t.expect_addition("bin/$toolset/debug/mp.pathlist") es1 = t.adjust_names(["a/bin/$toolset/debug"])[0] es2 = t.adjust_names(["b/bin/$toolset/debug"])[0] content = t.read("bin/$toolset/debug/mp.pathlist") t.fail_test(find(content, es1) == -1) t.fail_test(find(content, es2) == -1) t.cleanup()
lib a : a.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.run_build_system("hardcode-dll-paths=true") t.expect_addition("bin/$toolset/debug/mp.pathlist") es1 = t.adjust_names(["a/bin/$toolset/debug"])[0] es2 = t.adjust_names(["b/bin/$toolset/debug"])[0] content = t.read("bin/$toolset/debug/mp.pathlist") t.fail_test(find(content, es1) == -1) t.fail_test(find(content, es2) == -1) t.cleanup()
#!/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 the 'libraries' example. from BoostBuild import Tester, List import os import string # Create a temporary working directory t = Tester() t.set_tree("../example/gettext") t.run_build_system(stderr=None) 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) input = input_fd.read() t.fail_test(string.find(input, "international hello") != 0) t.cleanup()
# 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 import os import string # Create a temporary working directory t = Tester() t.set_tree("../example/gettext") t.run_build_system(stderr=None) 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) input = input_fd.read(); t.fail_test(string.find(input, "international hello") != 0) t.cleanup()