Empty Junit reports from ant

后端 未结 4 1530
时光取名叫无心
时光取名叫无心 2021-01-06 07:09

I am trying to use ant to run junit tests and generate reports. I am able to successfully run the tests but the report files are empty.

What am I doing wrong ?

4条回答
  •  抹茶落季
    2021-01-06 07:49

    The ant JUnit Task doc gives this example that might help you (as it apparently does exactly what you're trying to achieve):

    
        
            
            
        
    
        
    
        
            
        
    
        
            
                
                
            
        
    
    

    Runs my.test.TestCase in the same VM, ignoring the given CLASSPATH; only a warning is printed if this test fails. In addition to the plain text test results, for this test a XML result will be output to result.xml. Then, for each matching file in the directory defined for ${src.tests} a test is run in a separate VM. If a test fails, the build process is aborted. Results are collected in files named TEST-name.txt and written to ${reports.tests}.

    It is specified in the doc that printsummary can take values on and off, but they're using yes in the example which is on the same page, so I guess it's accepted too.

提交回复
热议问题