@@ -29,6 +29,7 @@ if (args.includes('-h')) {
2929-c force PNG to CHR conversion
3030-o override autodetect mmc1 header with cnrom
3131-t run tests (requires cargo)
32+ -T run single test
3233-h you are here
3334` ) ;
3435 process . exit ( 0 ) ;
@@ -126,8 +127,7 @@ console.timeEnd('CHR');
126127
127128const { spawnSync } = require ( 'child_process' ) ;
128129
129- function exec ( cmd ) {
130- const [ exe , ...args ] = cmd . split ( ' ' ) ;
130+ function execArgs ( exe , args ) {
131131 const output = spawnSync ( exe , args ) . output . flatMap (
132132 ( d ) => d ?. toString ( ) || [ ] ,
133133 ) ;
@@ -137,6 +137,11 @@ function exec(cmd) {
137137 }
138138}
139139
140+ function exec ( cmd ) {
141+ const [ exe , ...args ] = cmd . split ( ' ' ) ;
142+ execArgs ( exe , args )
143+ }
144+
140145const ca65bin = nativeCC65 ? 'ca65' : 'node ./tools/assemble/ca65.js' ;
141146const flags = compileFlags . join ( ' ' ) ;
142147
@@ -199,7 +204,15 @@ console.log();
199204
200205console . timeEnd ( 'build' ) ;
201206
207+ // tests
208+
202209if ( args . includes ( '-t' ) ) {
203210 console . log ( '\nrunning tests' ) ;
204211 exec ( 'cargo run --release --manifest-path tests/Cargo.toml -- -t' ) ;
205212}
213+
214+ if ( args . includes ( '-T' ) ) {
215+ const singleTest = args . slice ( 1 + args . indexOf ( '-T' ) ) . join ( ' ' ) ;
216+ console . log ( `\nrunning single test: ${ singleTest } ` ) ;
217+ execArgs ( 'cargo' , [ ...'run --release --manifest-path tests/Cargo.toml -- -T' . split ( ' ' ) , singleTest ] ) ;
218+ }
0 commit comments