|
Boost-Build : |
From: Jurko Gospodnetiæ (jurko.gospodnetic_at_[hidden])
Date: 2008-07-25 21:03:53
Hi all.
> 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.
Wooops! I managed to mess that patch up and pass some rule parameters
in an inorrect order. Here's a corrected patch.
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" : "../TestSource/test.cpp"')
+
+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,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-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