Skip to content

Commit

Permalink
build: enable cctest to use generated objects
Browse files Browse the repository at this point in the history
This commit tries to make it simpler to add unit tests (cctest) for
code that needs to test node core funtionality but that might not be
appropriate as an addon or a JavaScript test. An example of this could
be adding functionality targeted for situations when Node itself is
embedded.

Currently it was not as easy, or efficient, as one would have hoped to
add such tests. The object output directories vary for different
operating systems which we need to link to so that we don't have an
additional compilation step.

PR-URL: #11956
Backport-PR-URL: #12948
Ref: #9163
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev authored and MylesBorins committed Jul 11, 2017
1 parent d5d9d9d commit 3bb117e
Show file tree
Hide file tree
Showing 7 changed files with 507 additions and 352 deletions.
17 changes: 13 additions & 4 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,25 @@
['OS == "win"', {
'os_posix': 0,
'v8_postmortem_support%': 'false',
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/lib/v8_libbase.lib',
}, {
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
['GENERATOR == "ninja" or OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
['OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
'conditions': [
['GENERATOR=="ninja"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/tools/gyp/libv8_base.a',
}, {
'OBJ_DIR%': '<(PRODUCT_DIR)/obj.target',
'V8_BASE%': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
}],
],
}],
['openssl_fips != ""', {
'OPENSSL_PRODUCT': 'libcrypto.a',
Expand Down
Loading

0 comments on commit 3bb117e

Please sign in to comment.