From dec5890fafc7013d6c1a532b0012ecd136ca6881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 4 Feb 2025 15:15:25 +0100 Subject: [PATCH] test: update test-linux-perf-logger New V8 version includes more information about regular expressions. --- test/v8-updates/test-linux-perf-logger.js | 46 ++++++++++++++--------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/test/v8-updates/test-linux-perf-logger.js b/test/v8-updates/test-linux-perf-logger.js index a2747b7c4282d1..8a24f4c59315ad 100644 --- a/test/v8-updates/test-linux-perf-logger.js +++ b/test/v8-updates/test-linux-perf-logger.js @@ -44,42 +44,54 @@ 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', + String.raw`RegExp\.> src: 'test-regex' flags: 'gi'`, + ], + noMatches: [ + String.raw`JS:\*'functionOne`, + String.raw`JS:\*'functionTwo`, ], - noMatches: ['\\*functionOne', '\\*functionTwo'], }, { title: '--perf-basic-prof compiled', 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', + String.raw`RegExp\.> src: 'test-regex' flags: 'gi'`, + 'JS:~functionOne .+/linux-perf-logger.js', + 'JS:~functionTwo .+/linux-perf-logger.js', + String.raw`JS:\*'functionOne .+/linux-perf-logger.js`, + String.raw`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'], - noMatches: ['\\*functionOne', '\\*functionTwo', 'test-regex'], + matches: [ + 'JS:~functionOne .+/linux-perf-logger.js', + 'JS:~functionTwo .+/linux-perf-logger.js', + ], + noMatches: [ + String.raw`JS:\*'functionOne`, + String.raw`JS:\*'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', + String.raw`JS:\*'functionOne .+/linux-perf-logger.js`, + String.raw`JS:\*'functionTwo .+/linux-perf-logger.js`, + ], + noMatches: [ + 'test-regex', ], - noMatches: ['test-regex'], }, ]; @@ -110,7 +122,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}`); }