@@ -524,6 +524,17 @@ static SlangResult _extractCommand(const char** ioCursor, UnownedStringSlice& ou
524
524
}
525
525
}
526
526
527
+ static void applyMacroSubstitution (String filePath, TestDetails& details)
528
+ {
529
+ for (auto & arg : details.options .args )
530
+ {
531
+ arg = StringUtil::replaceAll (
532
+ arg.getUnownedSlice (),
533
+ toSlice (" $dirname" ),
534
+ Path::getParentDirectory (filePath).getUnownedSlice ());
535
+ }
536
+ }
537
+
527
538
// Try to read command-line options from the test file itself
528
539
static SlangResult _gatherTestsForFile (
529
540
TestCategorySet* categorySet,
@@ -597,6 +608,7 @@ static SlangResult _gatherTestsForFile(
597
608
if (command == " TEST" )
598
609
{
599
610
SLANG_RETURN_ON_FAIL (_gatherTestOptions (categorySet, &cursor, testDetails.options ));
611
+ applyMacroSubstitution (filePath, testDetails);
600
612
601
613
// See if the type of test needs certain APIs available
602
614
const RenderApiFlags testRequiredApis =
@@ -611,6 +623,7 @@ static SlangResult _gatherTestsForFile(
611
623
else if (command == " DIAGNOSTIC_TEST" )
612
624
{
613
625
SLANG_RETURN_ON_FAIL (_gatherTestOptions (categorySet, &cursor, testDetails.options ));
626
+ applyMacroSubstitution (filePath, testDetails);
614
627
615
628
// Apply the file wide options
616
629
_combineOptions (categorySet, fileOptions, testDetails.options );
0 commit comments