blob: 07713ac1a269d6105a9365c92d0a925a5fef078e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import atexit
import sys
hash_format = GetOption('hash_format')
if not hash_format:
# Override to SHA-256 to validate that override is effective
hash_format = 'sha256'
SetOption('hash_format', hash_format)
DefaultEnvironment(tools=[])
B = Builder(action = r'$PYTHON build.py $TARGETS $SOURCES')
env = Environment(tools=[], BUILDERS = { 'B' : B })
env['PYTHON'] = sys.executable
f1 = env.B(target = 'f1.out', source = 'f1.in')
def VerifyCsig():
csig = f1[0].get_csig()
if hash_format == 'md5':
assert csig == 'fe06ae4170d4fead2c958439c738859e', csig
elif hash_format == 'sha1':
assert csig == 'efe5c6daa743540e9561934e3e18628b336013f7', csig
elif hash_format == 'sha256':
assert csig == 'a28bb79aa5ca8a5eb2dc5910a103d1a6312e79d73ed8054787cee78cc532a6aa', csig
else:
raise Exception('Hash format %s is not supported in '
'test/option/hash-format/SConstruct' % hash_format)
atexit.register(VerifyCsig)
|