Add cli argument to use different .topo or .params files
- Add cli arguments
- Refactor xmlparser functions
- Cleaned up and fixed some logging
- main.testDir is now set to the directory where the test file is
located
- main.testsRoot is now set to the full path of TestON/tests/
- Fixed usages accordingly
Change-Id: I2a0f0c3728b5732b242a2e860e6538a6f3b65166
diff --git a/TestON/bin/cli.py b/TestON/bin/cli.py
index 8e48311..263d4b4 100755
--- a/TestON/bin/cli.py
+++ b/TestON/bin/cli.py
@@ -263,10 +263,16 @@
while index < len( args ):
option = args[ index ]
if index > 0:
- if re.match( "--params", option, flags=0 ):
+ if re.match( "--params-file", option, flags=0 ):
+ # The more specific match must be before --params
+ options[ 'paramsFile' ] = args[ index + 1 ]
+ elif re.match( "--topo-file", option, flags=0 ):
+ options[ 'topoFile' ] = args[ index + 1 ]
+ elif re.match( "--params", option, flags=0 ):
# check if there is a params
options[ 'params' ].append( args[ index + 1 ] )
- elif re.match( "logdir|mail|example|testdir|testcases|onoscell", option, flags = 0 ):
+ elif re.match( "logdir|mail|example|testdir|testcases|onoscell",
+ option, flags=0 ):
options[ option ] = args[ index + 1 ]
options = self.testcasesInRange( index + 1, option, args, options )
index += 2
@@ -292,6 +298,8 @@
options[ 'onoscell' ] = None
# init params as a empty list
options[ 'params' ] = []
+ options[ 'paramsFile' ] = None
+ options[ 'topoFile' ] = None
return options
def testcasesInRange( self, index, option, args, options ):