test_psa_constant_names: make tmp files easier to recognize

This commit is contained in:
Gilles Peskine 2019-01-04 19:46:59 +01:00 committed by Darryl Green
parent 17542086ab
commit 95ab71a19a

View file

@ -206,13 +206,16 @@ def run_c(options, type, names):
c_name = None
exe_name = None
try:
c_fd, c_name = tempfile.mkstemp(suffix='.c',
c_fd, c_name = tempfile.mkstemp(prefix='tmp-{}-'.format(type),
suffix='.c',
dir='programs/psa')
exe_suffix = '.exe' if platform.system() == 'Windows' else ''
exe_name = c_name[:-2] + exe_suffix
remove_file_if_exists(exe_name)
c_file = os.fdopen(c_fd, 'w', encoding='ascii')
c_file.write('''/* Generated by test_psa_constant_names.py */
c_file.write('/* Generated by test_psa_constant_names.py for {} values */'
.format(type))
c_file.write('''
#include <stdio.h>
#include <psa/crypto.h>
int main(void)