File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 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) {
6666} 
6767
6868exports . 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- 
7769  rimrafSync ( exports . tmpDir ) ; 
7870  fs . mkdirSync ( exports . tmpDir ) ; 
7971} ; 
Original file line number Diff line number Diff line change @@ -1318,6 +1318,8 @@ def BuildOptions():
13181318  result .add_option ("-r" , "--run" ,
13191319      help = "Divide the tests in m groups (interleaved) and run tests from group n (--run=n,m with n < m)" ,
13201320      default = "" )
1321+   result .add_option ('--temp-dir' ,
1322+       help = 'Optional path to change directory used for tests' , default = False )
13211323  return  result 
13221324
13231325
@@ -1546,6 +1548,16 @@ def Main():
15461548    for  rule  in  globally_unused_rules :
15471549      print  "Rule for '%s' was not used."  %  '/' .join ([str (s ) for  s  in  rule .path ])
15481550
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+ 
15491561  if  options .report :
15501562    PrintReport (all_cases )
15511563
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments