File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,6 @@ function rmdirSync(p, originalEr) {
66
66
}
67
67
68
68
exports . refreshTmpDir = function ( ) {
69
- try {
70
- fs . accessSync ( testRoot , fs . W_OK ) ;
71
- } catch ( e ) {
72
- if ( e . code === 'ENOENT' ) {
73
- process . exit ( 101 ) ;
74
- }
75
- }
76
-
77
69
rimrafSync ( exports . tmpDir ) ;
78
70
fs . mkdirSync ( exports . tmpDir ) ;
79
71
} ;
Original file line number Diff line number Diff line change @@ -1318,6 +1318,8 @@ def BuildOptions():
1318
1318
result .add_option ("-r" , "--run" ,
1319
1319
help = "Divide the tests in m groups (interleaved) and run tests from group n (--run=n,m with n < m)" ,
1320
1320
default = "" )
1321
+ result .add_option ('--temp-dir' ,
1322
+ help = 'Optional path to change directory used for tests' , default = False )
1321
1323
return result
1322
1324
1323
1325
@@ -1546,6 +1548,16 @@ def Main():
1546
1548
for rule in globally_unused_rules :
1547
1549
print "Rule for '%s' was not used." % '/' .join ([str (s ) for s in rule .path ])
1548
1550
1551
+ tempdir = os .environ .get ('NODE_TEST_DIR' ) or options .temp_dir
1552
+ if tempdir :
1553
+ try :
1554
+ os .makedirs (tempdir )
1555
+ os .environ ['NODE_TEST_DIR' ] = tempdir
1556
+ except OSError as exception :
1557
+ if exception .errno != errno .EEXIST :
1558
+ print "Could not create the temporary directory" , options .temp_dir
1559
+ sys .exit (1 )
1560
+
1549
1561
if options .report :
1550
1562
PrintReport (all_cases )
1551
1563
You can’t perform that action at this time.
0 commit comments