mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-25 03:50:57 +01:00
* ensure that the executable path used in the test is absolute
(cherry picked from commit 8028a769f4)
This commit is contained in:
parent
ac28b5ad05
commit
92fc7edd7e
@ -1,18 +1,21 @@
|
||||
uses
|
||||
sysutils;
|
||||
var
|
||||
ExecutableName: String;
|
||||
begin
|
||||
if 3600*24*(now()-FileDateToDateTime(FileAge(paramstr(0))))>7200 then
|
||||
ExecutableName:=ExpandFileName(paramstr(0));
|
||||
if 3600*24*(now()-FileDateToDateTime(FileAge(ExecutableName)))>7200 then
|
||||
begin
|
||||
writeln('FileAge returns: ',FileDateToDateTime(FileAge(paramstr(0))));
|
||||
writeln('Compilation time and run time differ too much, SysUtils.FileAge buggy?');
|
||||
writeln('FileAge returns: ',FileDateToDateTime(FileAge(ExecutableName)));
|
||||
writeln('Executable file time and run time differ too much, SysUtils.FileAge buggy?');
|
||||
halt(1);
|
||||
end;
|
||||
|
||||
{ test with relative path }
|
||||
if 3600*24*(now()-FileDateToDateTime(FileAge(ExtractRelativePath(GetCurrentDir+DirectorySeparator,paramstr(0)))))>7200 then
|
||||
if 3600*24*(now()-FileDateToDateTime(FileAge(ExtractRelativePath(GetCurrentDir+DirectorySeparator,ExecutableName))))>7200 then
|
||||
begin
|
||||
writeln('FileAge returns: ',FileDateToDateTime(FileAge(paramstr(0))));
|
||||
writeln('Compilation time and run time differ too much, SysUtils.FileAge buggy?');
|
||||
writeln('FileAge returns: ',FileDateToDateTime(FileAge(ExecutableName)));
|
||||
writeln('Executable file time (relative path) and run time differ too much, SysUtils.FileAge buggy?');
|
||||
halt(1);
|
||||
end;
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user