Hi all,
I'm trying to run my fpcunit unit-tests on Gitlab, and let Gitlab show the results. But it can only handle JUnit-like xml.
Does someone already have something lying around to convert the fpcunit format into junit?
Regards,
Joost.

Mailing lists / fpc-devel / 2021-12
6 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi all,
I'm trying to run my fpcunit unit-tests on Gitlab, and let Gitlab show the results. But it can only handle JUnit-like xml.
Does someone already have something lying around to convert the fpcunit format into junit?
Regards,
Joost.
I assume
https://gitlab.com/freepascal.org/fpc/source/-/blob/main/tests/utils/fpts2junit.pp is not what you want?
Op 29-12-2021 om 15:35 schreef Florian Klämpfl via fpc-devel:
I thought it could only handle the testsuite-output? (not fpcunit)
Regards,
Joost.
I'm trying to run my fpcunit unit-tests on Gitlab, and let Gitlab show the results. But…
Is the FPCUnit format very different from the JUnit one ? Because fpcunit is based on junit.
Michael.
Op 29-12-2021 om 16:05 schreef Michael Van Canneyt via fpc-devel:
Well, they are similar, but not similar enough.
fpcunit:
<?xml version="1.0" encoding="utf-8"?>
<TestResults>
<!-- Generated using FPCUnit on 2021-12-29 15:02:32--> <TestListing>
<TestSuite Name="" ElapsedTime="00:00:16.471" NumberOfErrors="0" NumberOfFailures="6" NumberOfRunTests="29" NumberOfIgnoredTests="0"> <TestSuite Name="TDABTestRunBasics" ElapsedTime="00:00:03.598" NumberOfErrors="0" NumberOfFailures="2" NumberOfRunTests="10" NumberOfIgnoredTests="0">
<Test Name="TestInitialize" Result="OK"
ElapsedTime="00:00:00.211"/>
</TestSuite>
</TestSuite>
</TestListing>
<Title>FPCUnit Console test runner</Title>
<NumberOfRunTests>29</NumberOfRunTests>
<NumberOfErrors>0</NumberOfErrors>
<NumberOfFailures>6</NumberOfFailures>
<NumberOfIgnoredTests>0</NumberOfIgnoredTests>
<TotalElapsedTime>00:00:16.473</TotalElapsedTime>
<DateTimeRan>2021-12-29 15:02:48</DateTimeRan>
</TestResults>
junit:
<testsuite tests="3">
<testcase classname="foo1" name="ASuccessfulTest"/> <testcase classname="foo2" name="AnotherSuccessfulTest"/> <testcase classname="foo3" name="AFailingTest">
<failure type="NotEnoughFoo"> details about failure </failure> </testcase>
</testsuite>
If nothing exists already, I can add it as a format to fpcunit.
Regards,
Joost.
Yes. I suspect you can take the existing XML listener and adapt it easily enough...
Michael.