fix(test): derive blaise binary path from TestRunner location, not cwd

BlaisePath() was using GetCurrentDir() as the project root fallback,
then appending 'compiler/target/blaise'.  This worked when the TestRunner
was invoked from the project root, but broke when PasBuild cd'd into
compiler/target/ before running ./TestRunner — the path doubled up to
.../compiler/target/compiler/target/blaise.

Fix by deriving the path from ExtractFilePath(ParamStr(0)), which always
points to the directory containing the TestRunner binary regardless of
the caller's working directory.  The BLAISE_PROJECT_ROOT env var override
is preserved unchanged.
This commit is contained in:
Graeme Geldenhuys 2026-06-12 16:59:15 +01:00
parent 75834d393d
commit 1b0afaf3d3

View file

@ -57,12 +57,13 @@ end;
function TSepCompileTests.BlaisePath(): string;
var
Root: string;
ProjectRoot: string;
begin
Root := GetEnvironmentVariable('BLAISE_PROJECT_ROOT');
if Root = '' then
Root := GetCurrentDir();
Result := IncludeTrailingPathDelimiter(Root) + 'compiler/target/blaise'
ProjectRoot := GetEnvironmentVariable('BLAISE_PROJECT_ROOT');
if ProjectRoot <> '' then
Result := IncludeTrailingPathDelimiter(ProjectRoot) + 'compiler/target/blaise'
else
Result := ExtractFilePath(ParamStr(0)) + 'blaise'
end;
function TSepCompileTests.RunBlaise(const AArgs: array of string;