I have a complete project, with several unit test, coded in C++. I need to get the results of these unit test to print out to an xml file but I have no idea where to start
any help?
I have a complete project, with several unit test, coded in C++. I need to get the results of these unit test to print out to an xml file but I have no idea where to start
any help?
Do you have any idea what the XML file is supposed to look like, for example element and attribute names.
Moved to tech.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
No, but I think all that can be very flexible.
I just dont know what I need to do to get it there. Do I need something in each unit test file (there are over 100) or do I need to write a new file with specific instructions to run the unit test and print them to an XML file (wouldnt know exactly how to do that because I also need to print out whether the test pass/fail).
Or is there some easier way?
That would depend on several things:
What do you want from the test-case, to go into the XML file - perhaps just which test and success/fail, if so, what else?
Are the test-cases currently creating files that you may translate into XML?
These are just some of the questions that we'd have to know the answer to, to be able to help properly.
--
Mats
For right now all I need is the tests that fail. These test are not creating any files or are being output to any file. When I run the program the tests are displayed in a list format and I can choose to run one individually or all of them. My problems are; I do not know how to get the results of each unit test without manually running the program and then how to get those results to any/xml file.
So how do you (or perhaps more correctly, the test-framework) know if the test succeeded or failed? If this is not in a file, then you'll need to use the framework to store the result in the file. Or change each test to generate a success/fail entry in a file - but if that's not part of the current unit test, then it's pretty meaningless to change the test itself. Don't the tests say WHAT failed somehow - that tends to be useful for troubleshooting the relevant fix.
--
Mats
Well without some idea as to what you're going to do with the XML file once you've got it, it could be something simple like putting <test></test> around the body of each test results file.
Or perhaps you're after something like
<test file="file1.txt" result="pass" />
<test file="file2.txt" result="fail" />
To me, this just seems like Perl to extract the required information, with some formatted output.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Salem, I too, was thinking that Perl would be a good choice here... [Not particularly original thinking, of course].
--
Mats
I need the xml file becuase I am using CruiseControl ( dont know if you are familiar with) but it is continuous integration where my project is run/compiled everytime it is updated. After running it only shows the files that failed to compile, but it also has the capability to show unit test results by including the xml file of unit test results
I do have test fixutres for the unit test and it does output what failed but not to a file. As for perl- that i have no idea about
any ideas?
Ask your co-workers who've been using the system longer than you have?
Look at examples of what you have (test results, compilation logs, whatever) and then look at example XML files which were derived.
You've got all the information, or at least the ability to find it out. All we can do is make fairly general suggestions about how might be the best way of processing all the text information you have into something you want.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.