Boost logo

Boost-Build :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-19 13:45:47


AMDG

Jurko Gospodnetić wrote:
> I'll also add try to add the above test cases to it.

I've attached an updated test.

In Christ,
Steven Watanabe


#!/usr/bin/python
#
# Copyright (c) 2008 Steven Watanabe
#
# 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

tester = 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("test.cpp", """
    #ifdef _WIN32
        __declspec(dllexport)
    #endif
    void foo() {}
""")

tester.write("a/test1.cpp", """
    int main() {}
""")

tester.write("a/Jamfile", """
    exe test1 : test1.cpp ;
""")

tester.run_build_system()

tester.expect_addition("bin/$toolset/debug/test.obj")
tester.expect_addition("a/bin/$toolset/debug/test1.exe")

tester.rm("bin")
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.run_build_system()

tester.expect_addition("bin/$toolset/debug/test.obj")
tester.expect_addition("a/bin/$toolset/debug/test1.exe")

tester.rm("bin")
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.run_build_system()

tester.expect_addition("bin/$toolset/debug/test.obj")
tester.expect_addition("a/bin/$toolset/debug/test1.exe")

tester.rm("bin")
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.run_build_system()

tester.expect_addition("bin/$toolset/debug/test.obj")
tester.expect_addition("a/bin/$toolset/debug/test1.exe")

tester.rm("bin")
tester.rm("a/bin")

# test an absolute path.
tester.write("Jamroot", """
    path-constant here : . ;
    project test : requirements <source>$(here)/a/test1.cpp
    ;
    exe test : test.cpp ;
""")

tester.run_build_system()
tester.expect_addition("bin/$toolset/debug/test.exe")

tester.cleanup()


Boost-Build 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