diff --git a/v2/test/build_file.py b/v2/test/build_file.py new file mode 100644 index 000000000..3a5d9446a --- /dev/null +++ b/v2/test/build_file.py @@ -0,0 +1,43 @@ +#!/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) + +# Tests that we can build a file (not target), by it's name +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +# Create the needed files +t.write("Jamroot", """ +exe hello : hello.cpp ; +build-project sub ; +""") +t.write("hello.cpp", """ +int main() +{ + return 0; +} +""") +t.write("sub/Jamfile", """ +exe hello : hello.cpp ; +""") +t.write("sub/hello.cpp", """ +int main() +{ + return 0; +} +""") + + +t.run_build_system(t.adjust_suffix("hello.obj")) + +t.expect_addition("bin/$toolset/debug/hello.obj") +t.expect_addition("sub/bin/$toolset/debug/hello.obj") +t.expect_nothing_more() + +# Remove temporary directories +t.cleanup() diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 04c24e909..037bcb3e8 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -133,6 +133,7 @@ tests = [ "rebuilds", "notfile", "project_root_rule", "resolution", + "build_file", ] if os.name == 'posix':