1
- ' use strict' ;
1
+ " use strict" ;
2
2
3
- let ChildProcess = require ( ' child_process' ) ;
4
- let Fs = require ( ' node:fs/promises' ) ;
5
- let Path = require ( ' node:path' ) ;
3
+ let ChildProcess = require ( " child_process" ) ;
4
+ let Fs = require ( " node:fs/promises" ) ;
5
+ let Path = require ( " node:path" ) ;
6
6
7
7
async function main ( ) {
8
- console . info ( ' TAP version 13' ) ;
8
+ console . info ( " TAP version 13" ) ;
9
9
10
10
let dirents = await Fs . readdir ( __dirname , { withFileTypes : true } ) ;
11
11
12
12
let failures = 0 ;
13
13
let count = 0 ;
14
14
for ( let dirent of dirents ) {
15
- if ( dirent . name === ' index.js' ) {
15
+ if ( dirent . name === " index.js" ) {
16
16
continue ;
17
17
}
18
18
19
19
count += 1 ;
20
20
let direntPath = Path . join ( __dirname , dirent . name ) ;
21
- let relPath = Path . relative ( '.' , direntPath ) ;
21
+ let relPath = Path . relative ( "." , direntPath ) ;
22
22
23
23
let success = await handleEach ( count , relPath ) ;
24
24
if ( ! success ) {
@@ -45,7 +45,7 @@ async function main() {
45
45
}
46
46
47
47
async function handleEach ( count , relPath ) {
48
- let success = await exec ( ' node' , [ relPath ] )
48
+ let success = await exec ( " node" , [ relPath ] )
49
49
. then ( function ( result ) {
50
50
console . info ( `ok ${ count } - ${ relPath } ` ) ;
51
51
return true ;
@@ -71,19 +71,19 @@ async function exec(exe, args) {
71
71
let stdout = [ ] ;
72
72
let stderr = [ ] ;
73
73
74
- cmd . stdout . on ( ' data' , function ( data ) {
75
- stdout . push ( data . toString ( ' utf8' ) ) ;
74
+ cmd . stdout . on ( " data" , function ( data ) {
75
+ stdout . push ( data . toString ( " utf8" ) ) ;
76
76
} ) ;
77
77
78
- cmd . stderr . on ( ' data' , function ( data ) {
79
- stderr . push ( data . toString ( ' utf8' ) ) ;
78
+ cmd . stderr . on ( " data" , function ( data ) {
79
+ stderr . push ( data . toString ( " utf8" ) ) ;
80
80
} ) ;
81
81
82
- cmd . on ( ' close' , function ( code ) {
82
+ cmd . on ( " close" , function ( code ) {
83
83
let result = {
84
84
code : code ,
85
- stdout : stdout . join ( '' ) ,
86
- stderr : stderr . join ( '' ) ,
85
+ stdout : stdout . join ( "" ) ,
86
+ stderr : stderr . join ( "" ) ,
87
87
} ;
88
88
89
89
if ( ! code ) {
@@ -103,7 +103,7 @@ main()
103
103
process . exit ( 0 ) ;
104
104
} )
105
105
. catch ( function ( err ) {
106
- console . error ( ' Fail:' ) ;
106
+ console . error ( " Fail:" ) ;
107
107
console . error ( err . stack || err ) ;
108
108
process . exit ( 1 ) ;
109
109
} ) ;
0 commit comments