3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

test-runner: Make sure to chdir to top_level_path

Some unit tests expect to be running from the top level iwd tree
directory to load certificates and such.  Make sure that test-runner
chdirs to the appropriate directory prior to running the unit tests.
This commit is contained in:
Denis Kenzior 2016-12-14 15:52:28 -06:00
parent 3440652520
commit 6e729f6175

View File

@ -1720,6 +1720,9 @@ static void run_unit_tests(void)
if (!unit_tests || !unit_tests[0]) if (!unit_tests || !unit_tests[0])
goto exit; goto exit;
if (chdir(top_level_path) < 0)
goto exit;
for (i = 0; unit_tests[i]; i++) { for (i = 0; unit_tests[i]; i++) {
unit_test_abs_path = unit_test_abs_path =
l_strdup_printf("%s%s%s", top_level_path, "/unit/", l_strdup_printf("%s%s%s", top_level_path, "/unit/",