Пример #1
0
#!/usr/bin/python

# Copyright 2003 Vladimir Prus 
# Distributed under the Boost Software License, Version 1.0. 
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 

from BoostBuild import Tester, List

t = Tester()

t.set_tree("railsys")
t.run_build_system("--v2", subdir="program")

t.cleanup()
Пример #2
0
#!/usr/bin/python

#  Copyright (C) Vladimir Prus 2004. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears in
#  all copies. This software is provided "as is" without express or implied
#  warranty, and with no claim as to its suitability for any purpose.

from BoostBuild import Tester, List

# Create a temporary working directory
t = Tester()

t.set_tree("boostbook")
# For some reason, the messages are sent to stderr.
t.run_build_system(stderr="""Writing A.html for refentry(A)
Writing library/reference.html for section(library.reference)
Writing index.html for chapter(library)
Writing HTML.manifest
""")
t.expect_addition(["html/A.html", "html/index.html"])

t.cleanup()
Пример #3
0
#!/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 'qt4' examples.
from BoostBuild import Tester, List

# Create a temporary working directory
t = Tester()

t.set_tree("../example/qt/qt4/hello")
t.run_build_system()
t.expect_addition(["bin/$toolset/debug/threading-multi/user-interface-gui/arrow"])

t.set_tree("../example/qt/qt4/moccable-cpp")
t.run_build_system()
t.expect_addition(["bin/$toolset/debug/threading-multi/user-interface-gui/main"])

t.set_tree("../example/qt/qt4/uic")
t.run_build_system()
t.expect_addition(["bin/$toolset/debug/threading-multi/user-interface-gui/hello"])

t.cleanup()
Пример #4
0
#!/usr/bin/python

# Copyright 2002, 2003, 2004 Vladimir Prus 
# Distributed under the Boost Software License, Version 1.0. 
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 

# Test that we can use already built sources

from BoostBuild import Tester
t = Tester()

t.set_tree('prebuilt')

t.expand_toolset("ext/project-root.jam")
t.expand_toolset("project-root.jam")
# First, build the external project
t.run_build_system("debug release", subdir="ext")

# Then pretend that we don't have the sources for the external project,
# and can only use compiled binaries
t.copy("ext/Jamfile2", "ext/Jamfile")
t.expand_toolset("ext/Jamfile")

# Now check that we can build the main project, and that
# correct prebuilt file is picked, depending of variant.
# This also checks that correct includes for prebuilt
# libraries are used.

t.run_build_system("debug release")
t.expect_addition("bin/$toolset/debug/hello.exe")
t.expect_addition("bin/$toolset/release/hello.exe")
Пример #5
0
#!/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

# Create a temporary working directory
t = Tester()

t.set_tree("../example/libraries")

t.run_build_system()

t.expect_addition(["app/bin/$toolset/debug/app.exe",
                   "util/foo/bin/$toolset/debug/bar.dll"])


t.cleanup()
Пример #6
0
#!/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

# Create a temporary working directory
t = Tester()

t.set_tree("../example/customization")

t.run_build_system()

t.expect_addition(["bin/$toolset/debug/codegen.exe",
                   "bin/$toolset/debug/usage.cpp"])
                   


t.cleanup()
Пример #7
0
#!/usr/bin/python

from BoostBuild import Tester
import os
from string import strip, find

t = Tester(translate_suffixes=0)

t.set_tree("project-test4")

t.run_build_system()

t.expect_addition("bin/$toolset/debug/a.obj")
t.expect_content("bin/$toolset/debug/a.obj",
                 """$toolset/debug/include-everything
a.cpp
""")

t.expect_addition("bin/$toolset/debug/a.exe")
t.expect_content(
    "bin/$toolset/debug/a.exe", "$toolset/debug/include-everything\n" +
    "bin/$toolset/debug/a.obj lib/bin/$toolset/debug/optimization-speed/b.obj\n"
)

t.expect_addition("lib/bin/$toolset/debug/optimization-speed/b.obj")
t.expect_content(
    "lib/bin/$toolset/debug/optimization-speed/b.obj",
    """$toolset/debug/include-everything/optimization-speed
lib/b.cpp
""")
Пример #8
0
#!/usr/bin/python

from BoostBuild import Tester, List
import os

t = Tester()

t.set_tree("generators-test")
t.run_build_system()

t.expect_addition(
    "bin/$toolset/debug/"
    * (
    List(   
       "a.obj b.obj c.h c.cpp c.obj d_parser.whl d_lexer.dlp d_parser.cpp d_lexer.cpp "
        + "d_parser.lr0 d_parser.h d_parser_symbols.h x.c x.obj y.x1 y.x2 "
        + "y.cpp y.obj e.marked_cpp e.positions e.target_cpp e.obj "))
    )
ok = 0

t.expect_addition("bin/$toolset/debug/a.exe")

t.expect_addition(["lib/bin/$toolset/debug/c.obj",
                   "lib/bin/$toolset/debug/auxilliary.lib",
                   ])


t.run_build_system(subdir='lib')

t.expect_addition(["lib/bin/$toolset/debug/auxilliary2.dll"])
Пример #9
0
#!/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()
#!/usr/bin/python

from BoostBuild import Tester, List
import os
from string import strip
import re
import time


def match_re(actual, expected):
    return re.match(expected, actual, re.DOTALL) != None


t = Tester(match=match_re, boost_build_path=os.path.join(os.getcwd(), ".."))
t.set_tree('v1_testing')

os.environ['TOOLS'] = 'gcc'
os.environ['NOARSCAN'] = '1'

# 1) No existing bin directories.  Both build and test ran fine. As
# expected, the residue files were a bit different: There was no
# path_test.success, and path_test.test contained the word "passed"
# instead of the path to the .cpp file.  I've haven't looked yet to
# see if the lack of the path is a problem for reporting, but
# hopefully the information is trivially available somewhere else.
t.run_build_system(arguments='test', status=0)
t.expect_addition([
    'bin/compile.test/gcc/debug/runtime-link-dynamic/compile.test',
    'bin/nocompile.test/gcc/debug/runtime-link-dynamic/nocompile.test',
    'bin/link.test/gcc/debug/runtime-link-dynamic/link.test',
    'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test',
#!/usr/bin/python

from BoostBuild import Tester, List
import os
import re

spaces_re = re.compile("\ \ +")
trailing_spaces_re = re.compile("\ +\n")

t = Tester(pass_toolset=0)

t.set_tree('module-actions')

expected = r'''A.act t1:   X1-t1     
B.act t1:   X1-t1   X2-B   
act t1:   X1-t1   X2-global   X3-global 
A.act t2:   X1-A   X2-t2   
B.act t2:     X2-t2   
act t2:   X1-global   X2-t2   X3-global 
A.act t3:   X1-A     X3-t3 
B.act t3:     X2-B   X3-t3 
act t3:   X1-global   X2-global   X3-t3 
'''

# On Unixes, call to 'echo 1     2      3' produces '1 2 3' (note spacing)
# Accomodate for that fact.
if os.name != 'nt':
    expected = re.sub(spaces_re, " ", expected)
    expected = re.sub(trailing_spaces_re, "\n", expected)

# We expect t5 and t7's output to be dumped to stdout
Пример #12
0
#!/usr/bin/python

from BoostBuild import Tester, List
from time import sleep

t = Tester()

t.set_tree("test2")
t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..")

file_list = 'bin/foo/$toolset/debug/runtime-link-dynamic/' * List("foo foo.o")
t.expect_addition(file_list)

t.write("foo.cpp", "int main(int, char**) { return 0; }\n")
t.run_build_system("-d2 -sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
t.expect_touch(file_list)
t.pass_test()
#!/usr/bin/python
# Test the very basic 'make' functionality.

from BoostBuild import Tester, List

t = Tester()
t.set_tree("test1")


# Check that we can build something

t.run_build_system("-sTOOLSET=yfc")

t.expect_addition("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a")
t.expect_nothing_more()

t.fail(t.read("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
a.cpp
""")

t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
a.cpp
""")

# Check that we have vanilla target names available
Пример #14
0
#!/usr/bin/python

from BoostBuild import Tester, List
import os
from string import strip

t = Tester(translate_suffixes=0)

# First check some startup
t.set_tree("project-test3")
os.remove("project-root.jam")
t.run_build_system(
    status=1,
    stdout="""Failed to find the project root for directory '.'.
Did not find a project-root.jam file there or in any of its parent directories.
Please consult the documentation at 'http://www.boost.org'.
""",
)

t.set_tree("project-test3")
t.run_build_system()

t.expect_addition("bin/$toolset/debug/a.obj")
t.expect_content(
    "bin/$toolset/debug/a.obj",
    """$toolset/debug
a.cpp
""",
)

t.expect_addition("bin/$toolset/debug/a.exe")
Пример #15
0
#!/usr/bin/python

# Copyright 2002, 2003, 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

# Test that we can use already built sources

from BoostBuild import Tester
t = Tester()

t.set_tree('prebuilt')

t.expand_toolset("ext/project-root.jam")
t.expand_toolset("project-root.jam")
# First, build the external project
t.run_build_system("debug release", subdir="ext")

# Then pretend that we don't have the sources for the external project,
# and can only use compiled binaries
t.copy("ext/Jamfile2", "ext/Jamfile")
t.expand_toolset("ext/Jamfile")

# Now check that we can build the main project, and that
# correct prebuilt file is picked, depending of variant.
# This also checks that correct includes for prebuilt
# libraries are used.

t.run_build_system("debug release")
t.expect_addition("bin/$toolset/debug/hello.exe")
t.expect_addition("bin/$toolset/release/hello.exe")
Пример #16
0
# Copyright 2003 Dave Abrahams 
# Copyright 2006 Rene Rivera 
# Copyright 2003 Vladimir Prus 
# Distributed under the Boost Software License, Version 1.0. 
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 

from BoostBuild import Tester, List
import os
import re

spaces_re = re.compile("\ \ +")
trailing_spaces_re = re.compile("\ +\n")

t = Tester(pass_toolset=0)

t.set_tree('module-actions')

expected = r'''A.act t1: X1-t1   
B.act t1: X1-t1 X2-B  
act t1: X1-t1 X2-global X3-global 
A.act t2: X1-A X2-t2  
B.act t2:  X2-t2  
act t2: X1-global X2-t2 X3-global 
A.act t3: X1-A  X3-t3 
B.act t3:  X2-B X3-t3 
act t3: X1-global X2-global X3-t3 
'''

# On Unixes, call to 'echo 1     2      3' produces '1 2 3' (note spacing)
# Accomodate for that fact.
if os.name != 'nt':
Пример #17
0
#!/usr/bin/python

# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

from BoostBuild import Tester, List

t = Tester()

t.set_tree("dependency-test")
t.run_build_system()
# Check that main target 'c' was able to find 'x.h' from
# 'a's dependency graph
t.expect_addition("bin/$toolset/debug/c.exe")

# Check handling of first level includes.

# Both 'a' and 'b' include "a.h" and should be updated
t.touch("a.h")
t.run_build_system()

t.expect_touch("bin/$toolset/debug/a.exe")
t.expect_touch("bin/$toolset/debug/a.obj")
t.expect_touch("bin/$toolset/debug/a_c.obj")
t.expect_touch("bin/$toolset/debug/b.exe")
t.expect_touch("bin/$toolset/debug/b.obj")
# Now, <dependency> does not add dependency.
# It sound weird, but is intentional. Need
# to rename <dependency> eventually.
Пример #18
0
#!/usr/bin/python

#  Copyright (C) Vladimir Prus 2004. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears in
#  all copies. This software is provided "as is" without express or implied
#  warranty, and with no claim as to its suitability for any purpose.

from BoostBuild import Tester, List

# Create a temporary working directory
t = Tester()

t.set_tree("boostbook")
# For some reason, the messages are sent to stderr.
t.run_build_system(stderr="""Writing boost/A.html for refentry(boost.A)
Writing library/reference.html for section(library.reference)
Writing index.html for chapter(library)
Writing HTML.manifest
""")
t.expect_addition(["html/boost/A.html", "html/index.html"])

t.cleanup()
Пример #19
0
#!/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 'qt4' examples.
from BoostBuild import Tester, List

# Create a temporary working directory
t = Tester()

t.set_tree("../example/qt/qt4/hello")
t.run_build_system()
t.expect_addition(
    ["bin/$toolset/debug/threading-multi/user-interface-gui/arrow"])

t.set_tree("../example/qt/qt4/moccable-cpp")
t.run_build_system()
t.expect_addition(
    ["bin/$toolset/debug/threading-multi/user-interface-gui/main"])

t.set_tree("../example/qt/qt4/uic")
t.run_build_system()
t.expect_addition(
    ["bin/$toolset/debug/threading-multi/user-interface-gui/hello"])

t.cleanup()
Пример #20
0
#!/usr/bin/python

from BoostBuild import Tester, List
from time import sleep

t = Tester()

t.set_tree("test2")
t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..")

file_list = 'bin/foo/$toolset/debug/runtime-link-dynamic/' * List("foo foo.o")
t.expect_addition(file_list)


t.write("foo.cpp", "int main(int, char**) { return 0; }\n")
t.run_build_system("-d2 -sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
t.expect_touch(file_list)
t.pass_test()

Пример #21
0
#!/usr/bin/python

#  Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears in
#  all copies. This software is provided "as is" without express or implied
#  warranty, and with no claim as to its suitability for any purpose.

from BoostBuild import Tester, List

t = Tester()

t.set_tree("railsys")
t.run_build_system("--v2", subdir="program")

t.cleanup()
Пример #22
0
#!/usr/bin/python

from BoostBuild import Tester, List
import os
from string import strip
import re

def match_re(actual,expected):
    return re.match(expected,actual,re.DOTALL) != None

t = Tester(match = match_re)

t.set_tree('testing-primitives')

# We expect t5 and t7's output to be dumped to stdout
t.run_build_system(stdout=r'''.*failing t5.*failing t7''')

t.expect_addition('t2.txt')
t.expect_addition('t3.txt')

t.expect_addition('t5.out')

t.expect_addition('t6.out')
t.expect_addition('t6.txt')

t.expect_addition('t7.out')
t.expect_addition('t7.txt')

t.expect_addition('t8.out')

t.expect_nothing_more()
Пример #23
0
#!/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()
Пример #24
0
# Copyright 2002 Dave Abrahams 
# Copyright 2004 Vladimir Prus 
# Distributed under the Boost Software License, Version 1.0. 
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 

from BoostBuild import Tester, List
import os
from string import strip
import re
import time

def match_re(actual,expected):
    return re.match(expected,actual,re.DOTALL) != None

t = Tester(match = match_re, boost_build_path = os.path.join(os.getcwd(), ".."))
t.set_tree('v1_testing')

os.environ['TOOLS'] = 'gcc'
os.environ['NOARSCAN'] = '1'

# 1) No existing bin directories.  Both build and test ran fine. As
# expected, the residue files were a bit different: There was no
# path_test.success, and path_test.test contained the word "passed"
# instead of the path to the .cpp file.  I've haven't looked yet to
# see if the lack of the path is a problem for reporting, but
# hopefully the information is trivially available somewhere else.
t.run_build_system(arguments = 'test', status = 0)
t.expect_addition(
    ['bin/compile.test/gcc/debug/runtime-link-dynamic/compile.test'
     , 'bin/nocompile.test/gcc/debug/runtime-link-dynamic/nocompile.test'
     , 'bin/link.test/gcc/debug/runtime-link-dynamic/link.test'
Пример #25
0
#!/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

# Create a temporary working directory
t = Tester()

t.set_tree("../example/libraries")

t.run_build_system()

t.expect_addition(["app/bin/$toolset/debug/app.exe",
                   "util/foo/bin/$toolset/debug/bar.dll"])


t.cleanup()
Пример #26
0
#!/usr/bin/python

from BoostBuild import Tester, List

t = Tester()

t.set_tree("dependency-test")
t.run_build_system()
# Check that main target 'c' was able to find 'x.h' from
# 'a's dependency graph
t.expect_addition("bin/$toolset/debug/c.exe")

# Check handling of first level includes.

# Both 'a' and 'b' include "a.h" and should be updated
t.touch("a.h")
t.run_build_system()

t.expect_touch("bin/$toolset/debug/a.exe")
t.expect_touch("bin/$toolset/debug/a.obj")
t.expect_touch("bin/$toolset/debug/a_c.obj")
t.expect_touch("bin/$toolset/debug/b.exe")
t.expect_touch("bin/$toolset/debug/b.obj")
# Now, <dependency> does not add dependency.
# It sound weird, but is intentional. Need
# to rename <dependency> eventually.
#t.expect_touch("bin/$toolset/debug/main-target-c/c.exe")
t.ignore("*.tds")
t.expect_nothing_more()

# Only 'a' include <a.h> and should be updated
Пример #27
0
from BoostBuild import Tester
import os
import re

def match_re(actual,expected):
    return re.match(expected,actual,re.DOTALL) != None

# Test the v1 startup behavior
t = Tester(
    match= match_re
    , boost_build_path=''
    , pass_toolset=0
    )

t.set_tree('startup')

t.run_build_system(
    status=1, stdout=r'''Unable to load Boost\.Build: could not find "boost-build.jam"
.*Attempted search from .* up to the root''', match = match_re)

os.chdir('no-bootstrap1')

t.run_build_system(
    status=1
    , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
    + r'''.*attempted to load the build system by invoking'''
    + r'''.*'boost-build ;'.*'''
    + r'''but we were unable to find "bootstrap\.jam"'''
    )
Пример #28
0
from BoostBuild import Tester
import os
import re

def match_re(actual,expected):
    return re.match(expected,actual,re.DOTALL) != None

# Test the v1 startup behavior
t = Tester(
    match= match_re
    , boost_build_path=''
    , pass_toolset=0
    )

t.set_tree('startup')

t.run_build_system(
    status=1, stdout=r'''Unable to load Boost\.Build: could not find "boost-build.jam"
.*Attempted search from .* up to the root''', match = match_re)

os.chdir('no-bootstrap1')

t.run_build_system(
    status=1
    , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
    + r'''.*attempted to load the build system by invoking'''
    + r'''.*'boost-build ;'.*'''
    + r'''but we were unable to find "bootstrap\.jam"'''
    )
Пример #29
0
#!/usr/bin/python

# Copyright 2003 Dave Abrahams 
# Copyright 2002, 2003, 2005 Vladimir Prus 
# Distributed under the Boost Software License, Version 1.0. 
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 

from BoostBuild import Tester, List
import os

t = Tester()

t.set_tree("generators-test")
t.run_build_system()

t.expect_addition(
    "bin/$toolset/debug/"
    * (
    List(   
       "a.obj b.obj c.h c.cpp c.obj d_parser.whl d_lexer.dlp d_parser.cpp d_lexer.cpp "
        + "d_parser.lr0 d_parser.h d_parser_symbols.h x.c x.obj y.x1 y.x2 "
        + "y.cpp y.obj e.marked_cpp e.positions e.target_cpp e.obj "))
    )
ok = 0

t.expect_addition("bin/$toolset/debug/a.exe")

t.expect_addition(["lib/bin/$toolset/debug/c.obj",
                   "lib/bin/$toolset/debug/auxilliary.lib",
                   ])
Пример #30
0
#!/usr/bin/python

from BoostBuild import Tester, List
import os
from string import strip

t = Tester()

# First check some startup
t.set_tree("direct-request-test")
t.run_build_system(extra_args="define=MACROS")

t.expect_addition("bin/$toolset/debug/" 
                  * (List("a.o b.o b.dll a.exe")))
		  
# Regression test: direct build request was not working
# when there's more than one level of 'build-project'

t.rm(".")
t.write('project-root.jam', '')
t.write('Jamfile', 'build-project a ;')
t.write('a/Jamfile', 'build-project b ;')
t.write('a/b/Jamfile', '')

t.run_build_system("release")		  


t.cleanup()
Пример #31
0
#!/usr/bin/python

from BoostBuild import Tester, List
import os
from string import strip

t = Tester()

# First check some startup
t.set_tree("direct-request-test")
t.run_build_system(extra_args="define=MACROS")

t.expect_addition("bin/$toolset/debug/" * (List("a.o b.o b.dll a.exe")))

# Regression test: direct build request was not working
# when there's more than one level of 'build-project'

t.rm(".")
t.write('project-root.jam', '')
t.write('Jamfile', 'build-project a ;')
t.write('a/Jamfile', 'build-project b ;')
t.write('a/b/Jamfile', '')

t.run_build_system("release")

t.cleanup()
Пример #32
0
#!/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

# Create a temporary working directory
t = Tester()

t.set_tree("../example/make")

t.run_build_system()

t.expect_addition(["bin/$toolset/debug/main.exe"])
                   
t.cleanup()
Пример #33
0
#!/usr/bin/python

from BoostBuild import Tester
import os
import re


def match_re(actual, expected):
    return re.match(expected, actual, re.DOTALL) != None


# Test the v1 startup behavior
t = Tester(match=match_re, boost_build_path="", pass_toolset=0)

t.set_tree("startup")

t.run_build_system(
    status=1,
    stdout=r"""Unable to load Boost\.Build: could not find "boost-build.jam"
.*Attempted search from .* up to the root""",
    match=match_re,
)

os.chdir("no-bootstrap1")

t.run_build_system(
    status=1,
    stdout=r"""Unable to load Boost\.Build: could not find build system\."""
    + r""".*attempted to load the build system by invoking"""
    + r""".*'boost-build ;'.*"""
    + r'''but we were unable to find "bootstrap\.jam"''',
Пример #34
0
#!/usr/bin/python

# Copyright 2003 Vladimir Prus 
# Distributed under the Boost Software License, Version 1.0. 
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 

# Test that unused sources are at least reported.

from BoostBuild import Tester
from string import find
t = Tester()

t.set_tree("unused")

t.run_build_system()
# The second invocation should do nothing, and produce
# no warning. The previous invocation might have printed
# executed actions and other things, so it's not easy
# to check if warning was issued or not.
t.run_build_system()
t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)

t.run_build_system("-sGENERATE_ONLY_UNUSABLE=1")
t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)

# Now check that even if main target generates nothing, its
# usage requirements are still propagated to dependents.
t.write("a.cpp","""
#ifdef FOO
int main() {}
#endif
Пример #35
0
#!/usr/bin/python

from BoostBuild import Tester, List
import os
from string import strip
import re


def match_re(actual, expected):
    return re.match(expected, actual, re.DOTALL) != None


t = Tester(match=match_re)

t.set_tree("testing-primitives")

# We expect t5 and t7's output to be dumped to stdout
t.run_build_system(stdout=r""".*failing t5.*failing t7""")

t.expect_addition("t2.txt")
t.expect_addition("t3.txt")

t.expect_addition("t5.out")

t.expect_addition("t6.out")
t.expect_addition("t6.txt")

t.expect_addition("t7.out")
t.expect_addition("t7.txt")

t.expect_addition("t8.out")
Пример #36
0
#!/usr/bin/python
# Tests that we can use objects from other projects
# (i.e. with other project root)
# Test also that we can refer to those target using project-id.

from BoostBuild import Tester, List

t = Tester()
t.set_tree("test1")

t.run_build_system("-sTOOLSET=yfc", subdir="p1")

t.expect_addition("p1/bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
t.expect_addition("p1/auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj")
t.expect_addition("p2/bin/c.obj/yfc/debug/runtime-link-dynamic/c.obj")
t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a")
t.expect_nothing_more()

t.fail(t.read("p1/bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
a.cpp
""")

t.fail(t.read("p1/auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/b.obj") !=\
"""
<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
b.cpp
""")

t.fail(t.read("p2/bin/c.obj/yfc/debug/runtime-link-dynamic/c.obj") !=\
Пример #37
0
#!/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

# Create a temporary working directory
t = Tester()

t.set_tree("../example/customization")

t.run_build_system()

t.expect_addition(
    ["bin/$toolset/debug/codegen.exe", "bin/$toolset/debug/usage.cpp"])

t.cleanup()