Example #1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import sys

import numba.testing as testing

if __name__ == "__main__":
    result = testing.test()
    sys.exit(0 if result else 1)
Example #2
0
    raise ImportError("Please install the coverage module "
                      "(https://pypi.python.org/pypi/coverage/)")


if __name__ == "__main__":
    # We must start coverage before importing the package under test,
    # otherwise some lines will be missed.
    config_file = os.path.join(
        os.path.dirname(os.path.dirname(__file__)),
        'coverage.conf')
    os.environ['COVERAGE_PROCESS_START'] = config_file
    cov = coverage.coverage(config_file=config_file)
    cov.start()

    from numba import testing

    html_dir = 'htmlcov'
    try:
        # NOTE: we force single-process mode, since some hacks are needed
        # for multiprocess'ed coverage to work.
        testing.test()
    except SystemExit:
        pass
    finally:
        cov.stop()
        cov.save()
        cov.combine()
    if os.path.exists(html_dir):
        shutil.rmtree(html_dir)
    cov.html_report(directory=html_dir)