| ... | @@ -1224,10 +1224,6 @@ pub const TestContext = struct { | ... | @@ -1224,10 +1224,6 @@ pub const TestContext = struct { |
| 1224 | try aux_thread_pool.init(self.gpa); | 1224 | try aux_thread_pool.init(self.gpa); |
| 1225 | defer aux_thread_pool.deinit(); | 1225 | defer aux_thread_pool.deinit(); |
| 1226 | | 1226 | |
| 1227 | var case_thread_pool: ThreadPool = undefined; | | |
| 1228 | try case_thread_pool.init(self.gpa); | | |
| 1229 | defer case_thread_pool.deinit(); | | |
| 1230 | | | |
| 1231 | // Use the same global cache dir for all the tests, such that we for example don't have to | 1227 | // Use the same global cache dir for all the tests, such that we for example don't have to |
| 1232 | // rebuild musl libc for every case (when LLVM backend is enabled). | 1228 | // rebuild musl libc for every case (when LLVM backend is enabled). |
| 1233 | var global_tmp = std.testing.tmpDir(.{}); | 1229 | var global_tmp = std.testing.tmpDir(.{}); |
| ... | @@ -1245,9 +1241,6 @@ pub const TestContext = struct { | ... | @@ -1245,9 +1241,6 @@ pub const TestContext = struct { |
| 1245 | defer self.gpa.free(global_cache_directory.path.?); | 1241 | defer self.gpa.free(global_cache_directory.path.?); |
| 1246 | | 1242 | |
| 1247 | { | 1243 | { |
| 1248 | var wait_group: WaitGroup = .{}; | | |
| 1249 | defer wait_group.wait(); | | |
| 1250 | | | |
| 1251 | for (self.cases.items) |*case| { | 1244 | for (self.cases.items) |*case| { |
| 1252 | if (build_options.skip_non_native) { | 1245 | if (build_options.skip_non_native) { |
| 1253 | if (case.target.getCpuArch() != builtin.cpu.arch) | 1246 | if (case.target.getCpuArch() != builtin.cpu.arch) |
| ... | @@ -1267,17 +1260,19 @@ pub const TestContext = struct { | ... | @@ -1267,17 +1260,19 @@ pub const TestContext = struct { |
| 1267 | if (std.mem.indexOf(u8, case.name, test_filter) == null) continue; | 1260 | if (std.mem.indexOf(u8, case.name, test_filter) == null) continue; |
| 1268 | } | 1261 | } |
| 1269 | | 1262 | |
| 1270 | wait_group.start(); | 1263 | var prg_node = root_node.start(case.name, case.updates.items.len); |
| 1271 | try case_thread_pool.spawn(workerRunOneCase, .{ | 1264 | prg_node.activate(); |
| | 1265 | defer prg_node.end(); |
| | 1266 | |
| | 1267 | case.result = runOneCase( |
| 1272 | self.gpa, | 1268 | self.gpa, |
| 1273 | root_node, | 1269 | &prg_node, |
| 1274 | case, | 1270 | case.*, |
| 1275 | zig_lib_directory, | 1271 | zig_lib_directory, |
| 1276 | &aux_thread_pool, | 1272 | &aux_thread_pool, |
| 1277 | global_cache_directory, | 1273 | global_cache_directory, |
| 1278 | host, | 1274 | host, |
| 1279 | &wait_group, | 1275 | ); |
| 1280 | }); | | |
| 1281 | } | 1276 | } |
| 1282 | } | 1277 | } |
| 1283 | | 1278 | |
| ... | @@ -1295,33 +1290,6 @@ pub const TestContext = struct { | ... | @@ -1295,33 +1290,6 @@ pub const TestContext = struct { |
| 1295 | } | 1290 | } |
| 1296 | } | 1291 | } |
| 1297 | | 1292 | |
| 1298 | fn workerRunOneCase( | | |
| 1299 | gpa: Allocator, | | |
| 1300 | root_node: *std.Progress.Node, | | |
| 1301 | case: *Case, | | |
| 1302 | zig_lib_directory: Compilation.Directory, | | |
| 1303 | thread_pool: *ThreadPool, | | |
| 1304 | global_cache_directory: Compilation.Directory, | | |
| 1305 | host: std.zig.system.NativeTargetInfo, | | |
| 1306 | wait_group: *WaitGroup, | | |
| 1307 | ) void { | | |
| 1308 | defer wait_group.finish(); | | |
| 1309 | | | |
| 1310 | var prg_node = root_node.start(case.name, case.updates.items.len); | | |
| 1311 | prg_node.activate(); | | |
| 1312 | defer prg_node.end(); | | |
| 1313 | | | |
| 1314 | case.result = runOneCase( | | |
| 1315 | gpa, | | |
| 1316 | &prg_node, | | |
| 1317 | case.*, | | |
| 1318 | zig_lib_directory, | | |
| 1319 | thread_pool, | | |
| 1320 | global_cache_directory, | | |
| 1321 | host, | | |
| 1322 | ); | | |
| 1323 | } | | |
| 1324 | | | |
| 1325 | fn runOneCase( | 1293 | fn runOneCase( |
| 1326 | allocator: Allocator, | 1294 | allocator: Allocator, |
| 1327 | root_node: *std.Progress.Node, | 1295 | root_node: *std.Progress.Node, |