Skip to content

Commit

Permalink
test: search cctest files
Browse files Browse the repository at this point in the history
To prevent a new cctest missing from the `node.gyp`, search cctest
files with tool `search_files.py` at configure time.
  • Loading branch information
legendecas committed Jan 29, 2025
1 parent 346e81b commit c639e65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
29 changes: 6 additions & 23 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -402,26 +402,8 @@
],
'node_cctest_sources': [
'src/node_snapshot_stub.cc',
'test/cctest/node_test_fixture.cc',
'test/cctest/node_test_fixture.h',
'test/cctest/test_aliased_buffer.cc',
'test/cctest/test_base64.cc',
'test/cctest/test_base_object_ptr.cc',
'test/cctest/test_cppgc.cc',
'test/cctest/test_node_postmortem_metadata.cc',
'test/cctest/test_node_task_runner.cc',
'test/cctest/test_environment.cc',
'test/cctest/test_linked_binding.cc',
'test/cctest/test_node_api.cc',
'test/cctest/test_path.cc',
'test/cctest/test_per_process.cc',
'test/cctest/test_platform.cc',
'test/cctest/test_report.cc',
'test/cctest/test_json_utils.cc',
'test/cctest/test_sockaddr.cc',
'test/cctest/test_traced_value.cc',
'test/cctest/test_util.cc',
'test/cctest/test_dataqueue.cc',
'<!@(<(python) tools/search_files.py . test/cctest cc)',
'<!@(<(python) tools/search_files.py . test/cctest h)',
],
'node_cctest_openssl_sources': [
'test/cctest/test_crypto_clienthello.cc',
Expand Down Expand Up @@ -1204,13 +1186,13 @@
'dependencies': [
'deps/ncrypto/ncrypto.gyp:ncrypto',
],
'sources': [ '<@(node_cctest_openssl_sources)' ],
}, {
'sources!': [ '<@(node_cctest_openssl_sources)' ],
}],
['v8_enable_inspector==1', {
'defines': [
'HAVE_INSPECTOR=1',
],
'sources': [ '<@(node_cctest_inspector_sources)' ],
'include_dirs': [
# TODO(legendecas): make node_inspector.gypi a dependable target.
'<(SHARED_INTERMEDIATE_DIR)', # for inspector
Expand All @@ -1222,7 +1204,8 @@
}, {
'defines': [
'HAVE_INSPECTOR=0',
]
],
'sources!': [ '<@(node_cctest_inspector_sources)' ],
}],
['OS=="solaris"', {
'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ]
Expand Down
3 changes: 3 additions & 0 deletions tools/search_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
try:
files = SearchFiles(*sys.argv[2:])
files = [ os.path.relpath(x, sys.argv[1]) for x in files ]
# Apply the same transform in SearchFiles after relpath
if sys.platform == 'win32':
files = [ x.replace('\\', '/') for x in files ]
print('\n'.join(files))
except Exception as e:
print(str(e))
Expand Down

0 comments on commit c639e65

Please sign in to comment.