File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
<!-- 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
5
6
* ` FIX ` Fixed the error that the configuration file pointed to by the ` --configpath ` option was not read and loaded.
6
7
7
8
## 3.13.5
Original file line number Diff line number Diff line change @@ -10,6 +10,15 @@ DEVELOP = true
10
10
-- TRACE = true
11
11
LOGPATH = LOGPATH or (ROOT :string () .. ' /log' )
12
12
METAPATH = 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
13
22
14
23
collectgarbage ' generational'
15
24
@@ -34,7 +43,11 @@ local function loadAllLibs()
34
43
assert (require ' lpeglabel' )
35
44
end
36
45
46
+ --- @param name string
37
47
local function test (name )
48
+ if TARGET_TEST_NAME and not name :match (TARGET_TEST_NAME ) then
49
+ return
50
+ end
38
51
local clock = os.clock ()
39
52
print ((' 测试[%s]...' ):format (name ))
40
53
local originRequire = require
You can’t perform that action at this time.
0 commit comments