summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/wpt.ts16
-rw-r--r--tools/wpt/certs/index.txt0
-rw-r--r--tools/wpt/certs/serial1
-rw-r--r--tools/wpt/config.json7
-rw-r--r--tools/wpt/utils.ts1
5 files changed, 10 insertions, 15 deletions
diff --git a/tools/wpt.ts b/tools/wpt.ts
index 8f8248880..4a4d8cb58 100755
--- a/tools/wpt.ts
+++ b/tools/wpt.ts
@@ -80,27 +80,27 @@ More details at https://deno.land/manual@main/contributing/web_platform_tests
}
async function setup() {
+ const hostsPath = Deno.build.os == "windows"
+ ? `${Deno.env.get("SystemRoot")}\\System32\\drivers\\etc\\hosts`
+ : "/etc/hosts";
// TODO(lucacsonato): use this when 1.7.1 is released.
// const records = await Deno.resolveDns("web-platform.test", "A");
// const etcHostsConfigured = records[0] == "127.0.0.1";
- const hostsFile = await Deno.readTextFile("/etc/hosts");
+ const hostsFile = await Deno.readTextFile(hostsPath);
const etcHostsConfigured = hostsFile.includes("web-platform.test");
if (etcHostsConfigured) {
- console.log("/etc/hosts is already configured.");
+ console.log(hostsPath + " is already configured.");
} else {
const autoConfigure = autoConfig ||
confirm(
- "The WPT require certain entries to be present in your /etc/hosts file. Should these be configured automatically?",
+ `The WPT require certain entries to be present in your ${hostsPath} file. Should these be configured automatically?`,
);
if (autoConfigure) {
const proc = runPy(["wpt", "make-hosts-file"], { stdout: "piped" });
const status = await proc.status();
assert(status.success, "wpt make-hosts-file should not fail");
const entries = new TextDecoder().decode(await proc.output());
- const hostsPath = Deno.build.os == "windows"
- ? `${Deno.env.get("SystemRoot")}\\System32\\drivers\\etc\\hosts`
- : "/etc/hosts";
const file = await Deno.open(hostsPath, { append: true }).catch((err) => {
if (err instanceof Deno.errors.PermissionDenied) {
throw new Error(
@@ -116,9 +116,9 @@ async function setup() {
"\n\n# Configured for Web Platform Tests (Deno)\n" + entries,
),
);
- console.log("Updated /etc/hosts");
+ console.log(`Updated ${hostsPath}`);
} else {
- console.log("Please configure the /etc/hosts entries manually.");
+ console.log(`Please configure the ${hostsPath} entries manually.`);
if (Deno.build.os == "windows") {
console.log("To do this run the following command in PowerShell:");
console.log("");
diff --git a/tools/wpt/certs/index.txt b/tools/wpt/certs/index.txt
deleted file mode 100644
index e69de29bb..000000000
--- a/tools/wpt/certs/index.txt
+++ /dev/null
diff --git a/tools/wpt/certs/serial b/tools/wpt/certs/serial
deleted file mode 100644
index e457acdd3..000000000
--- a/tools/wpt/certs/serial
+++ /dev/null
@@ -1 +0,0 @@
-026677 \ No newline at end of file
diff --git a/tools/wpt/config.json b/tools/wpt/config.json
index a27e0d15d..f146607c1 100644
--- a/tools/wpt/config.json
+++ b/tools/wpt/config.json
@@ -1,11 +1,6 @@
{
"check_subdomains": false,
"ssl": {
- "type": "openssl",
- "openssl": {
- "duration": 365,
- "force_regenerate": false,
- "base_path": "../../tools/wpt/certs"
- }
+ "type": "pregenerated"
}
}
diff --git a/tools/wpt/utils.ts b/tools/wpt/utils.ts
index 0eb9a89e7..f1c8488af 100644
--- a/tools/wpt/utils.ts
+++ b/tools/wpt/utils.ts
@@ -144,6 +144,7 @@ export async function checkPy3Available() {
}
export async function cargoBuild() {
+ if (binary) return;
const proc = Deno.run({
cmd: ["cargo", "build", ...(release ? ["--release"] : [])],
cwd: ROOT_PATH,