mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 22:43:26 +00:00

PR-URL: https://github.com/nodejs/node/pull/40554 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
38 lines
1013 B
JavaScript
38 lines
1013 B
JavaScript
'use strict'
|
|
|
|
const { test } = require('tap')
|
|
const gyp = require('../lib/node-gyp')
|
|
const createConfigGypi = require('../lib/create-config-gypi')
|
|
const { getCurrentConfigGypi } = createConfigGypi.test
|
|
|
|
test('config.gypi with no options', function (t) {
|
|
t.plan(2)
|
|
|
|
const prog = gyp()
|
|
prog.parseArgv([])
|
|
|
|
const config = getCurrentConfigGypi({ gyp: prog, vsInfo: {} })
|
|
t.equal(config.target_defaults.default_configuration, 'Release')
|
|
t.equal(config.variables.target_arch, process.arch)
|
|
})
|
|
|
|
test('config.gypi with --debug', function (t) {
|
|
t.plan(1)
|
|
|
|
const prog = gyp()
|
|
prog.parseArgv(['_', '_', '--debug'])
|
|
|
|
const config = getCurrentConfigGypi({ gyp: prog, vsInfo: {} })
|
|
t.equal(config.target_defaults.default_configuration, 'Debug')
|
|
})
|
|
|
|
test('config.gypi with custom options', function (t) {
|
|
t.plan(1)
|
|
|
|
const prog = gyp()
|
|
prog.parseArgv(['_', '_', '--shared-libxml2'])
|
|
|
|
const config = getCurrentConfigGypi({ gyp: prog, vsInfo: {} })
|
|
t.equal(config.variables.shared_libxml2, true)
|
|
})
|