3 # Copyright 2007 Google Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 """Runs the unit test suite for devappserver2."""
28 DIR_PATH
= os
.path
.dirname(__file__
)
30 TEST_LIBRARY_PATHS
= [
32 os
.path
.join(DIR_PATH
, 'lib', 'cherrypy'),
33 os
.path
.join(DIR_PATH
, 'lib', 'fancy_urllib'),
34 os
.path
.join(DIR_PATH
, 'lib', 'yaml-3.10'),
35 os
.path
.join(DIR_PATH
, 'lib', 'antlr3'),
36 os
.path
.join(DIR_PATH
, 'lib', 'concurrent'),
37 os
.path
.join(DIR_PATH
, 'lib', 'ipaddr'),
38 os
.path
.join(DIR_PATH
, 'lib', 'jinja2-2.6'),
39 os
.path
.join(DIR_PATH
, 'lib', 'webob-1.2.3'),
40 os
.path
.join(DIR_PATH
, 'lib', 'webapp2-2.5.1'),
41 os
.path
.join(DIR_PATH
, 'lib', 'mox'),
42 os
.path
.join(DIR_PATH
, 'lib', 'protorpc-1.0'),
47 sys
.path
.extend(TEST_LIBRARY_PATHS
)
49 parser
= argparse
.ArgumentParser(
50 description
='Run the devappserver2 test suite.')
53 help='The fully qualified names of the tests to run (e.g. '
54 'google.appengine.tools.devappserver2.api_server_test). If not given '
55 'then the full test suite will be run.')
57 args
= parser
.parse_args()
59 loader
= unittest
.TestLoader()
61 tests
= loader
.loadTestsFromNames(args
.tests
)
63 tests
= loader
.discover(
64 os
.path
.join(DIR_PATH
, 'google/appengine/tools/devappserver2'),
67 runner
= unittest
.TextTestRunner(verbosity
=2)
70 if __name__
== '__main__':