forked from brave/brave-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
41 lines (31 loc) · 928 Bytes
/
test.js
File metadata and controls
41 lines (31 loc) · 928 Bytes
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
const path = require('path')
const config = require('../lib/config')
const util = require('../lib/util')
const test = (suite, buildConfig = config.defaultBuildConfig, options) => {
config.buildConfig = buildConfig
config.update(options)
const braveArgs = [
'--enable-logging',
'--v=' + options.v,
]
if (options.filter) {
braveArgs.push('--gtest_filter=' + options.filter)
}
if (options.disable_brave_extension) {
braveArgs.push('--disable-brave-extension')
}
if (options.single_process) {
braveArgs.push('--single_process')
}
// Build the tests
util.run('ninja', ['-C', config.outputDir, suite], config.defaultOptions)
let testBinary;
if (process.platform === 'win32') {
testBinary = `${suite}.exe`
} else {
testBinary = suite
}
// Run the tests
util.run(path.join(config.outputDir, testBinary), braveArgs, config.defaultOptions)
}
module.exports = test