From 179c646f9da082b64dd423e346f112e30f53fc6d Mon Sep 17 00:00:00 2001 From: Michael Behrisch Date: Tue, 4 Mar 2014 20:48:40 +0000 Subject: [PATCH] extracted examples are xml validated, refs #2 git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@15809 afbd958f-9f77-42d5-a016-97a22340ccf4 --- sumo/Makefile.am | 2 +- sumo/tests/extractTest.py | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sumo/Makefile.am b/sumo/Makefile.am index eb7d6b05644e..233404f06af2 100644 --- a/sumo/Makefile.am +++ b/sumo/Makefile.am @@ -84,7 +84,7 @@ dist-complete: dist dist-doc dist-tests $(am__remove_distdir) examples: - tests/extractTest.py -f tests/examples.txt + tests/extractTest.py -x -f tests/examples.txt sumo$(EXEEXT) netconvert$(EXEEXT) \ netgenerate$(EXEEXT) duarouter$(EXEEXT) \ diff --git a/sumo/tests/extractTest.py b/sumo/tests/extractTest.py index 0634a9ecce84..e458d2df50ef 100755 --- a/sumo/tests/extractTest.py +++ b/sumo/tests/extractTest.py @@ -42,6 +42,9 @@ def get_options(args=None): optParser.add_option("-s", "--skip-configuration", dest="skip_configuration", default=False, action="store_true", help="skips creation of an application config from the options.app file") + optParser.add_option("-x", "--skip-validation", + dest="skip_validation", default=False, action="store_true", + help="remove all options related to XML validation") options, args = optParser.parse_args(args=args) if not options.file and len(args) == 0: optParser.print_help() @@ -121,14 +124,21 @@ def main(options): if not os.path.exists(testPath): os.makedirs(testPath) net = None + skip = False appOptions = [] for f in optionsFiles: - appOptions += open(f).read().split() - for o in appOptions: - if "=" in o: - o = o.split("=")[-1] - if o[-8:] == ".net.xml": - net = o + for o in open(f).read().split(): + if skip: + skip = False + continue + if o == "--xml-validation" and options.skip_validation: + skip = True + continue + appOptions.append(o) + if "=" in o: + o = o.split("=")[-1] + if o[-8:] == ".net.xml": + net = o nameBase = "test" if options.names: nameBase = os.path.basename(target)