1#!/usr/local/bin/python3.8
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
9import BoostBuild
10
11t = BoostBuild.Tester(pass_toolset=0)
12
13t.write("file.jam", """\
14module foo
15{
16    rule bar { }
17    var1 = x y ;
18    var2 = fubar ;
19}
20
21expected = var1 var2 ;
22names = [ VARNAMES foo ] ;
23if $(names) in $(expected) && $(expected) in $(names)
24{
25    # everything OK
26}
27else
28{
29    EXIT expected to find variables $(expected:J=", ") in module foo,
30    but found $(names:J=", ") instead. ;
31}
32DEPENDS all : xx ;
33NOTFILE xx ;
34""")
35
36t.run_build_system(["-ffile.jam"], status=0)
37
38t.cleanup()
39