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."""
29 DIR_PATH
= os
.path
.dirname(__file__
)
31 TEST_LIBRARY_PATHS
= [
33 os
.path
.join(DIR_PATH
, 'lib', 'cherrypy'),
34 os
.path
.join(DIR_PATH
, 'lib', 'fancy_urllib'),
35 os
.path
.join(DIR_PATH
, 'lib', 'yaml-3.10'),
36 os
.path
.join(DIR_PATH
, 'lib', 'antlr3'),
37 os
.path
.join(DIR_PATH
, 'lib', 'concurrent'),
38 os
.path
.join(DIR_PATH
, 'lib', 'ipaddr'),
39 os
.path
.join(DIR_PATH
, 'lib', 'jinja2-2.6'),
40 os
.path
.join(DIR_PATH
, 'lib', 'webob-1.2.3'),
41 os
.path
.join(DIR_PATH
, 'lib', 'webapp2-2.5.1'),
42 os
.path
.join(DIR_PATH
, 'lib', 'mox'),
43 os
.path
.join(DIR_PATH
, 'lib', 'protorpc-1.0'),
48 sys
.path
.extend(TEST_LIBRARY_PATHS
)
50 parser
= argparse
.ArgumentParser(
51 description
='Run the devappserver2 test suite.')
54 help='The fully qualified names of the tests to run (e.g. '
55 'google.appengine.tools.devappserver2.api_server_test). If not given '
56 'then the full test suite will be run.')
58 args
= parser
.parse_args()
60 loader
= unittest
.TestLoader()
62 tests
= loader
.loadTestsFromNames(args
.tests
)
64 tests
= loader
.discover(
65 os
.path
.join(DIR_PATH
, 'google/appengine/tools/devappserver2'),
68 runner
= unittest
.TextTestRunner(verbosity
=2)
71 if __name__
== '__main__':