-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import subprocess | ||
|
||
import pytest | ||
|
||
def test_record_replay(): | ||
r = subprocess.call(["gcc -o toy test/toy.c"], shell=True) | ||
assert(r == 0) | ||
assert r == 0 | ||
|
||
with open("out1.txt", 'w') as f: | ||
r = subprocess.call(["mkdir mutants; muttfuzz \"./toy\" toy --score --avoid_repeats --stop_on_repeat --repeat_retries 2000 --save_results analysis.csv --save_mutants mutants"], shell=True, stdout=f, stderr=f) | ||
assert(r == 0) | ||
assert r == 0 | ||
with open("out1.txt", 'r') as f: | ||
contents = f.read() | ||
assert("FINAL MUTATION SCORE OVER 14 EXECUTED MUTANTS: 57.14%" in contents) | ||
|
||
with open("out2.txt", 'w') as f: | ||
r = subprocess.call(["muttfuzz \"./toy\" toy --score --avoid_repeats --stop_on_repeat --save_results s_analysis.csv --use_saved_mutants mutants"], shell=True, stdout=f, stderr=f) | ||
assert(r == 0) | ||
assert r == 0 | ||
with open("out2.txt", 'r') as f: | ||
contents = f.read() | ||
assert("FINAL MUTATION SCORE OVER 14 EXECUTED MUTANTS: 57.14%" in contents) | ||
|