11
11
var TestSuiteDir: string;
12
12
var PathSeparator: string := Path.DirectorySeparatorChar;
13
13
14
+ function IsUnix : boolean;
15
+ begin
16
+ Result := (System.Environment.OSVersion.Platform = System.PlatformID.Unix) or (System.Environment.OSVersion.Platform = System.PlatformID.MacOSX);
17
+ end ;
18
+
14
19
function GetTestSuiteDir : string;
15
20
begin
16
21
var dir := Path.GetDirectoryName(GetEXEFileName());
@@ -32,6 +37,9 @@ procedure CompileErrorTests(withide: boolean);
32
37
var files := Directory.GetFiles(TestSuiteDir+PathSeparator+' errors' ,' *.pas' );
33
38
for var i := 0 to files.Length - 1 do
34
39
begin
40
+ var content := &File .ReadAllText(files[i]);
41
+ if content.StartsWith(' //winonly' ) and IsUnix then
42
+ continue;
35
43
var co: CompilerOptions := new CompilerOptions(files[i],CompilerOptions.OutputType.ConsoleApplicaton);
36
44
co.Debug := true;
37
45
co.OutputDirectory := TestSuiteDir+PathSeparator+' errors' ;
@@ -63,6 +71,9 @@ procedure CompileAllRunTests(withdll: boolean; only32bit: boolean := false);
63
71
var files := Directory.GetFiles(TestSuiteDir,' *.pas' );
64
72
for var i := 0 to files.Length - 1 do
65
73
begin
74
+ var content := &File .ReadAllText(files[i]);
75
+ if content.StartsWith(' //winonly' ) and IsUnix then
76
+ continue;
66
77
var co: CompilerOptions := new CompilerOptions(files[i],CompilerOptions.OutputType.ConsoleApplicaton);
67
78
co.Debug := true;
68
79
co.OutputDirectory := TestSuiteDir+PathSeparator+' exe' ;
@@ -91,6 +102,9 @@ procedure CompileAllCompilationTests(dir: string; withdll: boolean);
91
102
var files := Directory.GetFiles(TestSuiteDir+PathSeparator+dir,' *.pas' );
92
103
for var i := 0 to files.Length - 1 do
93
104
begin
105
+ var content := &File .ReadAllText(files[i]);
106
+ if content.StartsWith(' //winonly' ) and IsUnix then
107
+ continue;
94
108
var co: CompilerOptions := new CompilerOptions(files[i],CompilerOptions.OutputType.ConsoleApplicaton);
95
109
co.Debug := true;
96
110
co.OutputDirectory := TestSuiteDir+PathSeparator+dir;
@@ -117,6 +131,9 @@ procedure CompileAllUnits;
117
131
var dir := TestSuiteDir+PathSeparator+' units' +PathSeparator;
118
132
for var i := 0 to files.Length - 1 do
119
133
begin
134
+ var content := &File .ReadAllText(files[i]);
135
+ if content.StartsWith(' //winonly' ) and IsUnix then
136
+ continue;
120
137
var co: CompilerOptions := new CompilerOptions(files[i],CompilerOptions.OutputType.ConsoleApplicaton);
121
138
co.Debug := true;
122
139
co.OutputDirectory := dir;
@@ -142,6 +159,9 @@ procedure CompileAllUsesUnits;
142
159
var files := Directory.GetFiles(TestSuiteDir+PathSeparator+' usesunits' ,' *.pas' );
143
160
for var i := 0 to files.Length - 1 do
144
161
begin
162
+ var content := &File .ReadAllText(files[i]);
163
+ if content.StartsWith(' //winonly' ) and IsUnix then
164
+ continue;
145
165
var co: CompilerOptions := new CompilerOptions(files[i],CompilerOptions.OutputType.ConsoleApplicaton);
146
166
co.Debug := true;
147
167
co.OutputDirectory := TestSuiteDir+PathSeparator+' exe' ;
0 commit comments