Boost logo

Boost-Build :

From: Jurko Gospodnetiæ (jurko.gospodnetic_at_[hidden])
Date: 2008-07-25 20:24:34


   Hi.

   When you implement a Boost Build manages testing project it works
fine with source files being placed under that project's main folder as
well as when they are placed elsewhere. However, if you attempt to run
bjam with a --dump-tests command-line option you get a Boost Build error
in case the test source files are not located under the project's main
folder.

   Attached is a patch containing a test case for this, as well as a
simple fix. The test case is also a place-holder for any future tests
related to the Boost Build test result dumping.

   Just let me know when I can commit this. It should not break anything
as it only allows projects that used to break Boost Build builds to not
do so any more.

   Hope this helps.

   Best regards,
     Jurko Gospodnetiæ

Index: tools/build/v2/test/test_all.py
===================================================================
--- tools/build/v2/test/test_all.py (revision 47692)
+++ tools/build/v2/test/test_all.py (working copy)
@@ -169,7 +169,8 @@
           "free_features_request",
           "file_name_handling",
           "sort_rule",
- "ordered_include"
+ "ordered_include",
+ "test_result_dumping"
           ]
 
 if os.name == 'posix':
Index: tools/build/v2/test/test_result_dumping.py
===================================================================
--- tools/build/v2/test/test_result_dumping.py (revision 0)
+++ tools/build/v2/test/test_result_dumping.py (revision 0)
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+
+# Copyright 2008 Jurko Gospodnetic
+# 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 dumping Boost Build based testing results.
+
+import BoostBuild
+
+
+################################################################################
+#
+# Test that dumping Boost Build based testing results works in case test code
+# is not located in a folder under the Jamroot folder.
+#
+################################################################################
+
+t = BoostBuild.Tester("--dump-tests")
+
+t.write("TestBuild/Jamroot.jam", """
+import testing ;
+test-suite testit : [ run ../TestSource/test.cpp ] ;
+""")
+
+t.write("TestSource/test.cpp", """
+int main() {}
+""")
+
+t.run_build_system("", subdir="TestBuild")
+t.expect_output_line('boost-test(RUN) "*/TestBuild/test" : "../../TestBuild"')
+
+t.cleanup()

Property changes on: tools\build\v2\test\test_result_dumping.py
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/x-python
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Index: tools/build/v2/tools/testing.jam
===================================================================
--- tools/build/v2/tools/testing.jam (revision 47825)
+++ tools/build/v2/tools/testing.jam (working copy)
@@ -249,7 +249,7 @@
                   [ path.pwd ] ] ;
 
             source-files +=
- [ path.relative
+ [ path.relative-to
                   $(location)
                   [ path.root $(project-root) [ path.pwd ] ] ] ;
         }


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