1# Copyright 2014 Google Inc. All rights reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15"""Test Your Project 16 17typ is a simple program for testing command line executables and Python code. 18 19When testing Python code, it is basically a wrapper around the standard 20unittest module, but it provides the following bits of additional 21functionality: 22 23 * Parallel test execution. 24 25 * Clean output in the style of the Ninja build tool. 26 27 * A more flexible mechanism for discovering tests from the 28 command line and controlling how they are run: 29 * Support for importing tests by directory, filename, or module. 30 * Support for specifying tests to skip, tests to run in parallel, 31 and tests that need to be run by themselves 32 33 * Support for producing traces of test times compatible with Chrome's 34 tracing infrastructure (trace_viewer). 35 36 * Integrated test coverage reporting. 37 38 * Integrated support for debugging tests. 39 40 * Support for uploading test results automatically to a server 41 (useful for continuous integration monitoring of test results). 42 43 * An abstraction of operating system functionality called the 44 Host class. This can be used by other python code to write more 45 portable and easily testable code by wrapping the multiprocessing, 46 os, subprocess, and time modules. 47 48 * Simple libraries for integrating Ninja-style statistics and line 49 printing into your own code (the Stats and Printer classes). 50 51 * Support for processing arbitrary arguments from calling code to 52 test cases. 53 54 * Support for once-per-process setup and teardown hooks. 55 (These last two bullet points allow one to write tests that do not 56 require Python globals). 57""" 58 59from typ.arg_parser import ArgumentParser 60from typ.fakes.host_fake import FakeHost 61from typ.host import Host 62from typ.json_results import exit_code_from_full_results 63from typ.json_results import make_full_results, make_upload_request 64from typ.json_results import Result, ResultSet, ResultType 65from typ.runner import Runner, TestInput, TestSet, WinMultiprocessing, main 66from typ.stats import Stats 67from typ.printer import Printer 68from typ.test_case import convert_newlines, TestCase, MainTestCase 69from typ.version import VERSION 70 71 72__all__ = [ 73 'ArgumentParser', 74 'FakeHost', 75 'Host', 76 'MainTestCase', 77 'Printer', 78 'Result', 79 'ResultSet', 80 'ResultType', 81 'Runner', 82 'Stats', 83 'TestCase', 84 'TestInput', 85 'TestSet', 86 'VERSION', 87 'WinMultiprocessing', 88 'convert_newlines', 89 'exit_code_from_full_results', 90 'main', 91 'make_full_results', 92 'make_upload_request', 93] 94