[ci skip] update generated files
[scons.git] / test / ninja / ninja_test_sconscripts / sconstruct_ninja_determinism
blob6d206364ca7246ac40b7e6472a8bc288782a0895
1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
5 import random
7 SetOption('experimental', 'ninja')
8 DefaultEnvironment(tools=[])
9 env = Environment(tools=[])
10 env.Tool('ninja')
11 SetOption('skip_ninja_regen', True)  # must wait until tool creates the option
13 # make the dependency list vary in order. Ninja tool should sort them to be deterministic.
14 for i in range(1, 10):
15     node = env.Command(f'out{i}.txt', 'foo.c', 'echo test > $TARGET')
16     deps = list(range(1, i))
17     random.shuffle(deps)
18     for j in deps:
19         if j == i:
20             continue
21         env.Depends(node, f'out{j}.txt')