clone package table into custom test runner

Co-authored-by: Veikka Tuominen <git@vexu.eu>
This commit is contained in:
Dominic 2023-02-08 22:39:38 +11:00 committed by GitHub
parent edc0e84270
commit 948754c5d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1627,10 +1627,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
const pkg = try Package.create(gpa, "root", test_dir, basename);
// copy package table from main_pkg to root_pkg
var iter = main_pkg.table.valueIterator();
while (iter.next()) |v| {
try pkg.add(gpa, v.*);
}
pkg.table = try main_pkg.table.clone(gpa);
break :test_pkg pkg;
} else try Package.createWithDir(
gpa,