Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing issue #16 (warning when no solver is specified) #23

Merged
merged 12 commits into from
May 7, 2021
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- name: Misc
run: |
python tests/integration_tests/misc/file_size_limit.py
python tests/integration_tests/misc/no_solvers.py
python tests/integration_tests/misc/directory_mode.py
- name: opfuzz
run: |
Expand Down
5 changes: 4 additions & 1 deletion src/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@
# pre-processing

# Parse CLI
if args.SOLVER_CLIS == "": args.SOLVER_CLIS = solvers
if args.SOLVER_CLIS == "":
if len(solvers) == 0:
exit("Error: no solver specified. Either change the commandline or edit config/config.py.")
args.SOLVER_CLIS = solvers
else: args.SOLVER_CLIS = args.SOLVER_CLIS.split(";") + solvers

if args.timeout <= 0: exit("Error: timeout should not be a negative number or zero.")
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/detection/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def is_sound(res1, res2):
def call_fuzzer(first_config, second_config, fn, opts):
cmd = python+' yinyang.py '+ '"'+ first_config+ ";" + second_config + '" ' + opts + ' ' + fn
output = subprocess.getoutput(cmd)
print(output)
print(output,flush=True)
crash_issues = None
soundness_issues=None
duplicate_issues=None
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/misc/directory_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def cleanup():
first_config=z3+" model_validate=true"
second_config=cvc4+" --check-models --produce-models --incremental -q"
mock_benchmarks=str(os.path.dirname(os.path.realpath(__file__)))+"/mock_benchmarks"
generated_seeds, used_seeds, ignored_issues, cmd = run_opfuzz(first_config, second_config, mock_benchmarks ,"",TIME_LIMIT)
generated_seeds, used_seeds, ignored_issues, cmd = run_opfuzz(first_config, second_config, mock_benchmarks ,"-m 1",TIME_LIMIT)
if not (generated_seeds == 300 and used_seeds == 3 and ignored_issues == 2):
print("An error occurred.", flush=True)
print("cmd", cmd)
Expand Down
17 changes: 17 additions & 0 deletions tests/integration_tests/misc/no_solvers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
import subprocess
import sys

python=sys.executable

def call_fuzzer(fn):
cmd = python+' yinyang.py "" ' + fn
output = subprocess.getoutput(cmd)
return output

fn="examples/phi1.smt2"
out = call_fuzzer(fn)
if "Error: no solver specified" in out:
exit(0)
exit(1)