Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/unused.py @ 29

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

updated boost from 1_33_1 to 1_34_1

File size: 1.0 KB
Line 
1#!/usr/bin/python
2
3# Copyright 2003 Vladimir Prus
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
6
7# Test that unused sources are at least reported.
8
9from BoostBuild import Tester
10from string import find
11t = Tester()
12
13t.set_tree("unused")
14
15t.run_build_system()
16# The second invocation should do nothing, and produce
17# no warning. The previous invocation might have printed
18# executed actions and other things, so it's not easy
19# to check if warning was issued or not.
20t.run_build_system()
21t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)
22
23t.run_build_system("-sGENERATE_ONLY_UNUSABLE=1")
24t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)
25
26# Now check that even if main target generates nothing, its
27# usage requirements are still propagated to dependents.
28t.write("a.cpp","""
29#ifdef FOO
30int main() {}
31#endif
32""")
33t.run_build_system("-sGENERATE_NOTHING=1")
34
35t.cleanup()
36
Note: See TracBrowser for help on using the repository browser.