Skip to content

Commit 050db0c

Browse files
committed
run-tests: Update for LexicalPath API changes
1 parent fb8bbda commit 050db0c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Userland/Utilities/run-tests.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,15 @@ FileResult TestRunner::run_test_file(const String& test_path)
193193
int child_out_err_file = mkstemp(child_out_err_path);
194194
VERIFY(child_out_err_file >= 0);
195195

196+
String dirname = path_for_test.dirname();
197+
String basename = path_for_test.basename();
198+
196199
(void)posix_spawn_file_actions_adddup2(&file_actions, child_out_err_file, STDOUT_FILENO);
197200
(void)posix_spawn_file_actions_adddup2(&file_actions, child_out_err_file, STDERR_FILENO);
198-
(void)posix_spawn_file_actions_addchdir(&file_actions, path_for_test.dirname().characters());
201+
(void)posix_spawn_file_actions_addchdir(&file_actions, dirname.characters());
199202

200203
Vector<const char*, 4> argv;
201-
argv.append(path_for_test.basename().characters());
204+
argv.append(basename.characters());
202205
auto extra_args = m_config->read_entry(path_for_test.basename(), "Arguments", "").split(' ');
203206
for (auto& arg : extra_args)
204207
argv.append(arg.characters());
@@ -242,7 +245,7 @@ FileResult TestRunner::run_test_file(const String& test_path)
242245

243246
int main(int argc, char** argv)
244247
{
245-
auto program_name = LexicalPath { argv[0] }.basename();
248+
auto program_name = LexicalPath::basename(argv[0]);
246249

247250
#ifdef SIGINFO
248251
signal(SIGINFO, [](int) {

0 commit comments

Comments
 (0)