~unity-api-team/unity-scopes-api/child-scopes-option

« back to all changes in this revision

Viewing changes to test/headers/compile_headers.py

  • Committer: Marcus Tomlinson
  • Date: 2014-10-08 10:58:57 UTC
  • mfrom: (497.1.3 devel)
  • mto: (497.1.5 devel)
  • mto: This revision was merged to the branch mainline in revision 505.
  • Revision ID: marcus.tomlinson@canonical.com-20141008105857-gf4ilb9ywfeaeroi
Merged devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
import subprocess
54
54
import sys
55
55
import tempfile
56
 
 
 
56
import concurrent.futures, multiprocessing
57
57
#
58
58
# Write the supplied message to stderr, preceded by the program name.
59
59
#
110
110
#
111
111
def test_files(hdrs, compiler, copts, verbose):
112
112
    num_errs = 0
113
 
    for h in hdrs:
 
113
    executor = concurrent.futures.ThreadPoolExecutor(max_workers=multiprocessing.cpu_count())
 
114
    futures = [executor.submit(run_compiler, h, compiler, copts, verbose) for h in hdrs]
 
115
    for f in futures:
114
116
        try:
115
 
            if not run_compiler(h, compiler, copts, verbose):
 
117
            if not f.result():
116
118
                num_errs += 1
117
119
        except OSError:
118
120
            num_errs += 1