Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
mediastreamer2
Commits
fa00ae8c
Commit
fa00ae8c
authored
Jan 27, 2015
by
Guillaume BIENKOWSKI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup output handlers for tests in ms2
parent
cf926c31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
tester/mediastreamer2_tester.c
tester/mediastreamer2_tester.c
+48
-0
No files found.
tester/mediastreamer2_tester.c
View file @
fa00ae8c
...
...
@@ -170,9 +170,57 @@ void mediastreamer2_tester_uninit(void) {
}
}
/*derivated from cunit*/
static
void
test_complete_message_handler
(
const
CU_pTest
pTest
,
const
CU_pSuite
pSuite
,
const
CU_pFailureRecord
pFailureList
)
{
int
i
;
CU_pFailureRecord
pFailure
=
pFailureList
;
if
(
pFailure
)
{
ms_warning
(
"Suite [%s], Test [%s] had failures:"
,
pSuite
->
pName
,
pTest
->
pName
);
}
else
{
ms_warning
(
" passed"
);
}
for
(
i
=
1
;
(
NULL
!=
pFailure
)
;
pFailure
=
pFailure
->
pNext
,
i
++
)
{
ms_warning
(
"
\n
%d. %s:%u - %s"
,
i
,
(
NULL
!=
pFailure
->
strFileName
)
?
pFailure
->
strFileName
:
""
,
pFailure
->
uiLineNumber
,
(
NULL
!=
pFailure
->
strCondition
)
?
pFailure
->
strCondition
:
""
);
}
}
static
void
test_all_tests_complete_message_handler
(
const
CU_pFailureRecord
pFailure
)
{
ms_warning
(
"
\n\n
%s"
,
CU_get_run_results_string
());
}
static
void
test_suite_init_failure_message_handler
(
const
CU_pSuite
pSuite
)
{
ms_warning
(
"Suite initialization failed for [%s]."
,
pSuite
->
pName
);
}
static
void
test_suite_cleanup_failure_message_handler
(
const
CU_pSuite
pSuite
)
{
ms_warning
(
"Suite cleanup failed for '%s'."
,
pSuite
->
pName
);
}
static
void
test_start_message_handler
(
const
CU_pTest
pTest
,
const
CU_pSuite
pSuite
)
{
ms_warning
(
"Suite [%s] Test [%s]"
,
pSuite
->
pName
,
pTest
->
pName
);
}
static
void
test_suite_start_message_handler
(
const
CU_pSuite
pSuite
)
{
ms_warning
(
"Suite [%s]"
,
pSuite
->
pName
);
}
int
mediastreamer2_tester_run_tests
(
const
char
*
suite_name
,
const
char
*
test_name
)
{
int
ret
;
CU_set_test_start_handler
(
test_start_message_handler
);
CU_set_test_complete_handler
(
test_complete_message_handler
);
CU_set_all_test_complete_handler
(
test_all_tests_complete_message_handler
);
CU_set_suite_init_failure_handler
(
test_suite_init_failure_message_handler
);
CU_set_suite_cleanup_failure_handler
(
test_suite_cleanup_failure_message_handler
);
CU_set_suite_start_handler
(
test_suite_start_message_handler
);
if
(
xml_file
!=
NULL
){
CU_set_output_filename
(
xml_file
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment