Пример #1
0
dependency chains like this.  That was fixed by adding reference counts
to the Taskmaster so it could be smarter about not re-evaluating Nodes.
"""

import TestSCons

# Full-build time of just under 10 seconds on ubuntu-timings slave,
# as determined by bin/calibrate.py on 9 December 2009:
#
# run   1:   3.211:  TARGET_COUNT=50
# run   2:  11.920:  TARGET_COUNT=155
# run   3:   9.182:  TARGET_COUNT=130
# run   4:  10.185:  TARGET_COUNT=141
# run   5:   9.945:  TARGET_COUNT=138
# run   6:  10.035:  TARGET_COUNT=138
# run   7:   9.898:  TARGET_COUNT=137
# run   8:   9.840:  TARGET_COUNT=137
# run   9:  10.054:  TARGET_COUNT=137
# run  10:   9.747:  TARGET_COUNT=136
# run  11:   9.778:  TARGET_COUNT=136
# run  12:   9.743:  TARGET_COUNT=136
#
# The fact that this varies so much suggests that it's pretty
# non-deterministic, which makes sense for a test involving -j.

test = TestSCons.TimeSCons(variables={'TARGET_COUNT':136})

test.main()

test.pass_test()
Пример #2
0
# contains sixty source files (each of which includes a .h file)
# that are built into three libraries containing twenty object files
# each, which are then linked into executables.
#
# As of r5143 on 17 August 2010, a value of 60 FILES_PER_DIRECTORY
# performs a full build in 82.5 seconds on the ubuntu-timings slave.
# That's more than our "normal" target of 10 seconds or so for the
# full build, but building anything less than three libraries per
# directory feels like it makes the test too trivial.

import os

test = TestSCons.TimeSCons(variables={
    'NUMBER_OF_LEVELS': 2,
    'DIRECTORIES_PER_LEVEL': 3,
    'FILES_PER_DIRECTORY': 60,
    'LOOKUPS_PER_SOURCE': 2,
    'COMPILES_GROUPED': 20,
},
                           calibrate=['FILES_PER_DIRECTORY'])

arguments = [
    '-l %s' % test.variables['NUMBER_OF_LEVELS'],
    '-d %s' % test.variables['DIRECTORIES_PER_LEVEL'],
    '-f %s' % test.variables['FILES_PER_DIRECTORY'],
    '-g %s' % test.variables['COMPILES_GROUPED'],
    '-u %s' % test.variables['LOOKUPS_PER_SOURCE'],
]

test.run(program=test.workpath('genscons.pl'), arguments=' '.join(arguments))
# This print is nott for debugging, leave it alone!
# We want to display the output from genscons.pl's generation the build
Пример #3
0
We create $JAVA_COUNT on-disk Java files in a 'src' subdirectory,
and the SConstruct file builds them.  That's it.
"""

import TestSCons

# Full-build time of just under 10 seconds on ubuntu-timings slave,
# as determined by bin/calibrate.py on 21 May 2010:
#
# run   1:  14.564:  JAVA_COUNT=100
# run   2:   9.692:  JAVA_COUNT=68
# run   3:   9.654:  JAVA_COUNT=68
# run   4:   9.635:  JAVA_COUNT=68

test = TestSCons.TimeSCons(variables={'JAVA_COUNT': 68})

test.subdir('src')

contents = """\
package src;
public class j%04d {}
"""

for d in range(test.variables['JAVA_COUNT']):
    test.write(['src', 'j%04d.java' % d], contents % d)

test.main()

test.pass_test()
We create $DIR_COUNT on-disk directories.  A single checked-in .h file
exists in the 'include' directory.  The SConstruct sets CPPPATH to a
list of Dir Nodes for the created directories, followed by 'include'.
A checked-in .c file #includes the .h file to be found in the last
directory in the list.
"""

import TestSCons

# Full-build time of just under 10 seconds on ubuntu-timings slave,
# as determined by bin/calibrate.py on 9 December 2009:
#
# run   1:   2.235:  DIR_COUNT=50
# run   2:   3.976:  DIR_COUNT=223
# run   3:   7.353:  DIR_COUNT=560
# run   4:   9.569:  DIR_COUNT=761
# run   5:   9.353:  DIR_COUNT=761
# run   6:   9.972:  DIR_COUNT=813
# run   7:   9.930:  DIR_COUNT=813
# run   8:   9.983:  DIR_COUNT=813

test = TestSCons.TimeSCons(variables={'DIR_COUNT':813})

for d in range(test.variables['DIR_COUNT']):
    test.subdir('inc_%04d' % d)

test.main()

test.pass_test()