Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80012 - in trunk/tools/build/v2/test: . dependency-test dependency-test/src1 dependency-test/src2
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-13 13:55:22


Author: jurko
Date: 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
New Revision: 80012
URL: http://svn.boost.org/trac/boost/changeset/80012

Log:
Internal Boost Build dependency_test.py test cleanup - removed some old and no longer relevant comments (from the time before the <dependency> feature got renamed to <implicit-dependency>), better commented the <implicit-dependency> feature usage, removed redundant ignoring of *.tds Borland debugger symbol files (already done internally in the BoostBuild.py testing system implementation module), minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/test/dependency-test/a.cpp | 13 ++------
   trunk/tools/build/v2/test/dependency-test/a.h | 12 ++-----
   trunk/tools/build/v2/test/dependency-test/a_c.c | 12 ++-----
   trunk/tools/build/v2/test/dependency-test/b.cpp | 12 ++-----
   trunk/tools/build/v2/test/dependency-test/b.h | 12 ++-----
   trunk/tools/build/v2/test/dependency-test/c.cpp | 12 ++-----
   trunk/tools/build/v2/test/dependency-test/e.cpp | 13 ++------
   trunk/tools/build/v2/test/dependency-test/foo.jam | 15 +++++----
   trunk/tools/build/v2/test/dependency-test/foo.py | 20 ++++++-------
   trunk/tools/build/v2/test/dependency-test/jamfile.jam | 58 ++++++++++++++++++++++++---------------
   trunk/tools/build/v2/test/dependency-test/jamroot.jam | 8 ++--
   trunk/tools/build/v2/test/dependency-test/src1/a.h | 12 ++-----
   trunk/tools/build/v2/test/dependency-test/src1/b.h | 12 ++-----
   trunk/tools/build/v2/test/dependency-test/src1/c.h | 12 ++-----
   trunk/tools/build/v2/test/dependency-test/src1/z.h | 7 ++--
   trunk/tools/build/v2/test/dependency-test/src2/b.h | 12 ++-----
   trunk/tools/build/v2/test/dependency_test.py | 22 +++++---------
   17 files changed, 113 insertions(+), 151 deletions(-)

Modified: trunk/tools/build/v2/test/dependency-test/a.cpp
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/a.cpp (original)
+++ trunk/tools/build/v2/test/dependency-test/a.cpp 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,11 +1,7 @@
-// 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
-//
+// 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)
 
 #include <a.h>
 # include "a.h"
@@ -13,5 +9,4 @@
 
 int main()
 {
- return 0;
 }

Modified: trunk/tools/build/v2/test/dependency-test/a.h
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/a.h (original)
+++ trunk/tools/build/v2/test/dependency-test/a.h 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,8 +1,4 @@
-// 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
-//
+// 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)

Modified: trunk/tools/build/v2/test/dependency-test/a_c.c
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/a_c.c (original)
+++ trunk/tools/build/v2/test/dependency-test/a_c.c 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,11 +1,7 @@
-// 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
-//
+// 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)
 
 #include <a.h>
 # include "a.h"

Modified: trunk/tools/build/v2/test/dependency-test/b.cpp
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/b.cpp (original)
+++ trunk/tools/build/v2/test/dependency-test/b.cpp 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,11 +1,7 @@
-// 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
-//
+// 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)
 
 #include "a.h"
 

Modified: trunk/tools/build/v2/test/dependency-test/b.h
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/b.h (original)
+++ trunk/tools/build/v2/test/dependency-test/b.h 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,8 +1,4 @@
-// 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
-//
+// 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)

Modified: trunk/tools/build/v2/test/dependency-test/c.cpp
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/c.cpp (original)
+++ trunk/tools/build/v2/test/dependency-test/c.cpp 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,11 +1,7 @@
-// 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
-//
+// 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)
 
 #include "x.h"
 

Modified: trunk/tools/build/v2/test/dependency-test/e.cpp
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/e.cpp (original)
+++ trunk/tools/build/v2/test/dependency-test/e.cpp 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,15 +1,10 @@
-// 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
-//
+// 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)
 
 #include "x.h"
 
 int main()
 {
- return 0;
 }

Modified: trunk/tools/build/v2/test/dependency-test/foo.jam
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/foo.jam (original)
+++ trunk/tools/build/v2/test/dependency-test/foo.jam 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,7 +1,8 @@
-# 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)
+# 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 copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 import generators ;
 import modules ;
@@ -21,10 +22,10 @@
     # On NT, you need an exported symbol in order to have an import library
     # generated. We will not really use the symbol defined here, just force the
     # import library creation.
- if ( [ os.name ] = NT || [ modules.peek : OS ] in CYGWIN )
- && <main-target-type>LIB in $(properties)
+ if ( [ os.name ] = NT || [ modules.peek : OS ] in CYGWIN ) &&
+ <main-target-type>LIB in $(properties)
     {
- .decl = "void __declspec(dllexport) foo(){}" ;
+ .decl = "void __declspec(dllexport) foo() {}" ;
     }
     print.output $(<[1]) ;
     print.text $(.decl:E="//")$(nl) ;

Modified: trunk/tools/build/v2/test/dependency-test/foo.py
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/foo.py (original)
+++ trunk/tools/build/v2/test/dependency-test/foo.py 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,7 +1,8 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2005, 2010 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2005, 2010 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)
 
 import bjam
 import b2.build.type as type
@@ -13,14 +14,11 @@
 generators.register_standard("foo.foo", ["FOO"], ["CPP", "H"])
 
 def prepare_foo(targets, sources, properties):
-
     if properties.get('os') in ['windows', 'cygwin']:
- bjam.call('set-target-variable', targets, "DECL",
- "void __declspec(dllexport) foo(){}")
-
- pass
+ bjam.call('set-target-variable', targets, "DECL",
+ "void __declspec(dllexport) foo() {}")
 
-get_manager().engine().register_action("foo.foo",\
-"""echo -e $(DECL:E="//")\\n > $(<[1])
+get_manager().engine().register_action("foo.foo", """\
+echo -e $(DECL:E="//")\\n > $(<[1])
 echo -e "#include <z.h>\\n" > $(<[2])
 """, function=prepare_foo)

Modified: trunk/tools/build/v2/test/dependency-test/jamfile.jam
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/jamfile.jam (original)
+++ trunk/tools/build/v2/test/dependency-test/jamfile.jam 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,25 +1,39 @@
-# 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)
+# Copyright 2002, 2003, 2005 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)
 
 
-project test
- : requirements <include>src1
- ;
+project test : requirements <include>src1 ;
 
-exe a
- : x.foo a.cpp a_c.c
- ;
-
-exe b
- : b.cpp
- ;
-
-# Because of <define>, c.cpp will be compiled to different
-# directory than everything for main target "a". Therefore
-# without <implicit-dependency>, it won't find "x.h", which is part
-# of "a"'s dependency graph.
-exe c
- : c.cpp
- : <define>FOO <implicit-dependency>a
- ;
+exe a : x.foo a.cpp a_c.c ;
+exe b : b.cpp ;
+
+
+# Because of <define>FOO, c.cpp will be compiled to a different directory than
+# everything for main target "a". Therefore, without <implicit-dependency>, it
+# will not find "x.h", which is part of "a"'s dependency graph.
+#
+# --------------------------
+# More detailed explanation:
+# --------------------------
+# c.cpp includes x.h which does not exist on the current include path so Boost
+# Jam will try to match it to existing Jam targets to cover cases as this one
+# where the file is generated by the same build.
+#
+# However, as x.h is not part of "c" metatarget's dependency graph, Boost
+# Build will not actualize its target by default, i.e. create its Jam target.
+#
+# To get the Jam target created in time, we use the <implicit-dependency>
+# feature. This tells Boost Build that it needs to actualize the dependency
+# graph for metatarget "a", even though that metatarget has not been directly
+# mentioned and is not a dependency for any of the metatargets mentioned in the
+# current build request.
+#
+# Note that Boost Build does not automatically add a dependency between the
+# Jam targets in question so, if Boost Jam does not add a dependency on a
+# target from that other dependency graph (x.h in our case), i.e. if c.cpp does
+# not actually include x.h, us actualizing it will have no effect in the end as
+# Boost Jam will not have a reason to actually build those targets in spite of
+# knowing about them.
+exe c : c.cpp : <define>FOO <implicit-dependency>a ;

Modified: trunk/tools/build/v2/test/dependency-test/jamroot.jam
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/jamroot.jam (original)
+++ trunk/tools/build/v2/test/dependency-test/jamroot.jam 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,7 +1,7 @@
-# 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)
-
+# Copyright 2002 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)
 
 import gcc ;
 import foo ;

Modified: trunk/tools/build/v2/test/dependency-test/src1/a.h
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/src1/a.h (original)
+++ trunk/tools/build/v2/test/dependency-test/src1/a.h 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,10 +1,6 @@
-// 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
-//
+// 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)
 
 #include "b.h"

Modified: trunk/tools/build/v2/test/dependency-test/src1/b.h
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/src1/b.h (original)
+++ trunk/tools/build/v2/test/dependency-test/src1/b.h 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,10 +1,6 @@
-// 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
-//
+// 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)
 
 #include "c.h"

Modified: trunk/tools/build/v2/test/dependency-test/src1/c.h
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/src1/c.h (original)
+++ trunk/tools/build/v2/test/dependency-test/src1/c.h 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,8 +1,4 @@
-// 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
-//
+// 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)

Modified: trunk/tools/build/v2/test/dependency-test/src1/z.h
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/src1/z.h (original)
+++ trunk/tools/build/v2/test/dependency-test/src1/z.h 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,5 +1,6 @@
-/* Copyright 2003, 2004, 2006 Vladimir Prus */
+/* Copyright 2003, 2004, 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) */
+/* (See accompanying file LICENSE_1_0.txt or copy at */
+/* http://www.boost.org/LICENSE_1_0.txt) */
 
-extern int dummy_variabled_need_to_suppress_empty_file_warning_on_hp_cxx_compiler;
+extern int dummy_variable_suppressing_empty_file_warning_on_hp_cxx_compiler;

Modified: trunk/tools/build/v2/test/dependency-test/src2/b.h
==============================================================================
--- trunk/tools/build/v2/test/dependency-test/src2/b.h (original)
+++ trunk/tools/build/v2/test/dependency-test/src2/b.h 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -1,8 +1,4 @@
-// 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
-//
+// 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)

Modified: trunk/tools/build/v2/test/dependency_test.py
==============================================================================
--- trunk/tools/build/v2/test/dependency_test.py (original)
+++ trunk/tools/build/v2/test/dependency_test.py 2012-08-13 13:55:20 EDT (Mon, 13 Aug 2012)
@@ -31,20 +31,15 @@
     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 a 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.
+ # Only source files using include <a.h> should be compiled.
     t.touch("src1/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.ignore("*.tds")
     t.expect_nothing_more()
 
     # "src/a.h" includes "b.h" (in the same dir).
@@ -53,7 +48,6 @@
     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.ignore("*.tds")
     t.expect_nothing_more()
 
     # Included by "src/b.h". We had a bug: file included using double quotes
@@ -94,14 +88,14 @@
     t = BoostBuild.Tester(["-d3", "-d+12"], pass_d0=False)
 
     t.write("jamroot.jam", """\
- path-constant TOP : . ;
- exe app : main.cpp : <include>$(TOP)/include ;
- """);
+path-constant TOP : . ;
+exe app : main.cpp : <include>$(TOP)/include ;
+""");
 
     t.write("main.cpp", """\
- #include <dir/header.h>
- int main() {}
- """)
+#include <dir/header.h>
+int main() {}
+""")
 
     t.write("include/dir/header.h", "\n")
 
@@ -116,4 +110,4 @@
 
 
 test_basic()
-test_scanned_includes_with_absolute_paths()
\ No newline at end of file
+test_scanned_includes_with_absolute_paths()


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