@@ -8,7 +8,7 @@ var esbuildConfig = require('../../esbuild-config.js');
88var isCI = Boolean ( process . env . CI ) ;
99
1010var argv = minimist ( process . argv . slice ( 4 ) , {
11- string : [ 'bundleTest' , 'width' , 'height' ] ,
11+ string : [ 'bundleTest' , 'performanceTest' , ' width', 'height' ] ,
1212 boolean : [
1313 'mathjax3' ,
1414 'info' ,
@@ -21,6 +21,7 @@ var argv = minimist(process.argv.slice(4), {
2121 Chrome : 'chrome' ,
2222 Firefox : [ 'firefox' , 'FF' ] ,
2323 bundleTest : [ 'bundletest' , 'bundle_test' ] ,
24+ performanceTest : [ 'performancetest' , 'performance_test' ] ,
2425 nowatch : 'no-watch' ,
2526 failFast : 'fail-fast' ,
2627 } ,
@@ -53,7 +54,8 @@ if(argv.info) {
5354 ' - All non-flagged arguments corresponds to the test suites in `test/jasmine/tests/` to be run.' ,
5455 ' No need to add the `_test.js` suffix, we expand them correctly here.' ,
5556 ' - `--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.' ,
5759 ' - Use `--tags` to specify which `@` tags to test (if any) e.g `npm run test-jasmine -- --tags=gl`' ,
5860 ' will run only gl tests.' ,
5961 ' - 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(_) {
100102} ;
101103
102104var isBundleTest = ! ! argv . bundleTest ;
103- var isFullSuite = ! isBundleTest && argv . _ . length === 0 ;
105+ var isPerformanceTest = ! ! argv . performanceTest ;
106+ var isFullSuite = ! ( isBundleTest || isPerformanceTest ) && argv . _ . length === 0 ;
104107var testFileGlob ;
105108
106109if ( isFullSuite ) {
@@ -113,6 +116,14 @@ if(isFullSuite) {
113116 }
114117
115118 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 ] ) ] ) ) ;
116127} else {
117128 testFileGlob = path . join ( __dirname , 'tests' , glob ( merge ( argv . _ ) . map ( basename ) ) ) ;
118129}
@@ -250,7 +261,7 @@ func.defaultConfig = {
250261 '--touch-events' ,
251262 '--window-size=' + argv . width + ',' + argv . height ,
252263 isCI ? '--ignore-gpu-blacklist' : '' ,
253- ( isBundleTest && basename ( testFileGlob ) === 'no_webgl' ) ? '--disable-webgl' : ''
264+ ( ( isBundleTest || isPerformanceTest ) && basename ( testFileGlob ) === 'no_webgl' ) ? '--disable-webgl' : ''
254265 ]
255266 } ,
256267 _Firefox : {
0 commit comments