Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-08-22 18:06:58


Author: jurko
Date: 2008-08-22 18:06:57 EDT (Fri, 22 Aug 2008)
New Revision: 48296
URL: http://svn.boost.org/trac/boost/changeset/48296

Log:
Dumping test results no longer fails due to test sources not being located under the main project folder. Added a corresponding unit test which can also be used as a focal point for future test result dumping tests.
Added:
   trunk/tools/build/v2/test/test_result_dumping.py (contents, props changed)
Text files modified:
   trunk/tools/build/v2/test/test_all.py | 3 ++-
   trunk/tools/build/v2/tools/testing.jam | 6 +++---
   2 files changed, 5 insertions(+), 4 deletions(-)

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 2008-08-22 18:06:57 EDT (Fri, 22 Aug 2008)
@@ -169,7 +169,8 @@
           "free_features_request",
           "file_name_handling",
           "sort_rule",
- "ordered_include"
+ "ordered_include",
+ "test_result_dumping"
           ]
 
 if os.name == 'posix':

Added: trunk/tools/build/v2/test/test_result_dumping.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/test_result_dumping.py 2008-08-22 18:06:57 EDT (Fri, 22 Aug 2008)
@@ -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" : "../TestSource/test.cpp"')
+
+t.cleanup()

Modified: trunk/tools/build/v2/tools/testing.jam
==============================================================================
--- trunk/tools/build/v2/tools/testing.jam (original)
+++ trunk/tools/build/v2/tools/testing.jam 2008-08-22 18:06:57 EDT (Fri, 22 Aug 2008)
@@ -249,9 +249,9 @@
                   [ path.pwd ] ] ;
 
             source-files +=
- [ path.relative
- $(location)
- [ path.root $(project-root) [ path.pwd ] ] ] ;
+ [ path.relative-to
+ [ path.root $(project-root) [ path.pwd ] ]
+ $(location) ] ;
         }
     }
 


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