@@ -44,42 +44,54 @@ const testCases = [
44
44
title : '--perf-basic-prof interpreted' ,
45
45
nodeFlags : [ '--perf-basic-prof' , '--no-turbo-inlining' , '--no-opt' ] ,
46
46
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` ,
50
54
] ,
51
- noMatches : [ '\\*functionOne' , '\\*functionTwo' ] ,
52
55
} ,
53
56
{
54
57
title : '--perf-basic-prof compiled' ,
55
58
nodeFlags : [ '--perf-basic-prof' , '--no-turbo-inlining' , '--always-turbofan' ,
56
59
'--minimum-invocations-before-optimization=0' ] ,
57
60
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` ,
63
66
] ,
64
67
noMatches : [ ] ,
65
68
} ,
66
69
{
67
70
title : '--perf-basic-prof-only-functions interpreted' ,
68
71
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
+ ] ,
71
81
} ,
72
82
{
73
83
title : '--perf-basic-prof-only-functions compiled' ,
74
84
nodeFlags : [ '--perf-basic-prof-only-functions' , '--no-turbo-inlining' , '--always-turbofan' ,
75
85
'--minimum-invocations-before-optimization=0' ] ,
76
86
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' ,
81
94
] ,
82
- noMatches : [ 'test-regex' ] ,
83
95
} ,
84
96
] ;
85
97
@@ -110,7 +122,7 @@ function runTest(test) {
110
122
111
123
const hexRegex = '[a-fA-F0-9]+' ;
112
124
for ( const testRegex of test . matches ) {
113
- const lineRegex = new RegExp ( `${ hexRegex } ${ hexRegex } .*: ${ testRegex } ` ) ;
125
+ const lineRegex = new RegExp ( `${ hexRegex } ${ hexRegex } .* ${ testRegex } ` ) ;
114
126
if ( ! lineRegex . test ( report . perfMap ) ) {
115
127
report . errors . push ( `Expected to match ${ lineRegex } ` ) ;
116
128
}
0 commit comments