mirror of
https://github.com/Relintai/scons_gd.git
synced 2025-02-18 17:14:38 +01:00
28 lines
1019 B
Python
28 lines
1019 B
Python
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
|
|
elif hash_format != 'testfailure':
|
|
raise Exception('Hash format %s is not supported in '
|
|
'test/option/hash-format/SConstruct' % hash_format)
|
|
atexit.register(VerifyCsig)
|