2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 """ Test runner for IDL Generator changes """
11 def TestIDL(testname, args):
12 print '\nRunning unit tests for %s.' % testname
14 args = [sys.executable, testname] + args
15 subprocess.check_call(args)
17 except subprocess.CalledProcessError as err:
18 print 'Failed with %s.' % str(err)
23 errors += TestIDL('idl_lexer.py', ['--test'])
25 errors += TestIDL('idl_parser.py', ['--test'])
27 errors += TestIDL('idl_c_header.py', [])
29 errors += TestIDL('idl_c_proto.py', ['--wnone', '--test'])
31 errors += TestIDL('idl_gen_pnacl.py', ['--wnone', '--test'])
33 errors += TestIDL('idl_namespace.py', [])
35 errors += TestIDL('idl_node.py', [])
39 print '\nFailed tests.'
43 if __name__ == '__main__':
44 sys.exit(main(sys.argv[1:]))