[llvm-commits] [zorg] r151060 - /zorg/trunk/lnt/lnt/tests/compile.py
Daniel Dunbar
daniel at zuster.org
Tue Feb 21 08:43:03 PST 2012
Author: ddunbar
Date: Tue Feb 21 10:43:03 2012
New Revision: 151060
URL: http://llvm.org/viewvc/llvm-project?rev=151060&view=rev
Log:
[lnt] lnt.tests.compile: Add support for testing multiple job sizes for full build tests.
Modified:
zorg/trunk/lnt/lnt/tests/compile.py
Modified: zorg/trunk/lnt/lnt/tests/compile.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/compile.py?rev=151060&r1=151059&r2=151060&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/tests/compile.py (original)
+++ zorg/trunk/lnt/lnt/tests/compile.py Tue Feb 21 10:43:03 2012
@@ -226,7 +226,8 @@
return test_cc_command(name, run_info, variables, input, output, flags,
extra_flags, has_output, ignore_stderr, can_memprof)
-def test_build(name, run_info, variables, project):
+def test_build(base_name, run_info, variables, project, num_jobs):
+ name = '%s(j=%d)' % (base_name, num_jobs)
# Check if we need to expand the archive into the sandbox.
archive_path = get_input_path(opts, project['archive'])
with open(archive_path) as f:
@@ -317,11 +318,14 @@
fatal("unknown build style in project: %r" % project)
# Add arguments to ensure output files go into our build directory.
- output_base = get_output_path(project['name'])
+ output_base = get_output_path(name)
build_base = os.path.join(output_base, 'build')
cmd.append('OBJROOT=%s' % (os.path.join(build_base, 'obj')))
cmd.append('SYMROOT=%s' % (os.path.join(build_base, 'sym')))
cmd.append('DSTROOT=%s' % (os.path.join(build_base, 'dst')))
+
+ # Add additional arguments to force the build scenario we want.
+ cmd.extend(('-jobs', str(num_jobs)))
else:
fatal("unknown build style in project: %r" % project)
@@ -371,22 +375,23 @@
pch_input=pch_input, flags=f, stage=stage,
extra_flags=extra_flags))
-def get_full_build_tests(test_suite_externals):
+def get_full_build_tests(jobs_to_test, test_suite_externals):
# Load the project description file from the externals.
with open(os.path.join(test_suite_externals, "lnt-compile-suite-src",
"project_list.json")) as f:
data = json.load(f)
- for project in data['projects']:
- # Check the style.
- yield ('build/%s' % (project['name'],),
- curry(test_build, project=project))
+ for jobs in jobs_to_test:
+ for project in data['projects']:
+ # Check the style.
+ yield ('build/%s' % (project['name'],),
+ curry(test_build, project=project, num_jobs=jobs))
-def get_tests(test_suite_externals, flags_to_test):
+def get_tests(test_suite_externals, flags_to_test, jobs_to_test):
for item in get_single_file_tests(flags_to_test):
yield item
- for item in get_full_build_tests(test_suite_externals):
+ for item in get_full_build_tests(jobs_to_test, test_suite_externals):
yield item
###
@@ -502,6 +507,9 @@
group.add_option("", "--flags-to-test", dest="flags_to_test",
help="Add a set of flags to test (space separated)",
metavar="FLAGLIST", action="append", default=[])
+ group.add_option("", "--jobs-to-test", dest="jobs_to_test",
+ help="Add a job count to test (full builds)",
+ metavar="NUM", action="append", default=[], type=int)
parser.add_option_group(group)
group = OptionGroup(parser, "Output Options")
@@ -605,8 +613,15 @@
flags_to_test = [string.split(' ')
for string in opts.flags_to_test]
+ # Compute the set of job counts to use in full build tests.
+ if not opts.jobs_to_test:
+ jobs_to_test = [1, 2, 4, 8]
+ else:
+ jobs_to_test = opts.jobs_to_test
+
# Compute the list of all tests.
- all_tests = get_tests(opts.test_suite_externals, flags_to_test)
+ all_tests = get_tests(opts.test_suite_externals, flags_to_test,
+ jobs_to_test)
# Show the tests, if requested.
if opts.show_tests:
More information about the llvm-commits
mailing list