view tests/silenttestrunner.py @ 28528:a011080fdb7b

fsmonitor: use custom stdint.h file when compiling with Visual C Visual C/C++ 9, which Python 2.7 is compatible with, doesn't have C99 support and thus doesn't contain a stdint.h file. This changeset adds a custom version of stdint.h, created specifically for Visual C, and uses it when building with that compiler.
author Sune Foldager <sune.foldager@me.com>
date Mon, 14 Mar 2016 17:53:47 +0100
parents dadcd40b62d8
children fc2268b9a07c
line wrap: on
line source

import unittest, sys, os

def main(modulename):
    '''run the tests found in module, printing nothing when all tests pass'''
    module = sys.modules[modulename]
    suite = unittest.defaultTestLoader.loadTestsFromModule(module)
    results = unittest.TestResult()
    suite.run(results)
    if results.errors or results.failures:
        for tc, exc in results.errors:
            print 'ERROR:', tc
            print
            sys.stdout.write(exc)
        for tc, exc in results.failures:
            print 'FAIL:', tc
            print
            sys.stdout.write(exc)
        sys.exit(1)

if os.environ.get('SILENT_BE_NOISY'):
    main = unittest.main