Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
145b8dae
Commit
145b8dae
authored
Nov 09, 2018
by
Nicolas Michon
Browse files
Tests: changes following factorization of logs options into bc_tester
parent
2494796f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
tester/liblinphone_tester.c
tester/liblinphone_tester.c
+19
-11
No files found.
tester/liblinphone_tester.c
View file @
145b8dae
...
...
@@ -163,6 +163,21 @@ static void log_handler(int lev, const char *fmt, va_list args) {
bctbx_logv
(
BCTBX_LOG_DOMAIN
,
lev
,
fmt
,
args
);
}
int
silent_arg_func
(
const
char
*
arg
)
{
linphone_core_set_log_level
(
ORTP_FATAL
);
return
0
;
}
int
verbose_arg_func
(
const
char
*
arg
)
{
linphone_core_set_log_level
(
ORTP_MESSAGE
);
return
0
;
}
int
logfile_arg_func
(
const
char
*
arg
)
{
if
(
liblinphone_tester_set_log_file
(
arg
)
<
0
)
return
-
2
;
return
0
;
}
void
liblinphone_tester_init
(
void
(
*
ftester_printf
)(
int
level
,
const
char
*
fmt
,
va_list
args
))
{
bctbx_init_logger
(
FALSE
);
if
(
!
log_file
)
{
...
...
@@ -173,6 +188,9 @@ void liblinphone_tester_init(void(*ftester_printf)(int level, const char *fmt, v
}
if
(
ftester_printf
==
NULL
)
ftester_printf
=
log_handler
;
bc_tester_set_silent_func
(
silent_arg_func
);
bc_tester_set_verbose_func
(
verbose_arg_func
);
bc_tester_set_logfile_func
(
logfile_arg_func
);
bc_tester_init
(
ftester_printf
,
ORTP_MESSAGE
,
ORTP_ERROR
,
"rcfiles"
);
liblinphone_tester_add_suites
();
}
...
...
@@ -195,9 +213,6 @@ int liblinphone_tester_set_log_file(const char *filename) {
#if !TARGET_OS_IPHONE && !(defined(LINPHONE_WINDOWS_PHONE) || defined(LINPHONE_WINDOWS_UNIVERSAL))
static
const
char
*
liblinphone_helper
=
"
\t\t\t
--verbose
\n
"
"
\t\t\t
--silent
\n
"
"
\t\t\t
--log-file <output log file path>
\n
"
"
\t\t\t
--domain <test sip domain>
\n
"
"
\t\t\t
--auth-domain <test auth domain>
\n
"
"
\t\t\t
--dns-hosts </etc/hosts -like file to used to override DNS names (default: tester_hosts)>
\n
"
...
...
@@ -217,14 +232,7 @@ int main (int argc, char *argv[])
linphone_core_set_log_level
(
ORTP_ERROR
);
for
(
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"--verbose"
)
==
0
)
{
linphone_core_set_log_level
(
ORTP_MESSAGE
);
}
else
if
(
strcmp
(
argv
[
i
],
"--silent"
)
==
0
)
{
linphone_core_set_log_level
(
ORTP_FATAL
);
}
else
if
(
strcmp
(
argv
[
i
],
"--log-file"
)
==
0
){
CHECK_ARG
(
"--log-file"
,
++
i
,
argc
);
if
(
liblinphone_tester_set_log_file
(
argv
[
i
])
<
0
)
return
-
2
;
}
else
if
(
strcmp
(
argv
[
i
],
"--domain"
)
==
0
){
if
(
strcmp
(
argv
[
i
],
"--domain"
)
==
0
){
CHECK_ARG
(
"--domain"
,
++
i
,
argc
);
test_domain
=
argv
[
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"--auth-domain"
)
==
0
){
...
...
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