GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — TypeScript/scripts/bisect-test.ts at master · bb/TypeScript

Expand file tree

/

bisect-test.ts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
56 lines (51 loc) · 2.14 KB
/

bisect-test.ts

Copy path

File metadata and controls

56 lines (51 loc) · 2.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
47
48
49
50
51
52
53
54
55
56
/// <reference path="..\src\harness\external\node.d.ts" />
import cp = require('child_process');
import fs = require('fs');
// Slice off 'node bisect-test.js' from the commandline args
var args = process.argv.slice(2);
function tsc(tscArgs: string, onExit: (exitCode: number) => void) {
var tsc = cp.exec('node built/local/tsc.js ' + tscArgs,() => void 0);
tsc.on('close', tscExitCode => {
onExit(tscExitCode);
});
}
var jake = cp.exec('jake clean local', () => void 0);
jake.on('close', jakeExitCode => {
if (jakeExitCode === 0) {
// See what we're being asked to do
if (args[1] === 'compiles' || args[1] === '!compiles') {
tsc(args[0], tscExitCode => {
if ((tscExitCode === 0) === (args[1] === 'compiles')) {
console.log('Good');
process.exit(0); // Good
} else {
console.log('Bad');
process.exit(1); // Bad
}
});
} else if (args[1] === 'emits' || args[1] === '!emits') {
tsc(args[0], tscExitCode => {
fs.readFile(args[2], 'utf-8', (err, data) => {
var doesContains = data.indexOf(args[3]) >= 0;
if (doesContains === (args[1] === 'emits')) {
console.log('Good');
process.exit(0); // Good
} else {
console.log('Bad');
process.exit(1); // Bad
}
});
});
} else {
console.log('Unknown command line arguments.');
console.log('Usage (compile errors): git bisect run scripts\bisect.js "foo.ts --module amd" compiles');
console.log('Usage (emit check): git bisect run scripts\bisect.js bar.ts emits bar.js "_this = this"');
// Aborts the 'git bisect run' process
process.exit(-1);
}
} else {
// Compiler build failed; skip this commit
console.log('Skip');
process.exit(125); // bisect skip
}
});
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.