Exemplo n.º 1
0
List("bin/$toolset/release/b_rs.dll") + \
List("c/a_rs.exe") + \
List("bin/$toolset/debug/link-static/a_dt.exe") + \
List("bin/$toolset/debug/link-static/b_dt.lib") + \
List("c/a_dt.exe") + \
List("bin/$toolset/release/link-static/a_rt.exe") + \
List("bin/$toolset/release/link-static/b_rt.lib") + \
List("c/a_rt.exe")

variants = "debug release link=static,shared"

t.run_build_system(variants)
t.expect_addition(file_list)

t.run_build_system(variants + " clean")
t.expect_removal(file_list)

# Regression test: the 'tag' feature did not work in directories that
# had dot in names.
t.write("version-1.32.0/Jamroot", """
project test : requirements <tag>@$(__name__).tag ;

rule tag ( name : type ? : property-set )
{
   # Do nothing, just make sure the rule is invoked OK.
   ECHO "The tag rule was invoked" ;
}
exe a : a.cpp ;
""")

t.write("version-1.32.0/a.cpp", "int main() { return 0; }\n")
Exemplo n.º 2
0
    "lib2/bin/$toolset/debug/l.exe"
])

t.run_build_system(extra_args="release optimization=off,speed")
t.expect_addition([
    "bin/$toolset/release/a.exe", "bin/$toolset/release/a.obj",
    "bin/$toolset/release/optimization-off/a.exe",
    "bin/$toolset/release/optimization-off/a.obj"
])

t.run_build_system(extra_args='clean')
t.expect_removal([
    "bin/$toolset/debug/a.obj",
    "bin/$toolset/debug/a.exe",
    "lib/bin/$toolset/debug/b.obj",
    "lib/bin/$toolset/debug/m.exe",
    "lib2/bin/$toolset/debug/c.obj",
    "lib2/bin/$toolset/debug/d.obj",
    "lib2/bin/$toolset/debug/l.exe",
    "lib3/bin/$toolset/debug/f.obj",
])

# Now test target ids in command line
t.set_tree("project-test3")
t.run_build_system("lib//b.obj")
t.expect_addition("lib/bin/$toolset/debug/b.obj")
t.expect_nothing_more()

t.run_build_system("clean lib//b.obj")
t.expect_removal("lib/bin/$toolset/debug/b.obj")
t.expect_nothing_more()
Exemplo n.º 3
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'
     , 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])


# 2) Missing source file for the library build. path_test.test was
# deleted, so the reporting programs would know that failure
# occurred. The stdout messages also indicated what had
# happened. Excellent!
t.rename('lib.cpp', 'lib.cpp.bak')
t.run_build_system(arguments = 'test', status = 1)
t.expect_removal(
    ['bin/link.test/gcc/debug/runtime-link-dynamic/link.test'
     , 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
     , 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])

# 3) Missing file restored. Worked fine; path_test.test was recreated,
# no other files were touched.
t.rename('lib.cpp.bak', 'lib.cpp')
t.run_build_system(arguments = 'test', status = 0)
t.expect_addition(
    [ 'bin/link.test/gcc/debug/runtime-link-dynamic/link.test'
     , 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
     , 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
     # I didn't add a test for 'no other files were touched', because
     # it's a little complicated. There is an expect_nothing_more()
     # function, but we actually need to spell out a lot more than
     # what we currently have to do that.
Exemplo n.º 4
0
t.expect_addition(
    [
        "bin/$toolset/release/a.exe",
        "bin/$toolset/release/a.obj",
        "bin/$toolset/release/optimization-off/a.exe",
        "bin/$toolset/release/optimization-off/a.obj",
    ]
)

t.run_build_system(extra_args="clean")
t.expect_removal(
    [
        "bin/$toolset/debug/a.obj",
        "bin/$toolset/debug/a.exe",
        "lib/bin/$toolset/debug/b.obj",
        "lib/bin/$toolset/debug/m.exe",
        "lib2/bin/$toolset/debug/c.obj",
        "lib2/bin/$toolset/debug/d.obj",
        "lib2/bin/$toolset/debug/l.exe",
        "lib3/bin/$toolset/debug/f.obj",
    ]
)

# Now test target ids in command line
t.set_tree("project-test3")
t.run_build_system("lib//b.obj")
t.expect_addition("lib/bin/$toolset/debug/b.obj")
t.expect_nothing_more()

t.run_build_system("clean lib//b.obj")
t.expect_removal("lib/bin/$toolset/debug/b.obj")
t.expect_nothing_more()
Exemplo n.º 5
0
    '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',
    'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'
])

# 2) Missing source file for the library build. path_test.test was
# deleted, so the reporting programs would know that failure
# occurred. The stdout messages also indicated what had
# happened. Excellent!
t.rename('lib.cpp', 'lib.cpp.bak')
t.run_build_system(arguments='test', status=1)
t.expect_removal([
    'bin/link.test/gcc/debug/runtime-link-dynamic/link.test',
    'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test',
    'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'
])

# 3) Missing file restored. Worked fine; path_test.test was recreated,
# no other files were touched.
t.rename('lib.cpp.bak', 'lib.cpp')
t.run_build_system(arguments='test', status=0)
t.expect_addition([
    'bin/link.test/gcc/debug/runtime-link-dynamic/link.test',
    'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test',
    'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'
])
# I didn't add a test for 'no other files were touched', because
# it's a little complicated. There is an expect_nothing_more()
# function, but we actually need to spell out a lot more than
Exemplo n.º 6
0
""")

t.run_build_system('hardcode-dll-paths=false')
t.expect_content("bin/r.test/$toolset/debug/r.output",
                 "test input\nEXIT STATUS: 0\n")

t.expect_addition('bin/$toolset/debug/execution.time')
t.expect_addition('bin/$toolset/debug/compilation.time')

# Make sure test failures are detected. Reverse expectation and see
# if .test files are created or not.
t.write(
    "Jamfile", """ 
import testing ;

compile-fail c.cpp ;
compile c-f.cpp ;
run-fail r.cpp : : dir/input.txt ;
run r-f.cpp ;
""")

t.touch(List("c.cpp c-f.cpp r.cpp r-f.cpp"))

t.run_build_system("hardcode-dll-paths=false", stderr=None, status=1)
t.expect_removal("bin/c.test/$toolset/debug/c.test")
t.expect_removal("bin/c-f.test/$toolset/debug/c-f.test")
t.expect_removal("bin/r.test/$toolset/debug/r.test")
t.expect_removal("bin/r-f.test/$toolset/debug/r-f.test")

t.cleanup()
Exemplo n.º 7
0
time compilation : c-obj ;
""")

t.run_build_system('hardcode-dll-paths=false')
t.expect_content("bin/r.test/$toolset/debug/r.output",
                 "test input\nEXIT STATUS: 0\n")

t.expect_addition('bin/$toolset/debug/execution.time')
t.expect_addition('bin/$toolset/debug/compilation.time')

# Make sure test failures are detected. Reverse expectation and see
# if .test files are created or not.
t.write("Jamfile", """ 
import testing ;

compile-fail c.cpp ;
compile c-f.cpp ;
run-fail r.cpp : : dir/input.txt ;
run r-f.cpp ;
""")

t.touch(List("c.cpp c-f.cpp r.cpp r-f.cpp"))

t.run_build_system("hardcode-dll-paths=false", stderr=None, status=1)
t.expect_removal("bin/c.test/$toolset/debug/c.test")
t.expect_removal("bin/c-f.test/$toolset/debug/c-f.test")
t.expect_removal("bin/r.test/$toolset/debug/r.test")
t.expect_removal("bin/r-f.test/$toolset/debug/r-f.test")

t.cleanup()
Exemplo n.º 8
0
Arquivo: clean.py Projeto: kavoor/zen
t.write("sub3/Jamroot", """ 
lib sub3 : sub3.cpp ; 
""")

t.write("sub3/sub3.cpp", """
#ifdef _WIN32
__declspec(dllexport)
#endif
void sub3() {}

""")

# The 'clean' should not remove files under separate Jamroot.
t.run_build_system()
t.run_build_system("--clean")
t.expect_removal("bin/$toolset/debug/a.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1_2.obj")
t.expect_removal("sub2/bin/$toolset/debug/sub2.obj")
t.expect_nothing("sub3/bin/$toolset/debug/sub3.obj")

# The 'clean-all' removes everything it can reach.
t.run_build_system()
t.run_build_system("--clean")
t.expect_removal("bin/$toolset/debug/a.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1_2.obj")
t.expect_removal("sub2/bin/$toolset/debug/sub2.obj")
t.expect_nothing("sub3/bin/$toolset/debug/sub3.obj")

# The 'clean' together with project target removes
Exemplo n.º 9
0
lib sub3 : sub3.cpp ; 
""")

t.write("sub3/sub3.cpp", """
#ifdef _WIN32
__declspec(dllexport)
#endif
void sub3() {}

""")


# The 'clean' should not remove files under separate Jamroot.
t.run_build_system()
t.run_build_system("--clean")
t.expect_removal("bin/$toolset/debug/a.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1_2.obj")
t.expect_removal("sub2/bin/$toolset/debug/sub2.obj")
t.expect_nothing("sub3/bin/$toolset/debug/sub3.obj")

# The 'clean-all' removes everything it can reach.
t.run_build_system()
t.run_build_system("--clean")
t.expect_removal("bin/$toolset/debug/a.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1_2.obj")
t.expect_removal("sub2/bin/$toolset/debug/sub2.obj")
t.expect_nothing("sub3/bin/$toolset/debug/sub3.obj")

# The 'clean' together with project target removes