diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-22 08:41:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-22 08:41:12 +0400 |
commit | 7aa14fdbb978393c536503521e8c18708907f9b3 (patch) | |
tree | 05e65ac2ce50a6c7c188887626e7d546a8834e0e /build_files/cmake/cmake_static_check_sparse.py | |
parent | 86d528afa7c54d74162f2ef873da5c62b5c77b52 (diff) |
use the systems number of processes for running static checks - multiple jobs.
Diffstat (limited to 'build_files/cmake/cmake_static_check_sparse.py')
-rw-r--r-- | build_files/cmake/cmake_static_check_sparse.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/build_files/cmake/cmake_static_check_sparse.py b/build_files/cmake/cmake_static_check_sparse.py index 9af53ed8008..aa2d56e5509 100644 --- a/build_files/cmake/cmake_static_check_sparse.py +++ b/build_files/cmake/cmake_static_check_sparse.py @@ -52,15 +52,21 @@ def main(): check_commands.append((c, cmd)) - for i, (c, cmd) in enumerate(check_commands): + def my_process(i, c, cmd): percent = 100.0 * (i / (len(check_commands) - 1)) percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:" - sys.stdout.write("%s %s\n" % (percent_str, c)) sys.stdout.flush() + sys.stdout.write("%s %s\n" % (percent_str, c)) + + return subprocess.Popen(cmd) + + process_functions = [] + for i, (c, cmd) in enumerate(check_commands): + process_functions.append((my_process, (i, c, cmd))) + + project_source_info.queue_processes(process_functions) - process = subprocess.Popen(cmd) - process.wait() if __name__ == "__main__": main() |