forked from sass/sass-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsass-spec.ts
46 lines (40 loc) · 1.32 KB
/
sass-spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { fromPath } from "./lib-js/spec-directory"
import { Interactor } from "./lib-js/interactor"
import { parseArgs } from "./lib-js/cli-args"
import TestCase from "./lib-js/test-case"
import Tabulator from "./lib-js/tabulator"
// FIXME These files contain invalid utf8 sequences and fail the dart compiler right now
const naughtyDirs = [
"spec/libsass-todo-issues/issue_221267",
"spec/libsass-todo-issues/issue_221286",
]
async function runAllTests() {
const interactor = new Interactor(process.stdin, process.stdout)
const start = Date.now()
const args = await parseArgs(process.argv.slice(2))
const rootPath = args.root
const rootDir = await fromPath(rootPath)
const tabulator = new Tabulator(process.stdout, args.verbose)
await rootDir.forEachTest(args.testDirs, async (testDir) => {
if (naughtyDirs.includes(testDir.relPath())) {
return
}
const test = await TestCase.create(
testDir,
args.impl,
args.compiler,
args.todoMode
)
if (test.result().type === "fail" && args.interactive) {
await interactor.prompt(test)
}
tabulator.tabulate(test)
})
const end = Date.now()
const time = (end - start) / 1000
tabulator.printResults()
console.log(`Finished in ${time}s`)
process.exitCode = tabulator.exitCode()
args.compiler.shutdown()
}
runAllTests()