353353 // Avoid conditionals by copying/creating ccFlags appropriately.
354354
355355 if (inCCFlags)
356- sprintf_s (ccFlags, " %s" , inCCFlags);
356+ {
357+ if (pDir->HasTestInfoData (TIK_SOURCE_PATH))
358+ {
359+ sprintf_s (ccFlags, " %s -baselinePath:%s" , inCCFlags, pDir->GetDirectoryPath ());
360+ }
361+ else
362+ {
363+ sprintf_s (ccFlags, " %s" , inCCFlags);
364+ }
365+ }
357366 else
367+ {
358368 ccFlags[0 ] = ' \0 ' ;
369+ }
359370
360371 switch (TargetMachine) {
361372 case TM_WVM:
495506 {
496507 cmd = pTestVariant->testInfo .data [TIK_COMMAND];
497508 }
498- sprintf_s (cmdbuf, " %s %s %s %s %s >testout%d 2>&1" , cmd, optFlags, tempExtraCCFlags, ccFlags, testCmd, localTestCount );
509+ sprintf_s (cmdbuf, " %s %s %s %s %s >%s 2>&1" , cmd, optFlags, tempExtraCCFlags, ccFlags, testCmd, full );
499510
500511 Message (" Running '%s'" , cmdbuf);
501512
505516 return 0 ;
506517 }
507518
508- cmdResult = ExecuteCommand (pDir->GetDirectoryPath (), cmdbuf, millisecTimeout, envFlags);
519+ cmdResult = ExecuteCommand (pDir->GetFullPathFromSourceOrDirectory (), cmdbuf, millisecTimeout, envFlags);
509520
510521 if (cmdResult && cmdResult != WAIT_TIMEOUT && !pTestVariant->testInfo .data [TIK_BASELINE]) // failure code, not baseline diffing
511522 {
535546 if (pTestVariant->testInfo .data [TIK_BASELINE]) {
536547 char baseline_file[_MAX_PATH];
537548
538- sprintf_s (baseline_file, " %s\\ %s" , pDir->GetDirectoryPath (),
549+ sprintf_s (baseline_file, " %s\\ %s" , pDir->GetFullPathFromSourceOrDirectory (),
539550 pTestVariant->testInfo .data [TIK_BASELINE]);
540551 if (DoCompare (baseline_file, full)) {
541552 reason = " diffs from baseline" ;
@@ -1031,7 +1042,7 @@ BOOL
10311042 fFailed = TRUE ;
10321043 }
10331044 else {
1034- sprintf_s (full, " %s\\ %s" , pDir->GetDirectoryPath (),
1045+ sprintf_s (full, " %s\\ %s" , pDir->GetFullPathFromSourceOrDirectory (),
10351046 pTestVariant->testInfo .data [TIK_BASELINE]);
10361047 if (DoCompare (tmp_file1, full)) {
10371048
@@ -1301,7 +1312,7 @@ int
13011312 // If we have no pathname, use the current directory.
13021313
13031314 if (p == pFile->string ) {
1304- sprintf_s (full, " %s\\ " , pDir->GetDirectoryPath ());
1315+ sprintf_s (full, " %s\\ " , pDir->GetFullPathFromSourceOrDirectory ());
13051316 }
13061317 else {
13071318
@@ -1326,7 +1337,7 @@ int
13261337 strcat_s (full, p);
13271338
13281339 if (GetFileAttributes (full) == INVALID_FILE_ATTRIBUTES) {
1329- LogError (" ERROR: '%s' does not exist" , pFile-> string );
1340+ LogError (" ERROR: '%s' does not exist" , full );
13301341 return -1 ;
13311342 }
13321343 }
0 commit comments