Пример #1
0
t.write("d1/Jamfile", """
project : source-location src ;
exe a : [ glob-tree *.cpp : bad* ] ../d2/d//l ; 
""")
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")

# Test that directory names in patterns for
# 'glob-tree' are rejected.
t.write("d1/Jamfile", """
project : source-location src ;
exe a : [ glob-tree foo/*.cpp bar/*.cpp : bad* ] ../d2/d//l ; 
""")

t.run_build_system(subdir="d1", status=1)
t.expect_output_line("error: The patterns * may not include directory")


t.rm("d1/src/bar/bad.cpp")

# Test that 'glob' works with absolute names
t.rm("d1/bin")

# Note that to get current dir, we use bjam's PWD,
# not Python's os.getcwd, because the former will
# always return long path. The latter might return
# short path, and that will confuse path.glob.
t.write("d1/Jamfile", """
project : source-location src ;
local pwd = [ PWD ] ; # Always absolute
exe a : [ glob $(pwd)/src/foo/*.cpp $(pwd)/src/bar/*.cpp ] ../d2/d//l ; 
Пример #2
0
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()
Пример #3
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
import string

t = Tester()

#  Regression test for double loading of the same Jamfile.
t.write("Jamfile.jam", "build-project subdir ;")
t.write("Jamroot.jam", "")
t.write("subdir/Jamfile.jam", 'ECHO "Loaded subdir" ;')

t.run_build_system(subdir="subdir")
t.expect_output_line("Loaded subdir")

# Regression test for a more contrived case. The top-level Jamfile refers to
# subdir via use-project, while subdir's Jamfile is being loaded. The motivation
# why use-project referring to subprojects is useful can be found at
# http://article.gmane.org/gmane.comp.lib.boost.build/3906/
t.write("Jamfile.jam", "use-project /subdir : subdir ;")
t.write("Jamroot.jam", "")
t.write("subdir/Jamfile.jam", "project subdir ;")

t.run_build_system(subdir="subdir")

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

t = Tester()

#  Regression test for double loading of the same Jamfile.
t.write("Jamfile.jam", "build-project subdir ;")
t.write("Jamroot.jam", "" )
t.write("subdir/Jamfile.jam", 'ECHO "Loaded subdir" ;')

t.run_build_system(subdir="subdir")
t.expect_output_line("Loaded subdir")


# Regression test for a more contrived case. The top-level Jamfile refers to
# subdir via use-project, while subdir's Jamfile is being loaded. The motivation
# why use-project referring to subprojects is useful can be found at
# http://article.gmane.org/gmane.comp.lib.boost.build/3906/
t.write("Jamfile.jam", "use-project /subdir : subdir ;")
t.write("Jamroot.jam", "" )
t.write("subdir/Jamfile.jam", "project subdir ;")

t.run_build_system(subdir="subdir");

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

Пример #6
0
project : source-location src ;
exe a : [ glob-tree *.cpp : bad* ] ../d2/d//l ; 
""")
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")

# Test that directory names in patterns for
# 'glob-tree' are rejected.
t.write(
    "d1/Jamfile", """
project : source-location src ;
exe a : [ glob-tree foo/*.cpp bar/*.cpp : bad* ] ../d2/d//l ; 
""")

t.run_build_system(subdir="d1", status=1)
t.expect_output_line("error: The patterns * may not include directory")

t.rm("d1/src/bar/bad.cpp")

# Test that 'glob' works with absolute names
t.rm("d1/bin")

# Note that to get current dir, we use bjam's PWD,
# not Python's os.getcwd, because the former will
# always return long path. The latter might return
# short path, and that will confuse path.glob.
t.write(
    "d1/Jamfile", """
project : source-location src ;
local pwd = [ PWD ] ; # Always absolute
exe a : [ glob $(pwd)/src/foo/*.cpp $(pwd)/src/bar/*.cpp ] ../d2/d//l ;