1#!/usr/local/bin/python3.8 2 3# Copyright 2002, 2003, 2004 Vladimir Prus 4# Distributed under the Boost Software License, Version 1.0. 5# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 6 7# Test that we can use already built sources 8 9import BoostBuild 10 11t = BoostBuild.Tester(["debug", "release"], use_test_config=False) 12 13t.set_tree('prebuilt') 14 15t.expand_toolset("ext/jamroot.jam") 16t.expand_toolset("jamroot.jam") 17 18# First, build the external project. 19t.run_build_system(subdir="ext") 20 21# Then pretend that we do not have the sources for the external project, and 22# can only use compiled binaries. 23t.copy("ext/jamfile2.jam", "ext/jamfile.jam") 24t.expand_toolset("ext/jamfile.jam") 25 26# Now check that we can build the main project, and that correct prebuilt file 27# is picked, depending of variant. This also checks that correct includes for 28# prebuilt libraries are used. 29t.run_build_system() 30t.expect_addition("bin/$toolset/debug*/hello.exe") 31t.expect_addition("bin/$toolset/release*/hello.exe") 32 33t.rm("bin") 34 35 36# Now test that prebuilt file specified by absolute name works too. 37t.copy("ext/jamfile3.jam", "ext/jamfile.jam") 38t.expand_toolset("ext/jamfile.jam") 39t.run_build_system() 40t.expect_addition("bin/$toolset/debug*/hello.exe") 41t.expect_addition("bin/$toolset/release*/hello.exe") 42 43t.cleanup() 44