Meta: Properly handle GN unit tests which define their own deps

If a unit tests defines a `deps` array, the unit test template would
have tried to overwrite it (and it is actually an error to overwrite
a non-empty list with another non-empty list).
This commit is contained in:
Timothy Flynn 2023-11-16 12:25:58 -05:00 committed by Andrew Kaster
parent 6a73e027a0
commit b65c07082b

View file

@ -8,7 +8,11 @@ template("unittest") {
assert(!defined(invoker.output_dir), "cannot set unittest output_dir")
assert(!defined(invoker.testonly), "cannot set unittest testonly")
deps = [ "//AK" ]
if (!defined(invoker.deps)) {
deps = []
}
deps += [ "//AK" ]
if (has_custom_main) {
deps += [ "//Userland/Libraries/LibTest" ]
} else if (use_js_main) {