()
| 81 | # Test the above functions. |
| 82 | |
| 83 | def test(): |
| 84 | import sys |
| 85 | import os |
| 86 | if not sys.argv[1:]: |
| 87 | print('usage: python parsesetup.py Makefile*|Setup* ...') |
| 88 | sys.exit(2) |
| 89 | for arg in sys.argv[1:]: |
| 90 | base = os.path.basename(arg) |
| 91 | if base[:8] == 'Makefile': |
| 92 | print('Make style parsing:', arg) |
| 93 | v = getmakevars(arg) |
| 94 | prdict(v) |
| 95 | elif base[:5] == 'Setup': |
| 96 | print('Setup style parsing:', arg) |
| 97 | m, v = getsetupinfo(arg) |
| 98 | prdict(m) |
| 99 | prdict(v) |
| 100 | else: |
| 101 | print(arg, 'is neither a Makefile nor a Setup file') |
| 102 | print('(name must begin with "Makefile" or "Setup")') |
| 103 | |
| 104 | def prdict(d): |
| 105 | keys = sorted(d.keys()) |
no test coverage detected
searching dependent graphs…