|
Project Euler Solutions
|
Functions | |
| def | cleanup () |
| def | v_compiler (request) |
| def | compiler (request) |
| def | key (request) |
| def | c_file (request) |
| def | test_compiler_macros (compiler) |
| def | test_deterministic_build (c_file, compiler) |
| def | test_bcd_int (benchmark, compiler) |
| def | test_is_prime (benchmark, compiler) |
| def | test_problem (benchmark, key, compiler) |
| def | test_valgrind (c_file, v_compiler) |
| def | test_pahole (c_file, v_compiler) |
Variables | |
| C_FOLDER = Path(__file__).parent | |
| BUILD_FOLDER = C_FOLDER.joinpath('build', 'test-run-{}'.format(uuid4())) | |
| dictionary | answers |
| string | IN_WINDOWS = 'Windows' |
| string | IN_OSX = 'Darwin' |
| IN_TERMUX = bool(which('termux-setup-storage')) | |
| tuple | IN_LINUX = (not IN_TERMUX)and(system() == 'Linux') |
| _raw_NO_SLOW = environ.get('NO_SLOW') | |
| _parsed_NO_SLOW = _raw_NO_SLOW | |
| _raw_ONLY_SLOW = environ.get('ONLY_SLOW') | |
| _parsed_ONLY_SLOW = _raw_ONLY_SLOW | |
| _raw_NO_OPTIONAL_TESTS = environ.get('NO_OPTIONAL_TESTS') | |
| _parsed_NO_OPTIONAL_TESTS = _raw_NO_OPTIONAL_TESTS | |
| tuple | NO_SLOW = ((IN_TERMUX and _parsed_NO_SLOW is None) or _parsed_NO_SLOW)andnot_parsed_ONLY_SLOW |
| ONLY_SLOW = _parsed_ONLY_SLOWandnot_parsed_NO_SLOW | |
| tuple | NO_OPTIONAL_TESTS = (_parsed_NO_OPTIONAL_TESTS is None and ONLY_SLOW)or_parsed_NO_OPTIONAL_TESTS |
| EXE_EXT = processor() | |
| GCC_BINARY = environ.get('GCC_OVERRIDE', 'gcc') | |
| AOCC_BINARY = environ.get('AOCC_OVERRIDE', 'clang') | |
| list | valgrind_compilers = [x for x in compilers if x != 'CL'] |
| COMPILER_LEN = len(max(compilers, key=len)) | |
| V_COMPILER_LEN = len(max(valgrind_compilers or [''], key=len)) | |
| parents | |
| True | |
| exist_ok | |
| bool | CL_NO_64 = False |
| OBJ_FOLDER = BUILD_FOLDER.joinpath('objects') | |
| _test_file = BUILD_FOLDER.parent.joinpath('{}.c'.format(uuid4())) | |
| _test_exe = str(BUILD_FOLDER.joinpath('test_cl_64_support-{}.out'.format(uuid4()))) | |
| bool | GCC_NO_64 = False |
| string | CLANG_LINK_MATH = '' |
| string | CLANG_ARCH = '-march=native' |
| string | SOURCE_TEMPLATE = "{}{}p{{:0>4}}.c" |
| string | EXE_TEMPLATE = "{}{}p{{:0>4}}.{{}}.{}" |
| tuple | GCC_TEMPLATE |
| tuple | CLANG_TEMPLATE = ("{} {{}} -O3 {} {} -Wall -Werror -Wno-initializer-overrides -std=gnu11 {} -o {{}}") |
| dictionary | templates |
| dictionary | debug_templates |
| valgrind_test_exe_name = EXE_TEMPLATE.format('valgrind-check-{}'.format(uuid4()), valgrind_compilers[0]) | |
| VALGRIND_ERR_LIST = notrun(['valgrind', '-s', valgrind_test_exe_name], cwd=BUILD_FOLDER).returncode | |
| def c.test_euler.c_file | ( | request | ) |
| def c.test_euler.cleanup | ( | ) |
| def c.test_euler.compiler | ( | request | ) |
| def c.test_euler.key | ( | request | ) |
| def c.test_euler.test_bcd_int | ( | benchmark, | |
| compiler | |||
| ) |
| def c.test_euler.test_compiler_macros | ( | compiler | ) |
| def c.test_euler.test_deterministic_build | ( | c_file, | |
| compiler | |||
| ) |
| def c.test_euler.test_is_prime | ( | benchmark, | |
| compiler | |||
| ) |
| def c.test_euler.test_pahole | ( | c_file, | |
| v_compiler | |||
| ) |
| def c.test_euler.test_problem | ( | benchmark, | |
| key, | |||
| compiler | |||
| ) |
| def c.test_euler.test_valgrind | ( | c_file, | |
| v_compiler | |||
| ) |
| def c.test_euler.v_compiler | ( | request | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| c.test_euler.AOCC_BINARY = environ.get('AOCC_OVERRIDE', 'clang') |
| c.test_euler.BUILD_FOLDER = C_FOLDER.joinpath('build', 'test-run-{}'.format(uuid4())) |
| c.test_euler.C_FOLDER = Path(__file__).parent |
| c.test_euler.CL_NO_64 = False |
| string c.test_euler.CLANG_ARCH = '-march=native' |
| string c.test_euler.CLANG_LINK_MATH = '' |
| tuple c.test_euler.CLANG_TEMPLATE = ("{} {{}} -O3 {} {} -Wall -Werror -Wno-initializer-overrides -std=gnu11 {} -o {{}}") |
| dictionary c.test_euler.debug_templates |
| string c.test_euler.EXE_EXT = processor() |
| string c.test_euler.EXE_TEMPLATE = "{}{}p{{:0>4}}.{{}}.{}" |
| c.test_euler.exist_ok |
| c.test_euler.GCC_BINARY = environ.get('GCC_OVERRIDE', 'gcc') |
| c.test_euler.GCC_NO_64 = False |
| tuple c.test_euler.GCC_TEMPLATE |
| tuple c.test_euler.IN_LINUX = (not IN_TERMUX)and(system() == 'Linux') |
| string c.test_euler.IN_OSX = 'Darwin' |
| c.test_euler.IN_TERMUX = bool(which('termux-setup-storage')) |
| string c.test_euler.IN_WINDOWS = 'Windows' |
| tuple c.test_euler.NO_OPTIONAL_TESTS = (_parsed_NO_OPTIONAL_TESTS is None and ONLY_SLOW)or_parsed_NO_OPTIONAL_TESTS |
| tuple c.test_euler.NO_SLOW = ((IN_TERMUX and _parsed_NO_SLOW is None) or _parsed_NO_SLOW)andnot_parsed_ONLY_SLOW |
| c.test_euler.OBJ_FOLDER = BUILD_FOLDER.joinpath('objects') |
| c.test_euler.ONLY_SLOW = _parsed_ONLY_SLOWandnot_parsed_NO_SLOW |
| c.test_euler.parents |
| string c.test_euler.SOURCE_TEMPLATE = "{}{}p{{:0>4}}.c" |
| dictionary c.test_euler.templates |
| c.test_euler.True |
| c.test_euler.V_COMPILER_LEN = len(max(valgrind_compilers or [''], key=len)) |
| list c.test_euler.valgrind_compilers = [x for x in compilers if x != 'CL'] |
| c.test_euler.VALGRIND_ERR_LIST = notrun(['valgrind', '-s', valgrind_test_exe_name], cwd=BUILD_FOLDER).returncode |
| c.test_euler.valgrind_test_exe_name = EXE_TEMPLATE.format('valgrind-check-{}'.format(uuid4()), valgrind_compilers[0]) |
1.8.11