Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/v1_testing.py @ 32

Last change on this file since 32 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 3.8 KB
Line 
1#!/usr/bin/python
2
3# Copyright 2002 Dave Abrahams
4# Copyright 2004 Vladimir Prus
5# Distributed under the Boost Software License, Version 1.0.
6# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7
8from BoostBuild import Tester, List
9import os
10from string import strip
11import re
12import time
13
14def match_re(actual,expected):
15    return re.match(expected,actual,re.DOTALL) != None
16
17t = Tester(match = match_re, boost_build_path = os.path.join(os.getcwd(), ".."))
18t.set_tree('v1_testing')
19
20os.environ['TOOLS'] = 'gcc'
21os.environ['NOARSCAN'] = '1'
22
23# 1) No existing bin directories.  Both build and test ran fine. As
24# expected, the residue files were a bit different: There was no
25# path_test.success, and path_test.test contained the word "passed"
26# instead of the path to the .cpp file.  I've haven't looked yet to
27# see if the lack of the path is a problem for reporting, but
28# hopefully the information is trivially available somewhere else.
29t.run_build_system(arguments = 'test', status = 0)
30t.expect_addition(
31    ['bin/compile.test/gcc/debug/runtime-link-dynamic/compile.test'
32     , 'bin/nocompile.test/gcc/debug/runtime-link-dynamic/nocompile.test'
33     , 'bin/link.test/gcc/debug/runtime-link-dynamic/link.test'
34     , 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
35     , 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
36
37
38# 2) Missing source file for the library build. path_test.test was
39# deleted, so the reporting programs would know that failure
40# occurred. The stdout messages also indicated what had
41# happened. Excellent!
42t.rename('lib.cpp', 'lib.cpp.bak')
43t.run_build_system(arguments = 'test', status = 1)
44t.expect_removal(
45    ['bin/link.test/gcc/debug/runtime-link-dynamic/link.test'
46     , 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
47     , 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
48
49# 3) Missing file restored. Worked fine; path_test.test was recreated,
50# no other files were touched.
51t.rename('lib.cpp.bak', 'lib.cpp')
52t.run_build_system(arguments = 'test', status = 0)
53t.expect_addition(
54    [ 'bin/link.test/gcc/debug/runtime-link-dynamic/link.test'
55     , 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
56     , 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
57     # I didn't add a test for 'no other files were touched', because
58     # it's a little complicated. There is an expect_nothing_more()
59     # function, but we actually need to spell out a lot more than
60     # what we currently have to do that.
61
62# 4) Introduced error into one of the library files, causing a library build
63# compile to fail. path_test.test was deleted, so the reporting programs
64# would know that failure occurred. Excellent! This is the case that has
65# caused regression testing to report the wrong results in the past, so it
66# was good news to see it working correctly now. We probably should figure
67# out some other test cases just to be sure it is working for full coverage.
68t.rename('lib.cpp', 'lib.cpp.bak')
69t.rename('lib-err.cpp', 'lib.cpp')
70t.touch('lib.cpp')
71t.run_build_system(arguments = 'test', status=1)
72t.expect_removal(
73    ['bin/link.test/gcc/debug/runtime-link-dynamic/link.test'
74     , 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
75     , 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
76
77# 5) Fixed the error in the library file.  The library build then worked, and
78# path_test.exe was relinked, without first recompiling path_test.obj. Test
79# was rerun. Exactly right behavior!
80t.rename('lib.cpp.bak', 'lib.cpp')
81t.run_build_system(arguments = 'test', status = 0)
82t.expect_addition(
83    [ 'bin/link.test/gcc/debug/runtime-link-dynamic/link.test'
84     , 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
85     , 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
86
87t.cleanup()
88print 'tesing complete'
Note: See TracBrowser for help on using the repository browser.