fpcunit: fix #29283: save the configuration file to the default path

(cherry picked from commit 218c536b94)
This commit is contained in:
rich2014 2023-10-30 23:06:11 +08:00 committed by Maxim Ganetsky
parent 3211889649
commit cd9da93187

View File

@ -346,8 +346,12 @@ begin
end;
procedure TGUITestRunner.GUITestRunnerCreate(Sender: TObject);
var
cfgFileName: String;
begin
FConfStore := TIniFile.Create(ExtractFileNameOnly(ParamStr(0)) + '.fpcunit.ini'); // Prevent ini file names conflict if tests are embedded in application
cfgFileName:= GetAppConfigDir(false) + ExtractFileNameOnly(ParamStr(0)) + '.fpcunit.ini'; // Prevent ini file names conflict if tests are embedded in application
FConfStore := TIniFile.Create(cfgFilename);
barColor := clGreen;
TestTree.Items.Clear;
BuildTree(TestTree.Items.AddObject(nil, rsAllTests, GetTestRegistry),