Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
9566c406
Commit
9566c406
authored
14 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
[#3947] Add an argument to output unit tests results in an XML file
parent
5f453b46
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hudson-sflphone-script.sh
+1
-1
1 addition, 1 deletion
hudson-sflphone-script.sh
sflphone-common/test/cppunitresults.xml
+0
-134
0 additions, 134 deletions
sflphone-common/test/cppunitresults.xml
sflphone-common/test/main.cpp
+18
-8
18 additions, 8 deletions
sflphone-common/test/main.cpp
with
19 additions
and
143 deletions
hudson-sflphone-script.sh
+
1
−
1
View file @
9566c406
...
...
@@ -27,7 +27,7 @@ popd
# Run the unit tests for the daemon
pushd
sflphone-common/test
make check
./test
./test
--xml
popd
This diff is collapsed.
Click to expand it.
sflphone-common/test/cppunitresults.xml
deleted
100644 → 0
+
0
−
134
View file @
5f453b46
<?xml version="1.0" encoding='ISO-8859-1' standalone='yes' ?>
<TestRun>
<FailedTests>
<FailedTest
id=
"9"
>
<Name>
HistoryTest::test_get_history_serialized
</Name>
<FailureType>
Assertion
</FailureType>
<Location>
<File>
historytest.cpp
</File>
<Line>
149
</Line>
</Location>
<Message>
assertion failed
- Expression: Validator::isEqual (tmp, res [
"
747638685
"
])
</Message>
</FailedTest>
<FailedTest
id=
"10"
>
<Name>
HistoryTest::test_set_serialized_history
</Name>
<FailureType>
Assertion
</FailureType>
<Location>
<File>
historytest.cpp
</File>
<Line>
183
</Line>
</Location>
<Message>
assertion failed
- Expression: Validator::isEqual (tmp, map_test [
"
747638685
"
])
</Message>
</FailedTest>
</FailedTests>
<SuccessfulTests>
<Test
id=
"1"
>
<Name>
AccountTest::TestAddRemove
</Name>
</Test>
<Test
id=
"2"
>
<Name>
AudioLayerTest::testAudioLayerConfig
</Name>
</Test>
<Test
id=
"3"
>
<Name>
AudioLayerTest::testPulseConnect
</Name>
</Test>
<Test
id=
"4"
>
<Name>
ConfigurationTest::testYamlEmitter
</Name>
</Test>
<Test
id=
"5"
>
<Name>
HistoryTest::test_create_history_path
</Name>
</Test>
<Test
id=
"6"
>
<Name>
HistoryTest::test_save_history_items_map
</Name>
</Test>
<Test
id=
"7"
>
<Name>
HistoryTest::test_load_history_from_file
</Name>
</Test>
<Test
id=
"8"
>
<Name>
HistoryTest::test_load_history_items_map
</Name>
</Test>
<Test
id=
"11"
>
<Name>
HistoryTest::test_set_serialized_history_with_limit
</Name>
</Test>
<Test
id=
"12"
>
<Name>
HistoryTest::test_save_history_to_file
</Name>
</Test>
<Test
id=
"13"
>
<Name>
HookManagerTest::testAddAction
</Name>
</Test>
<Test
id=
"14"
>
<Name>
HookManagerTest::testLargeUrl
</Name>
</Test>
<Test
id=
"15"
>
<Name>
NumberCleanerTest::test_format_1
</Name>
</Test>
<Test
id=
"16"
>
<Name>
NumberCleanerTest::test_format_2
</Name>
</Test>
<Test
id=
"17"
>
<Name>
NumberCleanerTest::test_format_3
</Name>
</Test>
<Test
id=
"18"
>
<Name>
NumberCleanerTest::test_format_4
</Name>
</Test>
<Test
id=
"19"
>
<Name>
NumberCleanerTest::test_format_5
</Name>
</Test>
<Test
id=
"20"
>
<Name>
NumberCleanerTest::test_format_6
</Name>
</Test>
<Test
id=
"21"
>
<Name>
NumberCleanerTest::test_format_10
</Name>
</Test>
<Test
id=
"22"
>
<Name>
PluginManagerTest::testLoadDynamicLibrary
</Name>
</Test>
<Test
id=
"23"
>
<Name>
PluginManagerTest::testUnloadDynamicLibrary
</Name>
</Test>
<Test
id=
"24"
>
<Name>
PluginManagerTest::testInstanciatePlugin
</Name>
</Test>
<Test
id=
"25"
>
<Name>
PluginManagerTest::testInitPlugin
</Name>
</Test>
<Test
id=
"26"
>
<Name>
PluginManagerTest::testRegisterPlugin
</Name>
</Test>
<Test
id=
"27"
>
<Name>
PluginManagerTest::testLoadPlugins
</Name>
</Test>
<Test
id=
"28"
>
<Name>
PluginManagerTest::testUnloadPlugins
</Name>
</Test>
<Test
id=
"29"
>
<Name>
RtpTest::testRtpInitClose
</Name>
</Test>
<Test
id=
"30"
>
<Name>
SdesNegotiatorTest::testTagPattern
</Name>
</Test>
<Test
id=
"31"
>
<Name>
SdesNegotiatorTest::testCryptoSuitePattern
</Name>
</Test>
<Test
id=
"32"
>
<Name>
SdesNegotiatorTest::testKeyParamsPattern
</Name>
</Test>
<Test
id=
"33"
>
<Name>
SdesNegotiatorTest::testKeyParamsPatternWithoutMKI
</Name>
</Test>
<Test
id=
"34"
>
<Name>
SdesNegotiatorTest::testNegotiation
</Name>
</Test>
<Test
id=
"35"
>
<Name>
SdesNegotiatorTest::testMostSimpleCase
</Name>
</Test>
</SuccessfulTests>
<Statistics>
<Tests>
35
</Tests>
<FailuresTotal>
2
</FailuresTotal>
<Errors>
0
</Errors>
<Failures>
2
</Failures>
</Statistics>
</TestRun>
This diff is collapsed.
Click to expand it.
sflphone-common/test/main.cpp
+
18
−
8
View file @
9566c406
...
...
@@ -45,6 +45,7 @@ int main (int argc, char* argv[])
Logger
::
setDebugMode
(
true
);
int
argvIndex
=
1
;
bool
xmlOutput
=
false
;
if
(
argc
>
1
)
{
if
(
strcmp
(
"--help"
,
argv
[
1
])
==
0
)
{
...
...
@@ -55,6 +56,7 @@ int main (int argc, char* argv[])
int
testSuiteCount
=
suite
->
getChildTestCount
();
printf
(
"Usage: test [OPTIONS] [TEST_SUITE]
\n
"
);
printf
(
"
\n
Options:
\n
"
);
printf
(
" --xml - Output results in an XML file, instead of standard output.
\n
"
);
printf
(
" --debug - Debug mode
\n
"
);
printf
(
" --help - Print help
\n
"
);
printf
(
"
\n
Available test suites:
\n
"
);
...
...
@@ -69,7 +71,13 @@ int main (int argc, char* argv[])
Logger
::
setDebugMode
(
true
);
_info
(
"Debug mode activated"
);
}
}
else
if
(
strcmp
(
"--xml"
,
argv
[
1
])
==
0
)
{
argvIndex
++
;
xmlOutput
=
true
;
_info
(
"Using XML output"
);
}
}
// Default test suite : all tests
...
...
@@ -97,13 +105,15 @@ int main (int argc, char* argv[])
CppUnit
::
TextTestRunner
runner
;
runner
.
addTest
(
suite
);
// Change the default outputter to a compiler error format outputter
// runner.setOutputter (new CppUnit::CompilerOutputter (&runner.result(), std::cerr));
/* Specify XML output */
std
::
ofstream
outfile
(
"cppunitresults.xml"
);
CppUnit
::
XmlOutputter
*
outputter
=
new
CppUnit
::
XmlOutputter
(
&
runner
.
result
(),
outfile
);
runner
.
setOutputter
(
outputter
);
if
(
xmlOutput
)
{
/* Specify XML output */
std
::
ofstream
outfile
(
"cppunitresults.xml"
);
CppUnit
::
XmlOutputter
*
outputter
=
new
CppUnit
::
XmlOutputter
(
&
runner
.
result
(),
outfile
);
runner
.
setOutputter
(
outputter
);
}
else
{
// Change the default outputter to a compiler error format outputter
runner
.
setOutputter
(
new
CppUnit
::
CompilerOutputter
(
&
runner
.
result
(),
std
::
cerr
));
}
// Run the tests.
bool
wasSucessful
=
runner
.
run
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment