diff --git a/test-tc.py b/test-tc.py index 11804b0..e40bcfc 100755 --- a/test-tc.py +++ b/test-tc.py @@ -2,7 +2,7 @@ # Copyright (c) 2003-2004 TundraWare Inc. All Rights Reserved. PROGNAME = "tconfpy Test Driver" -RCSID = "$Id: test-tc.py,v 1.116 2004/03/20 10:53:09 tundra Exp $" +RCSID = "$Id: test-tc.py,v 1.117 2004/03/21 13:15:32 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -81,7 +81,6 @@ ########## files = 1 -DEBUG = False syms = {"foo" : 1, "fox" : 1.0, @@ -143,32 +142,43 @@ if len(sys.argv) < 2: print BANNER - print "Usage: test-tc.py [debug] file file ..." + print "Usage: test-tc.py [debug] [litvars] file file ..." sys.exit(1) -if sys.argv[1].lower() == "debug": - files = 2 - DEBUG = True - - # Process all the requested configuration files, # dumping the what tconfpy returns for each one. +DEBUG = False +LITVARS = False + for fn in sys.argv[files:]: - retval = tconfpy.ParseConfig(fn, symtbl, debug=DEBUG) - - if retval[1]: - print "Errors Were Found In '%s'!" % fn - else: - print "No Errors Found In '%s'!" % fn - - print + # Handle inline options - dumpreturn("SYMBOL TABLE", retval[0], isdict=True) - dumpreturn("ERRORS", retval[1]) - dumpreturn("WARNINGS", retval[2]) - dumpreturn("DEBUG", retval[3]) + if fn == "debug": + DEBUG = True + + elif fn == "litvars": + LITVARS = True + + # Everything else presumed to be a configuration file + else: + + retval = tconfpy.ParseConfig(fn, symtbl, debug=DEBUG, LiteralVars=LITVARS) + + if retval[1]: + print "Errors Were Found In '%s'!" % fn + else: + print "No Errors Found In '%s'!" % fn + + print + + dumpreturn("SYMBOL TABLE", retval[0], isdict=True) + dumpreturn("ERRORS", retval[1]) + dumpreturn("WARNINGS", retval[2]) + dumpreturn("DEBUG", retval[3]) + dumpreturn("LITERAL LINES", retval[4]) +