From 359b82da432bdfcd9e3b5d04e84f51a3e6fe0cdc Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Fri, 1 Apr 2022 17:14:56 +0000 Subject: [PATCH] dawn.node: Make run-cts disable disallow_unsafe_apis Bug: dawn:1123 Change-Id: I2696dedf8249f5cfd8fe0138b7ee43e567a4ddf5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85504 Reviewed-by: Ben Clayton Commit-Queue: Corentin Wallez --- src/dawn/node/tools/src/cmd/run-cts/main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/dawn/node/tools/src/cmd/run-cts/main.go b/src/dawn/node/tools/src/cmd/run-cts/main.go index 5d6e1ed929..d20294b98f 100644 --- a/src/dawn/node/tools/src/cmd/run-cts/main.go +++ b/src/dawn/node/tools/src/cmd/run-cts/main.go @@ -199,11 +199,24 @@ func run() error { } } + // Forward the backend to use, if specified. if backend != "default" { fmt.Println("Forcing backend to", backend) flags = append(flags, fmt.Sprint("dawn-backend=", backend)) } + // While running the CTS, always allow unsafe APIs so they can be tested. + disableDawnFeaturesFound := false + for i, flag := range flags { + if strings.HasPrefix(flag, "disable-dawn-features=") { + flags[i] = flag + ",disallow_unsafe_apis" + disableDawnFeaturesFound = true + } + } + if !disableDawnFeaturesFound { + flags = append(flags, "disable-dawn-features=disallow_unsafe_apis") + } + r := runner{ numRunners: numRunners, verbose: verbose,