summaryrefslogtreecommitdiff
path: root/tools/wpt/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/wpt/utils.ts')
-rw-r--r--tools/wpt/utils.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/wpt/utils.ts b/tools/wpt/utils.ts
index c77effa62..7614a0c55 100644
--- a/tools/wpt/utils.ts
+++ b/tools/wpt/utils.ts
@@ -118,18 +118,18 @@ export function assert(condition: unknown, message: string): asserts condition {
}
}
-export function runPy<T extends Omit<Deno.SpawnOptions, "cwd">>(
+export function runPy<T extends Omit<Deno.CommandOptions, "cwd">>(
args: string[],
options: T,
-): Deno.Child<T> {
+): Deno.ChildProcess {
const cmd = Deno.build.os == "windows" ? "python.exe" : "python3";
- return Deno.spawnChild(cmd, {
+ return new Deno.Command(cmd, {
args,
stdout: "inherit",
stderr: "inherit",
...options,
cwd: join(ROOT_PATH, "./test_util/wpt/"),
- });
+ }).spawn();
}
export async function checkPy3Available() {
@@ -148,12 +148,12 @@ export async function checkPy3Available() {
export async function cargoBuild() {
if (binary) return;
- const { success } = await Deno.spawn("cargo", {
+ const { success } = await new Deno.Command("cargo", {
args: ["build", ...(release ? ["--release"] : [])],
cwd: ROOT_PATH,
stdout: "inherit",
stderr: "inherit",
- });
+ }).output();
assert(success, "cargo build failed");
}
@@ -175,16 +175,16 @@ export async function generateRunInfo(): Promise<unknown> {
"darwin": "mac",
"linux": "linux",
};
- const proc = await Deno.spawn("git", {
+ const proc = await new Deno.Command("git", {
args: ["rev-parse", "HEAD"],
cwd: join(ROOT_PATH, "test_util", "wpt"),
stderr: "inherit",
- });
+ }).output();
const revision = (new TextDecoder().decode(proc.stdout)).trim();
- const proc2 = await Deno.spawn(denoBinary(), {
+ const proc2 = await new Deno.Command(denoBinary(), {
args: ["eval", "console.log(JSON.stringify(Deno.version))"],
cwd: join(ROOT_PATH, "test_util", "wpt"),
- });
+ }).output();
const version = JSON.parse(new TextDecoder().decode(proc2.stdout));
const runInfo = {
"os": oses[Deno.build.os],