Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86767 - in trunk/tools/build/v2: build test
From: steven_at_[hidden]
Date: 2013-11-19 12:30:34


Author: steven_watanabe
Date: 2013-11-19 12:30:34 EST (Tue, 19 Nov 2013)
New Revision: 86767
URL: http://svn.boost.org/trac/boost/changeset/86767

Log:
Avoid sorting the sources of composing generators.

Added:
   trunk/tools/build/v2/test/source_order.py (contents, props changed)
Text files modified:
   trunk/tools/build/v2/build/generators.jam | 2
   trunk/tools/build/v2/test/source_order.py | 53 ++++++++++++++++++++++++++++++++++++++++
   trunk/tools/build/v2/test/test_all.py | 1
   3 files changed, 55 insertions(+), 1 deletions(-)

Modified: trunk/tools/build/v2/build/generators.jam
==============================================================================
--- trunk/tools/build/v2/build/generators.jam Tue Nov 19 09:53:24 2013 (r86766)
+++ trunk/tools/build/v2/build/generators.jam 2013-11-19 12:30:34 EST (Tue, 19 Nov 2013) (r86767)
@@ -667,7 +667,7 @@
                     result += $(source) ;
                 }
             }
- return [ sequence.unique $(result) ] ;
+ return [ sequence.unique $(result) : stable ] ;
         }
     }
 

Added: trunk/tools/build/v2/test/source_order.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/tools/build/v2/test/source_order.py 2013-11-19 12:30:34 EST (Tue, 19 Nov 2013) (r86767)
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+
+# Copyright 2013 Steven Watanabe
+# 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)
+
+# Tests that action sources are not reordered
+
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+t.write("check-order.jam", """\
+import type ;
+import generators ;
+
+type.register ORDER_TEST : order-test ;
+
+SPACE = " " ;
+nl = "\n" ;
+actions check-order
+{
+ echo$(SPACE)$(>[1])$(SPACE)>$(<[1])
+ echo$(SPACE)$(>[2-])$(SPACE)>>$(<[1])$(nl)
+}
+
+generators.register-composing check-order.check-order : C : ORDER_TEST ;
+""")
+
+# The aliases are necessary for this test, since
+# the targets were sorted by virtual target
+# id, not by file name.
+t.write("jamroot.jam", """\
+import check-order ;
+alias file1 : file1.c ;
+alias file2 : file2.c ;
+alias file3 : file3.c ;
+order-test check : file2 file1 file3 ;
+""")
+
+t.write("file1.c", "")
+t.write("file2.c", "")
+t.write("file3.c", "")
+
+t.run_build_system()
+t.expect_addition("bin/$toolset/debug/check.order-test")
+t.expect_content("bin/$toolset/debug/check.order-test", """\
+file2.c
+file1.c
+file3.c
+""", True)
+
+t.cleanup()

Modified: trunk/tools/build/v2/test/test_all.py
==============================================================================
--- trunk/tools/build/v2/test/test_all.py Tue Nov 19 09:53:24 2013 (r86766)
+++ trunk/tools/build/v2/test/test_all.py 2013-11-19 12:30:34 EST (Tue, 19 Nov 2013) (r86767)
@@ -253,6 +253,7 @@
          "skipping",
          "sort_rule",
          "source_locations",
+ "source_order",
          "space_in_path",
          "stage",
          "standalone",


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