2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-21 02:52:12 +00:00

Fix direct_request_test and add it to test_all.py.

[SVN r75877]
This commit is contained in:
Steven Watanabe
2011-12-09 16:08:44 +00:00
parent 97a17f42ee
commit cf2e6f77ed
8 changed files with 41 additions and 98 deletions

View File

@@ -1,19 +0,0 @@
// Copyright (c) 2003 Vladimir Prus
//
// 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)
//
// http://www.boost.org
//
void
# ifdef _WIN32
__declspec(dllimport)
# endif
foo();
int main()
{
foo();
}

View File

@@ -1,22 +0,0 @@
// Copyright (c) 2003 Vladimir Prus
//
// 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)
//
// http://www.boost.org
//
// This file will declare 'foo' is 'MACROS' is defined.
#ifdef MACROS
void
# ifdef _WIN32
__declspec(dllexport)
# endif
foo() {}
#endif
# ifdef _WIN32
int __declspec(dllexport) force_implib_creation;
# endif

View File

@@ -1,22 +0,0 @@
// Copyright (c) 2003 Vladimir Prus
//
// 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)
//
// http://www.boost.org
//
// This file will declare 'foo' is 'MACROS' is NOT defined.
#ifndef MACROS
void
# ifdef _WIN32
__declspec(dllexport)
# endif
foo() {}
#endif
# ifdef _WIN32
int __declspec(dllexport) force_implib_creation;
# endif

View File

@@ -1,13 +0,0 @@
# Copyright 2002 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)
# This will link correctly only if symbol MACROS is defined when compiling
# b.cpp. However, this is only possible if that symbol is requested
# on command line and b.cpp is compiled with directly requested
# properties.
exe a : a.cpp b ;
lib b : b.cpp ;

View File

@@ -1,9 +0,0 @@
# This will link correctly only if symbol MACROS is not defined when
# compiling b.cpp. This tests if direct build request
# 'release <define>MACROS' to 'b' does not add 'MACROS' when 'b'
# is compiled with 'debug' -- the version needed by 'a'.
exe a : a.cpp b : <variant>debug ;
lib b : b.cpp ;

View File

@@ -1,6 +0,0 @@
# Copyright 2002 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)
import gcc ;

View File

@@ -4,9 +4,42 @@ import BoostBuild
t = BoostBuild.Tester()
# First check some startup.
t.set_tree("direct-request-test")
t.write("jamroot.jam", "")
t.write("jamfile.jam", """
exe a : a.cpp b ;
lib b : b.cpp ;
""")
t.write("a.cpp", """
void
# ifdef _WIN32
__declspec(dllimport)
# endif
foo();
int main()
{
foo();
}
""")
t.write("b.cpp", """
#ifdef MACROS
void
# ifdef _WIN32
__declspec(dllexport)
# endif
foo() {}
#endif
# ifdef _WIN32
int __declspec(dllexport) force_implib_creation;
# endif
""")
t.run_build_system(extra_args="define=MACROS")
t.expect_addition("bin/$toolset/debug/"
* (BoostBuild.List("a.obj b.obj b.dll a.exe")))
@@ -19,11 +52,11 @@ t.expect_addition("bin/$toolset/debug/"
* (BoostBuild.List("a.obj b.obj b.dll a.exe")))
# When building release version, the 'define' should not apply: we will have
# direct build request 'release <define>MACROS' and a real build property
# 'debug'.
t.copy("jamfile2.jam", "jamfile.jam")
t.copy("b_inverse.cpp", "b.cpp")
# When building release version, the 'define' still applies.
t.write("jamfile.jam", """
exe a : a.cpp b : <variant>debug ;
lib b : b.cpp ;
""")
t.rm("bin")
t.run_build_system(extra_args="release define=MACROS")

View File

@@ -158,6 +158,7 @@ tests = [ "absolute_sources",
# "default_toolset",
"dependency_property",
"dependency_test",
"direct_request_test",
"disambiguation",
"dll_path",
"double_loading",