perf: Make -t following_perf respect the usual db path rules.

This commit is contained in:
2025-05-12 12:41:13 -04:00
parent 35941a7ddc
commit ef58749ce3
3 changed files with 14 additions and 2 deletions

View File

@ -186,8 +186,10 @@ const command_t k_commands[] = {
static int _tf_command_test(const char* file, int argc, char* argv[])
{
#if !defined(__ANDROID__)
const char* default_db_path = _get_db_path();
tf_test_options_t test_options = {
.exe_path = file,
.db_path = default_db_path,
};
bool show_usage = false;
@ -195,10 +197,11 @@ static int _tf_command_test(const char* file, int argc, char* argv[])
{
static const struct option k_options[] = {
{ "tests", required_argument, NULL, 't' },
{ "db-path", required_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{ 0 },
};
int c = getopt_long(argc, argv, "t:h", k_options, NULL);
int c = getopt_long(argc, argv, "t:d:h", k_options, NULL);
if (c == -1)
{
break;
@ -214,6 +217,9 @@ static int _tf_command_test(const char* file, int argc, char* argv[])
case 't':
test_options.tests = optarg;
break;
case 'd':
test_options.db_path = optarg;
break;
}
}
@ -229,10 +235,12 @@ static int _tf_command_test(const char* file, int argc, char* argv[])
tf_printf("options\n");
tf_printf(" -t, --tests tests Comma-separated list of tests to run. (default: all)\n");
tf_printf(" -h, --help Show this usage information.\n");
tf_free((void*)default_db_path);
return EXIT_FAILURE;
}
tf_tests(&test_options);
tf_free((void*)default_db_path);
return EXIT_SUCCESS;
#else
return EXIT_FAILURE;