MCPcopy Create free account
hub / github.com/boostorg/build / testSORTDuration

Function testSORTDuration

v2/test/sort_rule.py:56–85  ·  view source on GitHub ↗

Regression test making sure Boost Jam's SORT builtin rule does not get quadratic behaviour again in this use case.

()

Source from the content-addressed store, hash-verified

54###############################################################################
55
56def testSORTDuration():
57 """
58 Regression test making sure Boost Jam's SORT builtin rule does not get
59 quadratic behaviour again in this use case.
60
61 """
62 t = BoostBuild.Tester(["-ftest.jam", "-d1"], pass_toolset=False,
63 use_test_config=False)
64
65 f = open(t.workpath("test.jam"), "w")
66 print >> f, "data = "
67 for i in range(0, 20000):
68 if i % 2:
69 print >> f, '"aaa"'
70 else:
71 print >> f, '"bbb"'
72 print >> f, """;
73
74ECHO "starting up" ;
75sorted = [ SORT $(data) ] ;
76ECHO "done" ;
77NOCARE all ;
78"""
79 f.close()
80
81 t.run_build_system(expected_duration=1)
82 t.expect_output_lines("starting up")
83 t.expect_output_lines("done")
84
85 t.cleanup()
86
87
88###############################################################################

Callers 1

sort_rule.pyFile · 0.85

Calls 4

run_build_systemMethod · 0.95
expect_output_linesMethod · 0.95
cleanupMethod · 0.95
workpathMethod · 0.80

Tested by

no test coverage detected