2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-13 00:12:11 +00:00
Files
build/test/unused.py
Steven Watanabe e187955f5e Update unused.py and add it to test_all.py.
[SVN r75879]
2011-12-09 18:19:50 +00:00

34 lines
888 B
Python

#!/usr/bin/python
# Copyright 2003 Vladimir Prus
# 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)
# Test that unused sources are at least reported.
import BoostBuild
from string import find
t = BoostBuild.Tester()
t.set_tree("unused")
t.run_build_system()
# The second invocation should do nothing, and produce no warning. The previous
# invocation might have printed executed actions and other things, so it is not
# easy to check if warning was issued or not.
t.run_build_system(stdout="")
t.run_build_system("-sGENERATE_ONLY_UNUSABLE=1", stdout="")
# Now check that even if main target generates nothing, its usage requirements
# are still propagated to dependants.
t.write("a.cpp", """
#ifdef FOO
int main() {}
#endif
""")
t.run_build_system("-sGENERATE_NOTHING=1")
t.cleanup()