Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80981 - in trunk/tools/build/v2: test tools
From: steven_at_[hidden]
Date: 2012-10-13 17:58:55


Author: steven_watanabe
Date: 2012-10-13 17:58:54 EDT (Sat, 13 Oct 2012)
New Revision: 80981
URL: http://svn.boost.org/trac/boost/changeset/80981

Log:
Add test for message.jam
Added:
   trunk/tools/build/v2/test/message.py (contents, props changed)
Text files modified:
   trunk/tools/build/v2/test/test_all.py | 1 +
   trunk/tools/build/v2/tools/message.jam | 23 +++++++++++++++--------
   2 files changed, 16 insertions(+), 8 deletions(-)

Added: trunk/tools/build/v2/test/message.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/message.py 2012-10-13 17:58:54 EDT (Sat, 13 Oct 2012)
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+
+# Copyright (C) Vladimir Prus 2003.
+# 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 for the regression testing framework.
+
+import BoostBuild
+
+# Create a temporary working directory.
+t = BoostBuild.Tester()
+
+t.write("Jamroot.jam", """
+project
+ :
+ : usage-requirements <define>TEST=1
+ : default-build <link>static
+;
+message hello : "Hello World!" ;
+alias hello : : <link>shared ;
+obj test : test.cpp hello : <link>static ;
+""")
+
+t.write("test.cpp", """
+#ifndef TEST
+#error TEST not defined
+#endif
+""")
+
+t.run_build_system(["test"], stdout="""Hello World!
+""")
+
+t.expect_addition("bin/$toolset/link-static/test.o")
+t.expect_nothing_more()
+
+t.cleanup()

Modified: trunk/tools/build/v2/test/test_all.py
==============================================================================
--- trunk/tools/build/v2/test/test_all.py (original)
+++ trunk/tools/build/v2/test/test_all.py 2012-10-13 17:58:54 EDT (Sat, 13 Oct 2012)
@@ -223,6 +223,7 @@
          "load_order",
          "loop",
          "make_rule",
+ "message",
          "ndebug",
          "no_type",
          "notfile",

Modified: trunk/tools/build/v2/tools/message.jam
==============================================================================
--- trunk/tools/build/v2/tools/message.jam (original)
+++ trunk/tools/build/v2/tools/message.jam 2012-10-13 17:58:54 EDT (Sat, 13 Oct 2012)
@@ -12,16 +12,17 @@
 
 class message-target-class : basic-target
 {
- rule __init__ ( name-and-dir : project : * )
+ rule set-message ( * )
     {
- basic-target.__init__ $(name-and-dir) : $(project) ;
+ self.1 = $(1) ;
+ self.2 = $(2) ;
         self.3 = $(3) ;
         self.4 = $(4) ;
         self.5 = $(5) ;
         self.6 = $(6) ;
         self.7 = $(7) ;
         self.8 = $(8) ;
- self.9 = $(9) ;
+ self.9 = $(9) ;
         self.built = ;
     }
     
@@ -29,7 +30,7 @@
     {
         if ! $(self.built)
         {
- for i in 3 4 5 6 7 8 9
+ for i in 1 2 3 4 5 6 7 8 9
             {
                 if $(self.$(i))
                 {
@@ -48,8 +49,14 @@
 {
     local project = [ project.current ] ;
 
- targets.main-target-alternative
- [ new message-target-class $(name) : $(project)
- : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) ] ;
+ local result = [ targets.main-target-alternative
+ [ new message-target-class $(name) : $(project)
+ : [ targets.main-target-sources : $(name) ]
+ : [ targets.main-target-requirements : $(project) ]
+ : [ targets.main-target-default-build : $(project) ]
+ : [ targets.main-target-usage-requirements : $(project) ]
+ ] ] ;
+ $(result).set-message $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
+ return $(result) ;
 }
-IMPORT $(__name__) : message : : message ;
\ No newline at end of file
+IMPORT $(__name__) : message : : message ;


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