From b9e68f7dfd0ed6225ad4a85e1a19ee0a7aeec774 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 07:25:48 +0000 Subject: [PATCH] Tests for more examples. [SVN r33656] --- v2/test/example_customization.py | 23 +++++++++++++++++++++++ v2/test/example_gettext.py | 31 +++++++++++++++++++++++++++++++ v2/test/example_make.py | 20 ++++++++++++++++++++ v2/test/test_all.py | 7 +++++++ 4 files changed, 81 insertions(+) create mode 100644 v2/test/example_customization.py create mode 100644 v2/test/example_gettext.py create mode 100644 v2/test/example_make.py diff --git a/v2/test/example_customization.py b/v2/test/example_customization.py new file mode 100644 index 000000000..fbb12071f --- /dev/null +++ b/v2/test/example_customization.py @@ -0,0 +1,23 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'libraries' example. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/customization") + +t.run_build_system() + +t.expect_addition(["bin/$toolset/debug/codegen.exe", + "bin/$toolset/debug/usage.cpp"]) + + + +t.cleanup() diff --git a/v2/test/example_gettext.py b/v2/test/example_gettext.py new file mode 100644 index 000000000..3fcc4ec04 --- /dev/null +++ b/v2/test/example_gettext.py @@ -0,0 +1,31 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'libraries' example. +from BoostBuild import Tester, List +import os +import string + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/gettext") + +t.run_build_system(stderr=None) + +t.expect_addition(["bin/$toolset/debug/main.exe", + "bin/$toolset/debug/russian.mo"]) + + +file = t.adjust_names(["bin/$toolset/debug/main.exe"])[0] + +input_fd = os.popen(file) +input = input_fd.read(); + +t.fail_test(string.find(input, "international hello") != 0) + +t.cleanup() diff --git a/v2/test/example_make.py b/v2/test/example_make.py new file mode 100644 index 000000000..3eb360912 --- /dev/null +++ b/v2/test/example_make.py @@ -0,0 +1,20 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'libraries' example. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/make") + +t.run_build_system() + +t.expect_addition(["bin/$toolset/debug/main.exe"]) + +t.cleanup() diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 56d571864..6f856e782 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -141,6 +141,7 @@ tests = [ "rebuilds", "lib_source_property", "implicit_dependency", "example_libraries", + "example_make", ] if os.name == 'posix': @@ -159,6 +160,12 @@ if string.find(get_toolset(), 'gcc') == 0: if "--extras" in sys.argv: tests.append("boostbook") tests.append("example_qt4") + # Requires ./whatever.py to work, so is + # not guaranted to work everywhere. + tests.append("example_customization") + # Requires gettext tools. + tests.append("example_gettext") + else: print 'Note: skipping extra tests'