Skip to content

Commit 31f98d7

Browse files
legendecasaduh95
authored andcommitted
test: search cctest files
To prevent a new cctest missing from the `node.gyp`, search cctest files with tool `search_files.py` at configure time. PR-URL: #56791 Refs: #55275 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 267f17d commit 31f98d7

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

node.gyp

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -401,26 +401,8 @@
401401
],
402402
'node_cctest_sources': [
403403
'src/node_snapshot_stub.cc',
404-
'test/cctest/node_test_fixture.cc',
405-
'test/cctest/node_test_fixture.h',
406-
'test/cctest/test_aliased_buffer.cc',
407-
'test/cctest/test_base64.cc',
408-
'test/cctest/test_base_object_ptr.cc',
409-
'test/cctest/test_cppgc.cc',
410-
'test/cctest/test_node_postmortem_metadata.cc',
411-
'test/cctest/test_node_task_runner.cc',
412-
'test/cctest/test_environment.cc',
413-
'test/cctest/test_linked_binding.cc',
414-
'test/cctest/test_node_api.cc',
415-
'test/cctest/test_path.cc',
416-
'test/cctest/test_per_process.cc',
417-
'test/cctest/test_platform.cc',
418-
'test/cctest/test_report.cc',
419-
'test/cctest/test_json_utils.cc',
420-
'test/cctest/test_sockaddr.cc',
421-
'test/cctest/test_traced_value.cc',
422-
'test/cctest/test_util.cc',
423-
'test/cctest/test_dataqueue.cc',
404+
'<!@(<(python) tools/search_files.py . test/cctest cc)',
405+
'<!@(<(python) tools/search_files.py . test/cctest h)',
424406
],
425407
'node_cctest_openssl_sources': [
426408
'test/cctest/test_crypto_clienthello.cc',
@@ -1213,13 +1195,13 @@
12131195
'dependencies': [
12141196
'deps/ncrypto/ncrypto.gyp:ncrypto',
12151197
],
1216-
'sources': [ '<@(node_cctest_openssl_sources)' ],
1198+
}, {
1199+
'sources!': [ '<@(node_cctest_openssl_sources)' ],
12171200
}],
12181201
['v8_enable_inspector==1', {
12191202
'defines': [
12201203
'HAVE_INSPECTOR=1',
12211204
],
1222-
'sources': [ '<@(node_cctest_inspector_sources)' ],
12231205
'include_dirs': [
12241206
# TODO(legendecas): make node_inspector.gypi a dependable target.
12251207
'<(SHARED_INTERMEDIATE_DIR)', # for inspector
@@ -1231,7 +1213,8 @@
12311213
}, {
12321214
'defines': [
12331215
'HAVE_INSPECTOR=0',
1234-
]
1216+
],
1217+
'sources!': [ '<@(node_cctest_inspector_sources)' ],
12351218
}],
12361219
['OS=="solaris"', {
12371220
'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ]

tools/search_files.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
try:
1515
files = SearchFiles(*sys.argv[2:])
1616
files = [ os.path.relpath(x, sys.argv[1]) for x in files ]
17+
# Apply the same transform in SearchFiles after relpath
18+
if sys.platform == 'win32':
19+
files = [ x.replace('\\', '/') for x in files ]
1720
print('\n'.join(files))
1821
except Exception as e:
1922
print(str(e))

0 commit comments

Comments
 (0)