Skip to content

Commit c536707

Browse files
committed
Update scantest.py
Relates to [MACCAN-203]
1 parent 18252a5 commit c536707

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Tests/TestTools/scantest.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
// @workaround:
6969
// @end
7070
71-
$Author: makemake $
71+
$Author: haumea $
7272
73-
$Rev: 792 $
73+
$Rev: 793 $
7474
"""
7575
# encoding: utf-8
7676
from datetime import datetime
@@ -86,6 +86,7 @@
8686
specpath = '.'
8787
specext = '.txt'
8888
xctest = False
89+
gtest = False
8990

9091
# output the test case subject
9192
def write_test_subject(file, text, option):
@@ -172,12 +173,21 @@ def write_test_procedure(file, text, option, suite):
172173
if line.startswith('// @xctest '):
173174
write_test_subject(fp2, line.replace('// @xctest ', '', 1), testopts)
174175
xctest = True
176+
gtest = False
177+
count += 1
178+
total += 1
179+
# - test case subject (gtest)
180+
elif line.startswith('// @gtest '):
181+
write_test_subject(fp2, line.replace('// @gtest ', '', 1), testopts)
182+
xctest = False
183+
gtest = True
175184
count += 1
176185
total += 1
177186
# - test case subject (others)
178187
elif line.startswith('// @testcase '):
179-
write_test_subject(fp2, line.replace('// @xctest ', '', 1), testopts)
188+
write_test_subject(fp2, line.replace('// @testcase ', '', 1), testopts)
180189
xctest = False
190+
gtest = False
181191
count += 1
182192
total += 1
183193
# - expected value
@@ -198,6 +208,8 @@ def write_test_procedure(file, text, option, suite):
198208
elif line.startswith('- (void)test') and xctest is True:
199209
write_test_procedure(fp2, line.replace('- (void)', '').replace(' {', ''), testopts, os.path.splitext(file)[0])
200210
# google test/mock fixture
211+
elif line.startswith('TEST_F') and gtest is True:
212+
write_test_procedure(fp2, line.replace(' {', ''), testopts, "GoogleTest")
201213
# TODO: insert coin here
202214
if testopts['separator']:
203215
fp2.write(scanner + '\n')

0 commit comments

Comments
 (0)