mirror of
https://github.com/Z3Prover/z3
synced 2025-08-09 12:50:32 +00:00
other components
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
e9eab22e5c
commit
68269c43a6
250 changed files with 70871 additions and 0 deletions
52
test/smtparser.cpp
Normal file
52
test/smtparser.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
#ifdef _WINDOWS
|
||||
#include <iostream>
|
||||
#include <strstream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include "smtparser.h"
|
||||
#include "for_each_file.h"
|
||||
#include "array_decl_plugin.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
|
||||
|
||||
class for_each_file_smt : public for_each_file_proc {
|
||||
public:
|
||||
for_each_file_smt() {}
|
||||
|
||||
bool operator()(char const * file_path) {
|
||||
bool result = true;
|
||||
std::cout << "Parsing: " << file_path << std::endl;
|
||||
|
||||
ast_manager ast_manager;
|
||||
smtlib::parser* parser = smtlib::parser::create(ast_manager);
|
||||
ast_manager.register_decl_plugins();
|
||||
|
||||
parser->initialize_smtlib();
|
||||
|
||||
if (!parser->parse_file(file_path)) {
|
||||
std::cout << "Could not parse file : " << file_path << std::endl;
|
||||
result = false;
|
||||
}
|
||||
dealloc(parser);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static bool test_directory(char const * base) {
|
||||
for_each_file_smt foreach;
|
||||
return for_each_file(foreach, base, "*.smt");
|
||||
}
|
||||
|
||||
void tst_smtparser(char** argv, int argc, int & i) {
|
||||
bool result = true;
|
||||
if (i + 1 < argc) {
|
||||
result = test_directory(argv[i+1]);
|
||||
i += 1;
|
||||
}
|
||||
SASSERT(result);
|
||||
}
|
||||
#else
|
||||
void tst_smtparser(char** argv, int argc, int & i) {
|
||||
}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue