File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44<!-- Add all new changes here. They will be moved under a version at release -->
5+ * ` NEW ` Test CLI: ` --name=<testname> ` ` -n=<testname> ` : run specify unit test
56* ` FIX ` Fixed the error that the configuration file pointed to by the ` --configpath ` option was not read and loaded.
67
78## 3.13.5
Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ DEVELOP = true
1010-- TRACE = true
1111LOGPATH = LOGPATH or (ROOT :string () .. ' /log' )
1212METAPATH = METAPATH or (ROOT :string () .. ' /meta' )
13+ TARGET_TEST_NAME = nil
14+
15+ if arg then
16+ for _ , v in pairs (arg ) do
17+ if v :sub (1 , 3 ) == " -n=" or v :sub (1 , 7 ) == " --name=" then
18+ TARGET_TEST_NAME = v :sub (v :find (' =' ) + 1 )
19+ end
20+ end
21+ end
1322
1423collectgarbage ' generational'
1524
@@ -34,7 +43,11 @@ local function loadAllLibs()
3443 assert (require ' lpeglabel' )
3544end
3645
46+ --- @param name string
3747local function test (name )
48+ if TARGET_TEST_NAME and not name :match (TARGET_TEST_NAME ) then
49+ return
50+ end
3851 local clock = os.clock ()
3952 print ((' 测试[%s]...' ):format (name ))
4053 local originRequire = require
You can’t perform that action at this time.
0 commit comments