Source

hachoir / coverage_test.py

Full commit
haypo 8103a58 







haypo 3c6669e 



haypo 30b5353 




haypo 8103a58 







haypo 3c6669e 

haypo 8103a58 
haypo e467a55 


haypo 8103a58 

"""
Run the maximum of tests to have good coverage test.
"""

import os
import imp

def main():
    import doctest, pdb
    if doctest._OutputRedirectingPdb.set_trace == pdb.Pdb.set_trace:
        raise ImportError("Your doctest version is too old")

    directory = os.getenv("TESTCASE")
    if not directory:
        home = os.getenv("HOME")
        assert home
        directory = os.path.join(home, "testcase")

    parser = imp.load_source("parser", "hachoir-parser/tests/run_testcase.py")
    parser.testRandom()
    parser.testFiles(directory)

    metadata = imp.load_source("metadata", "hachoir-metadata/run_testcase.py")
    metadata.testFiles(directory)

    core_doc = imp.load_source("parser", "hachoir-core/test_doc.py")
    core_doc.main()

    metadata_doc = imp.load_source("parser", "hachoir-metadata/test_doc.py")
    metadata_doc.main()

if __name__ == "__main__":
    main()