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

Function testSORTCorrectness

v2/test/sort_rule.py:20–46  ·  view source on GitHub ↗

Testing that Boost Jam's SORT builtin rule actually sorts correctly.

()

Source from the content-addressed store, hash-verified

18###############################################################################
19
20def testSORTCorrectness():
21 """Testing that Boost Jam's SORT builtin rule actually sorts correctly."""
22 t = BoostBuild.Tester(["-ftest.jam", "-d1"], pass_toolset=False,
23 use_test_config=False)
24
25 t.write("test.jam", """\
26NOCARE all ;
27source-data = 1 8 9 2 7 3 4 7 1 27 27 9 98 98 1 1 4 5 6 2 3 4 8 1 -2 -2 0 0 0 ;
28target-data = -2 -2 0 0 0 1 1 1 1 1 2 2 27 27 3 3 4 4 4 5 6 7 7 8 8 9 9 98 98 ;
29ECHO "starting up" ;
30sorted-data = [ SORT $(source-data) ] ;
31ECHO "done" ;
32if $(sorted-data) != $(target-data)
33{
34 ECHO "Source :" $(source-data) ;
35 ECHO "Expected :" $(target-data) ;
36 ECHO "SORT returned:" $(sorted-data) ;
37 EXIT "SORT error" : -2 ;
38}
39""")
40
41 t.run_build_system()
42 t.expect_output_lines("starting up")
43 t.expect_output_lines("done")
44 t.expect_output_lines("SORT error", False)
45
46 t.cleanup()
47
48
49###############################################################################

Callers 1

sort_rule.pyFile · 0.85

Calls 4

writeMethod · 0.95
run_build_systemMethod · 0.95
expect_output_linesMethod · 0.95
cleanupMethod · 0.95

Tested by

no test coverage detected