68
68
// @workaround:
69
69
// @end
70
70
71
- $Author: makemake $
71
+ $Author: haumea $
72
72
73
- $Rev: 792 $
73
+ $Rev: 793 $
74
74
"""
75
75
# encoding: utf-8
76
76
from datetime import datetime
86
86
specpath = '.'
87
87
specext = '.txt'
88
88
xctest = False
89
+ gtest = False
89
90
90
91
# output the test case subject
91
92
def write_test_subject (file , text , option ):
@@ -172,12 +173,21 @@ def write_test_procedure(file, text, option, suite):
172
173
if line .startswith ('// @xctest ' ):
173
174
write_test_subject (fp2 , line .replace ('// @xctest ' , '' , 1 ), testopts )
174
175
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
175
184
count += 1
176
185
total += 1
177
186
# - test case subject (others)
178
187
elif line .startswith ('// @testcase ' ):
179
- write_test_subject (fp2 , line .replace ('// @xctest ' , '' , 1 ), testopts )
188
+ write_test_subject (fp2 , line .replace ('// @testcase ' , '' , 1 ), testopts )
180
189
xctest = False
190
+ gtest = False
181
191
count += 1
182
192
total += 1
183
193
# - expected value
@@ -198,6 +208,8 @@ def write_test_procedure(file, text, option, suite):
198
208
elif line .startswith ('- (void)test' ) and xctest is True :
199
209
write_test_procedure (fp2 , line .replace ('- (void)' , '' ).replace (' {' , '' ), testopts , os .path .splitext (file )[0 ])
200
210
# google test/mock fixture
211
+ elif line .startswith ('TEST_F' ) and gtest is True :
212
+ write_test_procedure (fp2 , line .replace (' {' , '' ), testopts , "GoogleTest" )
201
213
# TODO: insert coin here
202
214
if testopts ['separator' ]:
203
215
fp2 .write (scanner + '\n ' )
0 commit comments