Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: update test-linux-perf-logger
New V8 version includes more information about regular expressions.
  • Loading branch information
targos committed Feb 5, 2025
commit b3c3d4680b607de5ab025e8da8355ce285eecb41
31 changes: 17 additions & 14 deletions test/v8-updates/test-linux-perf-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const testCases = [
title: '--perf-basic-prof interpreted',
nodeFlags: ['--perf-basic-prof', '--no-turbo-inlining', '--no-opt'],
matches: [
'~functionOne .+/linux-perf-logger.js',
'~functionTwo .+/linux-perf-logger.js',
'test-regex',
'JS:~functionOne .+/linux-perf-logger.js',
'JS:~functionTwo .+/linux-perf-logger.js',
"RegExp\\.> src: 'test-regex' flags: 'gi'",
],
noMatches: ['\\*functionOne', '\\*functionTwo'],
},
Expand All @@ -55,29 +55,32 @@ const testCases = [
nodeFlags: ['--perf-basic-prof', '--no-turbo-inlining', '--always-turbofan',
'--minimum-invocations-before-optimization=0'],
matches: [
'test-regex',
'~functionOne .+/linux-perf-logger.js',
'~functionTwo .+/linux-perf-logger.js',
'\\*functionOne .+/linux-perf-logger.js',
'\\*functionTwo .+/linux-perf-logger.js',
"RegExp\\.> src: 'test-regex' flags: 'gi'",
'JS:~functionOne .+/linux-perf-logger.js',
'JS:~functionTwo .+/linux-perf-logger.js',
'JS:\\*functionOne .+/linux-perf-logger.js',
'JS:\\*functionTwo .+/linux-perf-logger.js',
],
noMatches: [],
},
{
title: '--perf-basic-prof-only-functions interpreted',
nodeFlags: ['--perf-basic-prof-only-functions', '--no-turbo-inlining', '--no-opt'],
matches: ['~functionOne .+/linux-perf-logger.js', '~functionTwo .+/linux-perf-logger.js'],
matches: [
'JS:~functionOne .+/linux-perf-logger.js',
'~functionTwo .+/linux-perf-logger.js',
],
noMatches: ['\\*functionOne', '\\*functionTwo', 'test-regex'],
},
{
title: '--perf-basic-prof-only-functions compiled',
nodeFlags: ['--perf-basic-prof-only-functions', '--no-turbo-inlining', '--always-turbofan',
'--minimum-invocations-before-optimization=0'],
matches: [
'~functionOne .+/linux-perf-logger.js',
'~functionTwo .+/linux-perf-logger.js',
'\\*functionOne .+/linux-perf-logger.js',
'\\*functionTwo .+/linux-perf-logger.js',
'JS:~functionOne .+/linux-perf-logger.js',
'JS:~functionTwo .+/linux-perf-logger.js',
'JS:\\*functionOne .+/linux-perf-logger.js',
'JS:\\*functionTwo .+/linux-perf-logger.js',
],
noMatches: ['test-regex'],
},
Expand Down Expand Up @@ -110,7 +113,7 @@ function runTest(test) {

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