Commit a3924ab2 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Handle escaped '-' at start of test arguments.

parent 469abde1
...@@ -174,7 +174,6 @@ class Test: ...@@ -174,7 +174,6 @@ class Test:
for name,signature in self.signatures: for name,signature in self.signatures:
encoder.add_decl(signature) encoder.add_decl(signature)
pass pass
print self.signatures
for name,signature in self.signatures: for name,signature in self.signatures:
print "Checking", name, print "Checking", name,
sys.stdout.flush() sys.stdout.flush()
...@@ -191,7 +190,9 @@ class Test: ...@@ -191,7 +190,9 @@ class Test:
print print
pass pass
p.stdin.close() p.stdin.close()
print p.wait() if p.wait() != 0:
exit(1)
pass
pass pass
def decode(self, f): def decode(self, f):
...@@ -217,7 +218,6 @@ class Test: ...@@ -217,7 +218,6 @@ class Test:
pass pass
except EOFError: except EOFError:
pass pass
print 'Done'
pass pass
pass pass
...@@ -231,8 +231,13 @@ if __name__ == "__main__": ...@@ -231,8 +231,13 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Run encoding test.') parser = argparse.ArgumentParser(description='Run encoding test.')
class test_action(argparse.Action): class test_action(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None): def __call__(self, parser, namespace, values, option_string=None):
old = getattr(namespace, self.dest) old = list(getattr(namespace, self.dest))
old.append(values) def strip_slash(s):
if s.startswith('\\'):
return s[1:]
return s
old.append(map(strip_slash, values))
setattr(namespace, self.dest, old)
parser.add_argument('--signatures') parser.add_argument('--signatures')
parser.add_argument('--test', nargs='*', action=test_action, default=[]) parser.add_argument('--test', nargs='*', action=test_action, default=[])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment