@@ -29,6 +29,7 @@ if (args.includes('-h')) {
29
29
-c force PNG to CHR conversion
30
30
-o override autodetect mmc1 header with cnrom
31
31
-t run tests (requires cargo)
32
+ -T run single test
32
33
-h you are here
33
34
` ) ;
34
35
process . exit ( 0 ) ;
@@ -126,8 +127,7 @@ console.timeEnd('CHR');
126
127
127
128
const { spawnSync } = require ( 'child_process' ) ;
128
129
129
- function exec ( cmd ) {
130
- const [ exe , ...args ] = cmd . split ( ' ' ) ;
130
+ function execArgs ( exe , args ) {
131
131
const output = spawnSync ( exe , args ) . output . flatMap (
132
132
( d ) => d ?. toString ( ) || [ ] ,
133
133
) ;
@@ -137,6 +137,11 @@ function exec(cmd) {
137
137
}
138
138
}
139
139
140
+ function exec ( cmd ) {
141
+ const [ exe , ...args ] = cmd . split ( ' ' ) ;
142
+ execArgs ( exe , args )
143
+ }
144
+
140
145
const ca65bin = nativeCC65 ? 'ca65' : 'node ./tools/assemble/ca65.js' ;
141
146
const flags = compileFlags . join ( ' ' ) ;
142
147
@@ -199,7 +204,15 @@ console.log();
199
204
200
205
console . timeEnd ( 'build' ) ;
201
206
207
+ // tests
208
+
202
209
if ( args . includes ( '-t' ) ) {
203
210
console . log ( '\nrunning tests' ) ;
204
211
exec ( 'cargo run --release --manifest-path tests/Cargo.toml -- -t' ) ;
205
212
}
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