[go: up one dir, main page]

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

Add option to generate XML test cases (--write-xml-tests) #1181

Closed
wants to merge 1 commit into from

Conversation

MartinNowack
Copy link
Contributor

Add option to generate xml testcases. This patch generates test cases as XML files.

In addition, test-comp-specific, additional arguments are specific to generate experiment descriptions.

…ered to Test-Comp

Add option to provide original source file and its hash sum; TODO REMOVE namespace change
@MartinNowack MartinNowack added the test-comp Patches mostly related to Test-Comp (test-comp.sosy-lab.org) label Nov 10, 2019
@kren1
Copy link
Contributor
kren1 commented Nov 10, 2019

Wouldn't this be better as a ktest tool option, similar to the binary output one?

@MartinNowack
Copy link
Contributor Author

@kren1 Not for test-comp.

Copy link
Contributor
@ccadar ccadar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @MartinNowack , just a few minor comments.

@@ -289,6 +289,22 @@ namespace {
cl::desc("Link the llvm libc++ library into the bitcode (default=false)"),
cl::init(false),
cl::cat(LinkCat));

cl::OptionCategory TestCompCat("Options specific to Test-Comp",
"Options specific to test-comp.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you say something like "These are options specific to the Test-Comp competition" for consistency with the other category descriptions which are full sentences?

"Options specific to test-comp.");

llvm::cl::opt<bool> WriteXMLTests("write-xml-tests",
llvm::cl::desc("Write XML-formated tests"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatted

for (unsigned i=0; i<b.numObjects; i++)
delete[] b.objects[i].bytes;
delete[] b.objects;
if (!WriteXMLTests)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be an OR, we should allow the generation of both .ktest and .xml files

cl::cat(TestCompCat));

llvm::cl::opt<std::string> TCOrig("tc-orig",
llvm::cl::desc("Test-Comp original file"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain a bit what this is?

@kren1
Copy link
Contributor
kren1 commented Mar 4, 2020

What about some sort of usage like this klee -test-gen-callback="ktest-tool --to-xml", where klee calls the system("ktest-tool --to-xml" + test_caste). I guess the only annoying thing is that this would need a fork server or something to get rid of forking penalty.

A nice thing about this approach is it doesn't pollute KLEE code, but more importantly it's more flexible. For example you could do something like klee -test-gen-callback="ktest-tool --extract buf" to get the binary dump of the test case, which would be needed for OSS fuzz.

@ccadar
Copy link
Contributor
ccadar commented Jun 19, 2020

I think we should add this, as it's not an exotic option -- this XML-formatted tests are now supported by many other tools. There are also a number of KLEE-based tools participating in Test-Comp, and it's good to eliminate code duplication, especially if the format changes in the future.

So let's merge this. @MartinNowack can you make the small changes I requested?

@ccadar
Copy link
Contributor
ccadar commented Jun 19, 2020

@MartinNowack You will also need to fix compilation for LLVM < 4:

/tmp/klee_src/tools/klee/main.cpp:573:21: error: 'APFloatBase' was not declared in this scope
       llvm::APFloat(APFloatBase::IEEEdouble(), v).print(*file);
                     ^

@ccadar
Copy link
Contributor
ccadar commented Jun 16, 2023

@MartinNowack any reason not to merge this? We receive regular inquiries about this, most recently on klee-dev.

@ccadar
Copy link
Contributor
ccadar commented Nov 12, 2023

@MartinNowack I know this is not a priority, and from what I understand you don't plan to revive it. So let's close it.
I added it to the list of potential extensions to KLEE at https://github.com/klee/klee/projects/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-comp Patches mostly related to Test-Comp (test-comp.sosy-lab.org)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants