Skip to content

Commit

Permalink
run tests in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Mar 13, 2020
1 parent 060c82f commit c3b4091
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ def check(proc, remove_cargo):
print('')
print('>>> Test: ' + testname)
print(' > Step 1: interpreted')
check(Popen(['cargo', 'run', '-q', '--', '-Rbi', testcode],
check(Popen(['cargo', 'run', '--release', '-q', '--', '-Rbi', testcode],
stdin=PIPE, stdout=PIPE, stderr=STDOUT), True)

print(' > Step 2: interpreted + optimized')
check(Popen(['cargo', 'run', '-q', '--', '-Rbio', testcode],
check(Popen(['cargo', 'run', '--release', '-q', '--', '-Rbio', testcode],
stdin=PIPE, stdout=PIPE, stderr=STDOUT), True)

if compiled:
print(' > Step 3: compiled + optimized')
if testcode not in already_compiled:
if os.system('cargo run -q -- -RFbo %s > /dev/null' % testcode) != 0:
if os.system('cargo run --release -q -- -RFbo %s > /dev/null' % testcode) != 0:
print('*** ERROR: compilation failed')
raise RuntimeError
already_compiled.add(testcode)
Expand All @@ -77,7 +77,7 @@ def main():
tests = [path.splitext(test.replace('/', os.sep))[0]
for test in sys.argv[1:] if not test.startswith('-')]
print('Building...')
if os.system('cargo build') != 0:
if os.system('cargo build --release') != 0:
return 2
print('Running tests, please wait...')
passed = 0
Expand Down

0 comments on commit c3b4091

Please sign in to comment.