-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from aminya/windows [skip ci]
- Loading branch information
Showing
3 changed files
with
34 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,39 @@ | ||
import which from "which" | ||
import { setupMSVC } from "../msvc" | ||
import { runnerWindowsVersion } from "../../utils/tests/test-helpers" | ||
import { warning } from "ci-log" | ||
|
||
jest.setTimeout(300000) | ||
describe("setup-msvc", () => { | ||
const isWindows = process.platform === "win32" | ||
|
||
it("should setup the pre-installed msvc", async () => { | ||
try { | ||
if (process.platform !== "win32") { | ||
if (!isWindows) { | ||
return | ||
} | ||
await setupMSVC("", "", process.arch) | ||
console.log(which.sync("cl")) | ||
} catch (e) { | ||
// TODO | ||
console.error(e) | ||
} | ||
}) | ||
|
||
it("should setup msvc 2022", async () => { | ||
try { | ||
if (process.platform !== "win32") { | ||
return | ||
} | ||
await setupMSVC("2022", "", process.arch) | ||
console.log(which.sync("cl")) | ||
} catch (e) { | ||
// TODO | ||
console.error(e) | ||
} | ||
}) | ||
|
||
it("should setup msvc 2019", async () => { | ||
try { | ||
if (process.platform !== "win32") { | ||
return | ||
} catch (err) { | ||
if ("toString" in (err as any)) { | ||
warning((err as any).toString()) | ||
} | ||
await setupMSVC("2019", "", process.arch) | ||
console.log(which.sync("cl")) | ||
} catch (e) { | ||
// TODO | ||
console.error(e) | ||
} | ||
}) | ||
|
||
it("should setup msvc 2017", async () => { | ||
try { | ||
if (process.platform !== "win32") { | ||
for (const version of [2022, 2019, 2017, 2015]) { | ||
it(`should setup msvc ${version}`, async () => { | ||
if (!isWindows || (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version)) { | ||
return | ||
} | ||
await setupMSVC("2017", "", process.arch) | ||
console.log(which.sync("cl")) | ||
} catch (e) { | ||
// TODO | ||
console.error(e) | ||
} | ||
}) | ||
|
||
it("should setup msvc 2015", async () => { | ||
try { | ||
if (process.platform !== "win32") { | ||
return | ||
try { | ||
await setupMSVC(`${version}`, "", process.arch) | ||
console.log(which.sync("cl")) | ||
} catch (err) { | ||
if ("toString" in (err as any)) { | ||
warning((err as any).toString()) | ||
} | ||
} | ||
await setupMSVC("2015", "", process.arch) | ||
console.log(which.sync("cl")) | ||
} catch (e) { | ||
// TODO | ||
console.error(e) | ||
} | ||
}) | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters