22
22
time_sensitve_test_flag = '--gtest_filter="-*TimeSensitiveTest*"'
23
23
24
24
def IsMac ():
25
- sys .platform == 'darwin'
25
+ return sys .platform == 'darwin'
26
26
27
27
28
28
def IsLinux ():
29
- sys .platform .startswith ('linux' )
29
+ return sys .platform .startswith ('linux' )
30
30
31
31
32
32
def IsWindows ():
33
- sys .platform .startswith (('cygwin' , 'win' ))
33
+ return sys .platform .startswith (('cygwin' , 'win' ))
34
+
35
+
36
+ def ExecutableSuffix ():
37
+ return '.exe' if IsWindows () else ''
38
+
39
+ def FindExecutablePath (path ):
40
+ if os .path .exists (path ):
41
+ return path
42
+
43
+ if IsWindows ():
44
+ exe_path = path + '.exe'
45
+ if os .path .exists (exe_path ):
46
+ return exe_path
47
+
48
+ bat_path = path + '.bat'
49
+ if os .path .exists (bat_path ):
50
+ return bat_path
51
+
52
+ raise Exception ('Executable %s does not exist!' % path )
34
53
35
54
36
55
def RunEngineExecutable (build_dir , executable_name , filter , flags = [], cwd = buildroot_dir ):
37
56
if not filter in executable_name :
38
57
print 'Skipping %s due to filter.' % executable_name
39
58
return
40
59
41
- print 'Running %s in %s' % (executable_name , cwd )
42
-
43
- executable = os .path .join (build_dir , executable_name )
44
- assert os .path .exists (executable ), '%s does not exist!' % executable
60
+ executable = FindExecutablePath (os .path .join (build_dir , executable_name ))
45
61
62
+ print 'Running %s in %s' % (executable_name , cwd )
46
63
test_command = [ executable ] + flags
47
- print ' ' .join (test_command )
48
-
64
+ print ' ' .join (test_command )
49
65
subprocess .check_call (test_command , cwd = cwd )
50
66
51
67
52
68
def RunCCTests (build_dir , filter ):
53
- print "Running Engine Unit-tests."
69
+ print "Running Engine Unit-tests."
54
70
55
71
RunEngineExecutable (build_dir , 'client_wrapper_glfw_unittests' , filter )
56
72
57
73
RunEngineExecutable (build_dir , 'client_wrapper_unittests' , filter )
58
74
59
- RunEngineExecutable (build_dir , 'embedder_unittests' , filter )
75
+ # https://github.com/flutter/flutter/issues/36294
76
+ if not IsWindows ():
77
+ RunEngineExecutable (build_dir , 'embedder_unittests' , filter )
60
78
61
79
RunEngineExecutable (build_dir , 'flow_unittests' , filter )
62
80
63
81
RunEngineExecutable (build_dir , 'fml_unittests' , filter , [ time_sensitve_test_flag ])
64
82
65
83
RunEngineExecutable (build_dir , 'runtime_unittests' , filter )
66
84
67
- RunEngineExecutable (build_dir , 'shell_unittests' , filter )
85
+ # https://github.com/flutter/flutter/issues/36295
86
+ if not IsWindows ():
87
+ RunEngineExecutable (build_dir , 'shell_unittests' , filter )
68
88
69
89
RunEngineExecutable (build_dir , 'ui_unittests' , filter )
70
90
91
+ # These unit-tests are Objective-C and can only run on Darwin.
71
92
if IsMac ():
72
93
RunEngineExecutable (build_dir , 'flutter_channels_unittests' , filter )
73
94
95
+ # https://github.com/flutter/flutter/issues/36296
74
96
if IsLinux ():
75
97
RunEngineExecutable (build_dir , 'txt_unittests' , filter , [ fonts_dir_flag ])
76
98
@@ -146,7 +168,7 @@ def EnsureDebugUnoptSkyPackagesAreBuilt():
146
168
variant_out_dir = os .path .join (out_dir , 'host_debug_unopt' )
147
169
148
170
ninja_command = [
149
- 'autoninja ' ,
171
+ 'ninja ' ,
150
172
'-C' ,
151
173
variant_out_dir ,
152
174
'flutter/sky/packages'
@@ -176,7 +198,7 @@ def RunDartTests(build_dir, filter):
176
198
EnsureDebugUnoptSkyPackagesAreBuilt ();
177
199
178
200
# Now that we have the Sky packages at the hardcoded location, run `pub get`.
179
- RunPubGet (build_dir , dart_tests_dir )
201
+ RunEngineExecutable (build_dir , os . path . join ( 'dart-sdk' , 'bin' , 'pub' ), '' , flags = [ 'get' ], cwd = dart_tests_dir )
180
202
181
203
dart_tests = glob .glob ('%s/*.dart' % dart_tests_dir )
182
204
@@ -192,10 +214,12 @@ def RunTests(build_dir, filter, run_engine_tests, run_dart_tests, run_benchmarks
192
214
if run_engine_tests :
193
215
RunCCTests (build_dir , filter )
194
216
195
- if run_dart_tests :
217
+ # https://github.com/flutter/flutter/issues/36301
218
+ if run_dart_tests and not IsWindows ():
196
219
RunDartTests (build_dir , filter )
197
220
198
- if run_benchmarks :
221
+ # https://github.com/flutter/flutter/issues/36300
222
+ if run_benchmarks and not IsWindows ():
199
223
RunEngineBenchmarks (build_dir , filter )
200
224
201
225
0 commit comments