-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_script.pas
More file actions
47 lines (39 loc) · 1.11 KB
/
Copy pathtest_script.pas
File metadata and controls
47 lines (39 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
program test_heather;
var
Cwd: string;
OutputText: string;
ExitCode: Integer;
begin
Print('--- HEATHER Engine Test ---');
// Test GetCwd
Cwd := GetCwd();
Print('Current Working Directory: ' + Cwd);
// Test GetEnv
Print('OS Environment Variable: ' + GetEnv('OS'));
// Test ExecOut
Print('Running "cmd /c echo Hello from cmd"...');
OutputText := ExecOut('cmd /c echo Hello from cmd');
Print('ExecOut Result: ' + OutputText);
// Test MakeDirs and FileExists
Print('Creating test_dir...');
MakeDirs('test_dir');
if DirExists('test_dir') then
Print('test_dir successfully created!')
else
Print('Failed to create test_dir.');
// Test Exec
Print('Running "cmd /c dir" (Exec)...');
ExitCode := Exec('cmd /c dir test_dir');
if ExitCode = 0 then
Print('Exec exit code: 0')
else
Print('Exec exit code: non-zero');
// Clean up
Print('Cleaning up test_dir...');
RemoveDirTree('test_dir');
if not DirExists('test_dir') then
Print('test_dir successfully removed.')
else
Print('Failed to remove test_dir.');
Print('--- Test Complete ---');
end.