Imported Upstream version 1.57.0
[platform/upstream/boost.git] / tools / build / test / core_varnames.py
1 #!/usr/bin/python
2
3 # Copyright 2003 Dave Abrahams
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 # This tests the core rule for enumerating the variable names in a module.
8
9 import BoostBuild
10
11 t = BoostBuild.Tester(pass_toolset=0)
12
13 t.write("file.jam", """\
14 module foo
15 {
16     rule bar { }
17     var1 = x y ;
18     var2 = fubar ;
19 }
20
21 expected = var1 var2 ;
22 names = [ VARNAMES foo ] ;
23 if $(names) in $(expected) && $(expected) in $(names)
24 {
25     # everything OK
26 }
27 else
28 {
29     EXIT expected to find variables $(expected:J=", ") in module foo,
30     but found $(names:J=", ") instead. ;
31 }
32 DEPENDS all : xx ;
33 NOTFILE xx ;
34 """)
35
36 t.run_build_system(["-ffile.jam"], status=0)
37
38 t.cleanup()