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

Flowchart improved #53

Merged
merged 4 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ extern "C" int LLVMFuzzerTestOneInput(const char* data, size_t size) {
auto& translator = translators[GeneratorInt(data, size) % translators.size()];
std::string input = GeneratorString(data, size);
std::string options = GeneratorString(data, size);
if (translator->Name())
if (std::string(translator->Identifier()) == "Grammar")
return 0;
std::cout << translator->Identifier() << std::endl;
std::cout << input << std::endl;
try {
translator->Translate(input, options);
std::cout << translator->Translate(input, options) << std::endl;
} catch (...) {
}
return 0; // Non-zero return values are reserved for future use.
Expand Down
8 changes: 6 additions & 2 deletions src/input_output_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ void ParseDirectoryName(std::string name,
int main(int, const char**) {
int result = EXIT_SUCCESS;
std::string path = test_directory;
std::cout << "test_directory = " << test_directory << std::endl;
//std::cout << "test_directory = " << test_directory << std::endl;

for (auto& dir : std::filesystem::directory_iterator(path)) {
std::string translator_name;
std::string options;
Expand All @@ -63,14 +64,17 @@ int main(int, const char**) {
std::string output_computed = translator->Translate(input, options);

if (output_computed == output) {
std::cout << " [PASS] " << test.path() << std::endl;
//std::cout << " [PASS] " << test.path() << std::endl;
} else {
std::cout << " [FAIL] " << test.path() << std::endl;
std::cout << "---[Output]------------------" << std::endl;
std::cout << output_computed << std::endl;
std::cout << "---[Expected]----------------" << std::endl;
std::cout << output << std::endl;
std::cout << "---------------------" << std::endl;

std::ofstream(test.path() / "output") << output_computed;

result = EXIT_FAILURE;
}
}
Expand Down
Loading