Skip to content

Commit

Permalink
Remove test_deterministic_build
Browse files Browse the repository at this point in the history
It's a huge pain to maintain,
and it doesn't seem to work well in Github Actions
  • Loading branch information
LivInTheLookingGlass committed Jul 19, 2024
1 parent 4f3764e commit f848f79
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
22 changes: 0 additions & 22 deletions c/test_euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,28 +219,6 @@ def test_compiler_macros(compiler):
assert flags[9] == (EXE_EXT not in ("x86", "x86_64", "exe"))


@mark.skipif('NO_OPTIONAL_TESTS')
def test_deterministic_build(c_file, compiler):
exename1 = EXE_TEMPLATE.format("dbuild{}".format(uuid4()), compiler)
exename2 = EXE_TEMPLATE.format("dbuild{}".format(uuid4()), compiler)
environ['SOURCE_DATE_EPOCH'] = '1'
environ['ZERO_AR_DATE'] = 'true'
check_call(templates[compiler].format(c_file, exename1).split())
sleep(2)
check_call(templates[compiler].format(c_file, exename2).split())
try:
with open(exename1, "rb") as f, open(exename2, "rb") as g:
assert f.read() == g.read()
except AssertionError:
if IN_WINDOWS and compiler != 'CL': # mingw gcc doesn't seem to make reproducible builds
xfail()
elif compiler == 'PCC':
xfail() # PCC doesn't allow reproducible builds with static keyword
elif compiler == 'GCC' and environ.get('COV') == 'true':
xfail() # GCC doesn't do reproducible builds w/ code coverage
raise


@mark.skipif('NO_OPTIONAL_TESTS or ONLY_SLOW')
def test_is_prime(benchmark, compiler):
from p0007 import is_prime, prime_factors, primes
Expand Down
20 changes: 0 additions & 20 deletions cplusplus/test_euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,26 +192,6 @@ def test_compiler_macros(compiler):
assert flags[7] == (EXE_EXT not in ("x86", "x86_64", "exe"))


@mark.skipif('NO_OPTIONAL_TESTS')
def test_deterministic_build(c_file, compiler):
exename1 = EXE_TEMPLATE.format("dbuild{}".format(uuid4()), compiler)
exename2 = EXE_TEMPLATE.format("dbuild{}".format(uuid4()), compiler)
environ['SOURCE_DATE_EPOCH'] = '1'
environ['ZERO_AR_DATE'] = 'true'
check_call(templates[compiler].format(c_file, exename1).split())
sleep(2)
check_call(templates[compiler].format(c_file, exename2).split())
try:
with open(exename1, "rb") as f, open(exename2, "rb") as g:
assert f.read() == g.read()
except AssertionError:
if IN_WINDOWS and compiler != 'CL': # mingw gcc doesn't seem to make reproducible builds
xfail()
elif compiler == 'GCC' and environ.get('COV') == 'true':
xfail() # GCC doesn't do reproducible builds w/ code coverage
raise


# @mark.skipif('NO_OPTIONAL_TESTS or ONLY_SLOW')
# def test_is_prime(benchmark, compiler):
# from p0007 import is_prime, prime_factors, primes
Expand Down

0 comments on commit f848f79

Please sign in to comment.