-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #376 from pysmt/smtlibparser_testing
Use Fuzzer for testing of SMTLIB Parser
- Loading branch information
Showing
25 changed files
with
129 additions
and
18 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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
These files were generated using FuzzSMT by JKU, with the patch by the | ||
patch by Christoph Wintersteiger. | ||
|
||
See: Robert Brummayer and Armin Biere. | ||
Fuzzing and Delta-Debugging SMT Solvers |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# | ||
# This file is part of pySMT. | ||
# | ||
# Copyright 2014 Andrea Micheli and Marco Gario | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
import os | ||
|
||
from pysmt.shortcuts import reset_env | ||
from pysmt.test import TestCase | ||
from pysmt.smtlib.parser import SmtLibParser | ||
|
||
|
||
class TestSmtLibParserFuzzer(TestCase): | ||
|
||
def test_fuzzed(self): | ||
failed = [] | ||
for fname in FUZZED_FILES: | ||
try: | ||
self.parse(os.path.join(SMTLIB_DIR, fname)) | ||
except NotImplementedError as ex: | ||
print("Ignoring not implemented SMT command error: %s"\ | ||
% str(ex)) | ||
except Exception as ex: | ||
failed.append((fname, ex)) | ||
if len(failed) != 0: | ||
for fname, ex in failed: | ||
print(fname, ex) | ||
print("-"*50) | ||
self.assertTrue(len(failed) == 0, | ||
"%d/%d" %(len(failed), len(FUZZED_FILES))) | ||
|
||
def parse(self, fname): | ||
reset_env() | ||
parser = SmtLibParser() | ||
script = parser.get_script_fname(fname) | ||
self.assertIsNotNone(script) | ||
# Can we know that the last command is a check-sat? | ||
|
||
SMTLIB_DIR = "pysmt/test/smtlib/fuzzed" | ||
FUZZED_FILES = ["AUFLIA.smt2.bz2", | ||
"QF_AUFBV.smt2.bz2", | ||
"QF_LRA.smt2.bz2", | ||
"QF_UFLIA.smt2.bz2", | ||
"AUFLIRA.smt2.bz2", | ||
"QF_AUFLIA.smt2.bz2", | ||
"QF_NIA.smt2.bz2", | ||
"QF_UFLRA.smt2.bz2", | ||
"AUFNIRA.smt2.bz2", | ||
"QF_AX.smt2.bz2", | ||
"QF_NRA.smt2.bz2", | ||
"QF_UFNRA.smt2.bz2", | ||
"QF_BV.smt2.bz2", | ||
"QF_RDL.smt2.bz2", | ||
"QF_UFRDL.smt2.bz2", | ||
"QF_IDL.smt2.bz2", | ||
"QF_UFBV.smt2.bz2", | ||
"QF_UF.smt2.bz2", | ||
"QF_LIA.smt2.bz2", | ||
"QF_UFIDL.smt2.bz2", | ||
] |