mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
tester: remove --config since bc tester already provide it now
This commit is contained in:
parent
c94da304c3
commit
03ad6404b6
3 changed files with 30 additions and 11 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 079af18e985acad5a752cb11dd1c40b329b037a3
|
||||
Subproject commit 262c1ca2e48d5c0eedae86cc36579bacd234ee48
|
||||
|
|
@ -51,7 +51,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#endif
|
||||
|
||||
static char *bc_tester_resource_dir_prefix = NULL;
|
||||
static char *bc_tester_writable_dir_prefix = NULL;
|
||||
// by default writable will always write near the executable
|
||||
static char *bc_tester_writable_dir_prefix = ".";
|
||||
|
||||
int bc_printf_verbosity_info;
|
||||
int bc_printf_verbosity_error;
|
||||
|
|
@ -346,6 +347,7 @@ static int file_exists(const char* root_path) {
|
|||
static void detect_res_prefix(const char* prog) {
|
||||
char* progpath = strdup(prog);
|
||||
char* prefix = NULL;
|
||||
FILE* writable_file = NULL;
|
||||
|
||||
#if defined(BC_TESTER_WINDOWS_PHONE) || defined(BC_TESTER_WINDOWS_UNIVERSAL)
|
||||
bc_tester_set_resource_dir_prefix("Assets");
|
||||
|
|
@ -383,20 +385,41 @@ static void detect_res_prefix(const char* prog) {
|
|||
free(progpath2);
|
||||
}
|
||||
|
||||
if (bc_tester_resource_dir_prefix != NULL && !file_exists(bc_tester_resource_dir_prefix)) {
|
||||
printf("Invalid provided resource directory: could not find expected resources in %s.\n", bc_tester_resource_dir_prefix);
|
||||
free(bc_tester_resource_dir_prefix);
|
||||
bc_tester_resource_dir_prefix = NULL;
|
||||
}
|
||||
|
||||
if (prefix != NULL) {
|
||||
if (bc_tester_resource_dir_prefix == NULL) {
|
||||
if (bc_tester_resource_dir_prefix != NULL) {
|
||||
printf("Resource directory set to %s\n", prefix);
|
||||
bc_tester_set_resource_dir_prefix(prefix);
|
||||
}
|
||||
|
||||
if (bc_tester_writable_dir_prefix == NULL) {
|
||||
printf("Writable directory set to %s\n", prefix);
|
||||
bc_tester_set_writable_dir_prefix(prefix);
|
||||
}
|
||||
free(prefix);
|
||||
} else if (bc_tester_resource_dir_prefix == NULL || bc_tester_writable_dir_prefix == NULL) {
|
||||
printf("Failed to detect resources for %s.\n", prog);
|
||||
printf("Could not find resource directory in %s! Please try again using option --resource-dir and/or --writable-dir.\n", progpath);
|
||||
abort();
|
||||
}
|
||||
|
||||
// check that we can write in writable directory
|
||||
if (bc_tester_writable_dir_prefix != NULL) {
|
||||
writable_file = fopen("bc_tester_utils.tmp", "w");
|
||||
if (writable_file) {
|
||||
fclose(writable_file);
|
||||
}
|
||||
}
|
||||
if (bc_tester_resource_dir_prefix == NULL || writable_file == NULL) {
|
||||
if (bc_tester_resource_dir_prefix == NULL) {
|
||||
printf("Failed to detect resources for %s.\n", prog);
|
||||
printf("Could not find resource directory in %s! Please try again using option --resource-dir.\n", progpath);
|
||||
}
|
||||
if (writable_file == NULL) {
|
||||
printf("Failed to write file in %s. Please try again using option --writable-dir.\n", bc_tester_writable_dir_prefix);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (progpath != NULL) {
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ 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--config <config 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"
|
||||
|
|
@ -218,9 +217,6 @@ int main (int argc, char *argv[])
|
|||
} else if (strcmp(argv[i],"--auth-domain")==0){
|
||||
CHECK_ARG("--auth-domain", ++i, argc);
|
||||
auth_domain=argv[i];
|
||||
} else if (strcmp(argv[i],"--config")==0){
|
||||
CHECK_ARG("--config", ++i, argc);
|
||||
bc_tester_set_resource_dir_prefix(argv[i]);
|
||||
}else if (strcmp(argv[i],"--dns-hosts")==0){
|
||||
CHECK_ARG("--dns-hosts", ++i, argc);
|
||||
userhostsfile=argv[i];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue