1#!/usr/bin/python 2# Copyright 2013 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. 5 6# This file is expected to be used under another directory to use, 7# so we disable checking import path of GAE tools from this directory. 8# pylint: disable=F0401 9 10import os 11import sys 12import unittest 13 14 15def main(): 16 if len(sys.argv) != 2: 17 sys.stderr.write("""Usage: run_tests.py <path/to/google_appengine>""") 18 return 1 19 20 sys.path.insert(0, sys.argv.pop(1)) 21 import dev_appserver 22 dev_appserver.fix_sys_path() 23 path = os.path.dirname(os.path.abspath(__file__)) 24 suite = unittest.loader.TestLoader().discover( 25 path, 26 pattern='*_unittest.py' 27 ) 28 unittest.TextTestRunner(verbosity=2).run(suite) 29 30 31if __name__ == '__main__': 32 sys.exit(main()) 33