@@ -8,7 +8,7 @@ var esbuildConfig = require('../../esbuild-config.js');
8
8
var isCI = Boolean ( process . env . CI ) ;
9
9
10
10
var argv = minimist ( process . argv . slice ( 4 ) , {
11
- string : [ 'bundleTest' , 'width' , 'height' ] ,
11
+ string : [ 'bundleTest' , 'performanceTest' , ' width', 'height' ] ,
12
12
boolean : [
13
13
'mathjax3' ,
14
14
'info' ,
@@ -21,6 +21,7 @@ var argv = minimist(process.argv.slice(4), {
21
21
Chrome : 'chrome' ,
22
22
Firefox : [ 'firefox' , 'FF' ] ,
23
23
bundleTest : [ 'bundletest' , 'bundle_test' ] ,
24
+ performanceTest : [ 'performancetest' , 'performance_test' ] ,
24
25
nowatch : 'no-watch' ,
25
26
failFast : 'fail-fast' ,
26
27
} ,
@@ -53,7 +54,8 @@ if(argv.info) {
53
54
' - All non-flagged arguments corresponds to the test suites in `test/jasmine/tests/` to be run.' ,
54
55
' No need to add the `_test.js` suffix, we expand them correctly here.' ,
55
56
' - `--bundleTest` set the bundle test suite `test/jasmine/bundle_tests/ to be run.' ,
56
- ' Note that only one bundle test can be run at a time.' ,
57
+ ' - `--performanceTest` set the bundle test suite `test/jasmine/performance_tests/ to be run.' ,
58
+ ' Note that only one bundle/performance test can be run at a time.' ,
57
59
' - Use `--tags` to specify which `@` tags to test (if any) e.g `npm run test-jasmine -- --tags=gl`' ,
58
60
' will run only gl tests.' ,
59
61
' - Use `--skip-tags` to specify which `@` tags to skip (if any) e.g `npm run test-jasmine -- --skip-tags=gl`' ,
@@ -100,7 +102,8 @@ var glob = function(_) {
100
102
} ;
101
103
102
104
var isBundleTest = ! ! argv . bundleTest ;
103
- var isFullSuite = ! isBundleTest && argv . _ . length === 0 ;
105
+ var isPerformanceTest = ! ! argv . performanceTest ;
106
+ var isFullSuite = ! ( isBundleTest || isPerformanceTest ) && argv . _ . length === 0 ;
104
107
var testFileGlob ;
105
108
106
109
if ( isFullSuite ) {
@@ -113,6 +116,14 @@ if(isFullSuite) {
113
116
}
114
117
115
118
testFileGlob = path . join ( __dirname , 'bundle_tests' , glob ( [ basename ( _ [ 0 ] ) ] ) ) ;
119
+ } else if ( isPerformanceTest ) {
120
+ var _ = merge ( argv . performanceTest ) ;
121
+
122
+ if ( _ . length > 1 ) {
123
+ console . warn ( 'Can only run one performance test suite at a time, ignoring ' , _ . slice ( 1 ) ) ;
124
+ }
125
+
126
+ testFileGlob = path . join ( __dirname , 'performance_tests' , glob ( [ basename ( _ [ 0 ] ) ] ) ) ;
116
127
} else {
117
128
testFileGlob = path . join ( __dirname , 'tests' , glob ( merge ( argv . _ ) . map ( basename ) ) ) ;
118
129
}
@@ -250,7 +261,7 @@ func.defaultConfig = {
250
261
'--touch-events' ,
251
262
'--window-size=' + argv . width + ',' + argv . height ,
252
263
isCI ? '--ignore-gpu-blacklist' : '' ,
253
- ( isBundleTest && basename ( testFileGlob ) === 'no_webgl' ) ? '--disable-webgl' : ''
264
+ ( ( isBundleTest || isPerformanceTest ) && basename ( testFileGlob ) === 'no_webgl' ) ? '--disable-webgl' : ''
254
265
]
255
266
} ,
256
267
_Firefox : {
0 commit comments