|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r48645 - in trunk/tools/build/v2: test tools
From: jurko.gospodnetic_at_[hidden]
Date: 2008-09-07 03:33:30
Author: jurko
Date: 2008-09-07 03:33:30 EDT (Sun, 07 Sep 2008)
New Revision: 48645
URL: http://svn.boost.org/trac/boost/changeset/48645
Log:
Fixed how Boost Build's automated testing results get reported in case of tests running on files containing spaces in their path. Regression test added as well.
Added:
trunk/tools/build/v2/test/testing_support.py (contents, props changed)
Text files modified:
trunk/tools/build/v2/test/test_all.py | 1 +
trunk/tools/build/v2/tools/testing.jam | 9 +++++++--
2 files changed, 8 insertions(+), 2 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-09-07 03:33:30 EDT (Sun, 07 Sep 2008)
@@ -167,6 +167,7 @@
"suffix",
"tag",
"test_result_dumping",
+ "testing_support",
"timedata",
"unit_test",
"use_requirements",
Added: trunk/tools/build/v2/test/testing_support.py
==============================================================================
--- (empty file)
+++ trunk/tools/build/v2/test/testing_support.py 2008-09-07 03:33:30 EDT (Sun, 07 Sep 2008)
@@ -0,0 +1,61 @@
+#!/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 different aspects of Boost Builds automated testing support.
+
+import BoostBuild
+
+
+################################################################################
+#
+# test_files_with_spaces_in_their_name()
+# --------------------------------------
+#
+################################################################################
+
+def test_files_with_spaces_in_their_name():
+ """Regression test making sure test result files get created correctly when
+ testing files with spaces in their name.
+ """
+
+ t = BoostBuild.Tester()
+
+ t.write("valid source.cpp", "int main() {}\n");
+
+ t.write("invalid source.cpp", "this is not valid source code");
+
+ t.write("jamroot.jam", """
+import testing ;
+testing.compile "valid source.cpp" ;
+testing.compile-fail "invalid source.cpp" ;
+""")
+
+ t.run_build_system(status=0)
+ t.expect_addition("bin/invalid source.test/$toolset/debug/invalid source.obj")
+ t.expect_addition("bin/invalid source.test/$toolset/debug/invalid source.test")
+ t.expect_addition("bin/valid source.test/$toolset/debug/valid source.obj")
+ t.expect_addition("bin/valid source.test/$toolset/debug/valid source.test")
+
+ t.expect_content("bin/valid source.test/$toolset/debug/valid source.test", \
+ "passed" )
+ t.expect_content( \
+ "bin/invalid source.test/$toolset/debug/invalid source.test", \
+ "passed" )
+ t.expect_content( \
+ "bin/invalid source.test/$toolset/debug/invalid source.obj", \
+ "failed as expected" )
+
+ t.cleanup()
+
+
+################################################################################
+#
+# main()
+# ------
+#
+################################################################################
+
+test_files_with_spaces_in_their_name()
Modified: trunk/tools/build/v2/tools/testing.jam
==============================================================================
--- trunk/tools/build/v2/tools/testing.jam (original)
+++ trunk/tools/build/v2/tools/testing.jam 2008-09-07 03:33:30 EDT (Sun, 07 Sep 2008)
@@ -356,15 +356,20 @@
}
+# Used to create test files signifying passed tests.
+#
actions **passed**
{
- echo passed > $(<)
+ echo passed > "$(<)"
}
+# Used to create replacement object files that do not get created during tests
+# that are expected to fail.
+#
actions (failed-as-expected)
{
- echo failed as expected > $(<)
+ echo failed as expected > "$(<)"
}
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