codebase:testing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
codebase:testing [2024/09/28 15:58] – created - external edit 127.0.0.1codebase:testing [2025/03/25 10:49] (current) fponzi
Line 1: Line 1:
-====== Testing ======+====== Building and running tests ====== 
 +You will need ant build system. ''customBuild.xml'' supports different parameters to tune the tests. They can also be combined.
  
-===== test-dist: =====+===== customBuild.xml common commands ==== 
 +  * compile: recompiles the production code for project. Required if you changed any code in src folder.  
 +  * compile-test: recompiles the test code for the project. Required if you updated any code test folder. 
 +  * test-set: by using the parameter ''-Dtest.testcases="tlc2/tool/InliningTest*"'' we can specify a single test to run. It also supports regexes. 
 +Example: 
 +<code> 
 +ant -f customBuild.xml compile compile-test test-set -Dtest.testcases="tlc2/tool/Github1109Test.java" 
 +</code>
  
-Executes accompanying unit tests on jar file+===== Running a test with a debugger ===== 
 + 
 +''%%-Dtest.suspend=y%%'' will suspend the execution and give you time to hook up a debugger before running a test.
  
 <code> <code>
-ant -f customBuild.xml clean compile compile-test test-dist+ant -f customBuild.xml compile-test test-set -Dtest.suspend=y -Dtest.testcases="tlc2/tool/InliningTest*"
 </code> </code>
  
-To speedup, you can modify customBuild.xml and modify junit line inside of test-dist:+===== Specify number of threads ===== 
 + 
 +By default uses all your cores. You can specify a custom amount using ''%%-Dthreads=4%%'':
  
 <code> <code>
-<junit printsummary="yes" haltonfailure="${test.halt}" haltonerror="${test.halt}" forkmode="perTest" fork="yes">+ant -f customBuild.xml test -Dthreads=4
 </code> </code>
  
-to use more threads: ''%%threads="8"%%''+===== Halt tests when a failure is found ===== 
 + 
 +By default the test target will run all the test and report success or failure only at the end. It can be convinient to just stop execution as soon as an error is found, with''%%-Dtest.halt=true%%''.
  
 <code> <code>
-<junit printsummary="yes" haltonfailure="${test.halt}" haltonerror="${test.halt}" forkmode="perTest" fork="yes" threads="8">+ant -f customBuild.xml test -Dtest.halt=true
 </code> </code>
  
 +===== test-dist: =====
 +
 +Executes accompanying unit tests on jar file
 +
 +<code>
 +ant -f customBuild.xml clean compile compile-test test-dist
 +</code>
  • codebase/testing.1727539100.txt.gz
  • Last modified: 2024/09/28 15:58
  • by 127.0.0.1