Skip to content

Commit f7406aa

Browse files
targosRafaelGSS
authored andcommitted
test: update test-linux-perf-logger
New V8 version includes more information about regular expressions. PR-URL: #58070 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
1 parent c7493fa commit f7406aa

File tree

1 file changed

+29
-17
lines changed

1 file changed

+29
-17
lines changed

test/v8-updates/test-linux-perf-logger.js

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,54 @@ const testCases = [
4444
title: '--perf-basic-prof interpreted',
4545
nodeFlags: ['--perf-basic-prof', '--no-turbo-inlining', '--no-opt'],
4646
matches: [
47-
'~functionOne .+/linux-perf-logger.js',
48-
'~functionTwo .+/linux-perf-logger.js',
49-
'test-regex',
47+
'JS:~functionOne .+/linux-perf-logger.js',
48+
'JS:~functionTwo .+/linux-perf-logger.js',
49+
String.raw`RegExp\.> src: 'test-regex' flags: 'gi'`,
50+
],
51+
noMatches: [
52+
String.raw`JS:\*'functionOne`,
53+
String.raw`JS:\*'functionTwo`,
5054
],
51-
noMatches: ['\\*functionOne', '\\*functionTwo'],
5255
},
5356
{
5457
title: '--perf-basic-prof compiled',
5558
nodeFlags: ['--perf-basic-prof', '--no-turbo-inlining', '--always-turbofan',
5659
'--minimum-invocations-before-optimization=0'],
5760
matches: [
58-
'test-regex',
59-
'~functionOne .+/linux-perf-logger.js',
60-
'~functionTwo .+/linux-perf-logger.js',
61-
'\\*functionOne .+/linux-perf-logger.js',
62-
'\\*functionTwo .+/linux-perf-logger.js',
61+
String.raw`RegExp\.> src: 'test-regex' flags: 'gi'`,
62+
'JS:~functionOne .+/linux-perf-logger.js',
63+
'JS:~functionTwo .+/linux-perf-logger.js',
64+
String.raw`JS:\*'functionOne .+/linux-perf-logger.js`,
65+
String.raw`JS:\*'functionTwo .+/linux-perf-logger.js`,
6366
],
6467
noMatches: [],
6568
},
6669
{
6770
title: '--perf-basic-prof-only-functions interpreted',
6871
nodeFlags: ['--perf-basic-prof-only-functions', '--no-turbo-inlining', '--no-opt'],
69-
matches: ['~functionOne .+/linux-perf-logger.js', '~functionTwo .+/linux-perf-logger.js'],
70-
noMatches: ['\\*functionOne', '\\*functionTwo', 'test-regex'],
72+
matches: [
73+
'JS:~functionOne .+/linux-perf-logger.js',
74+
'JS:~functionTwo .+/linux-perf-logger.js',
75+
],
76+
noMatches: [
77+
String.raw`JS:\*'functionOne`,
78+
String.raw`JS:\*'functionTwo`,
79+
'test-regex',
80+
],
7181
},
7282
{
7383
title: '--perf-basic-prof-only-functions compiled',
7484
nodeFlags: ['--perf-basic-prof-only-functions', '--no-turbo-inlining', '--always-turbofan',
7585
'--minimum-invocations-before-optimization=0'],
7686
matches: [
77-
'~functionOne .+/linux-perf-logger.js',
78-
'~functionTwo .+/linux-perf-logger.js',
79-
'\\*functionOne .+/linux-perf-logger.js',
80-
'\\*functionTwo .+/linux-perf-logger.js',
87+
'JS:~functionOne .+/linux-perf-logger.js',
88+
'JS:~functionTwo .+/linux-perf-logger.js',
89+
String.raw`JS:\*'functionOne .+/linux-perf-logger.js`,
90+
String.raw`JS:\*'functionTwo .+/linux-perf-logger.js`,
91+
],
92+
noMatches: [
93+
'test-regex',
8194
],
82-
noMatches: ['test-regex'],
8395
},
8496
];
8597

@@ -110,7 +122,7 @@ function runTest(test) {
110122

111123
const hexRegex = '[a-fA-F0-9]+';
112124
for (const testRegex of test.matches) {
113-
const lineRegex = new RegExp(`${hexRegex} ${hexRegex}.*:${testRegex}`);
125+
const lineRegex = new RegExp(`${hexRegex} ${hexRegex}.* ${testRegex}`);
114126
if (!lineRegex.test(report.perfMap)) {
115127
report.errors.push(`Expected to match ${lineRegex}`);
116128
}

0 commit comments

Comments
 (0)