File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed
report/firefox_code_coverage Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -315,16 +315,29 @@ def download_grcov():
315
315
)
316
316
latest_tag = r ["tag_name" ]
317
317
318
- if os .path .exists ("grcov" ) and os .path .exists ("grcov_ver" ):
318
+ if sys .platform .startswith ("linux" ):
319
+ platform = "linux"
320
+ grcov_path = "grcov"
321
+ elif sys .platform == "darwin" :
322
+ platform = "osx"
323
+ grcov_path = "grcov"
324
+ elif sys .platform .startswith ("win" ):
325
+ platform = "win"
326
+ grcov_path = "grcov.exe"
327
+ else :
328
+ assert False , f"Unknown platform { sys .platform } "
329
+
330
+ if os .path .exists (grcov_path ) and os .path .exists ("grcov_ver" ):
319
331
with open ("grcov_ver" , "r" ) as f :
320
332
installed_ver = f .read ()
321
333
322
334
if installed_ver == latest_tag :
323
- return
335
+ return grcov_path
324
336
325
337
urlretrieve (
326
- "https://github.com/marco-c/grcov/releases/download/%s/grcov-linux-x86_64.tar.bz2"
327
- % latest_tag ,
338
+ "https://github.com/marco-c/grcov/releases/download/{}/grcov-{}-x86_64.tar.bz2" .format (
339
+ latest_tag , platform
340
+ ),
328
341
"grcov.tar.bz2" ,
329
342
)
330
343
@@ -337,6 +350,8 @@ def download_grcov():
337
350
with open ("grcov_ver" , "w" ) as f :
338
351
f .write (latest_tag )
339
352
353
+ return grcov_path
354
+
340
355
341
356
def download_genhtml ():
342
357
if os .path .isdir ("lcov" ):
@@ -442,8 +457,7 @@ def main():
442
457
if args .grcov :
443
458
grcov_path = args .grcov
444
459
else :
445
- download_grcov ()
446
- grcov_path = "./grcov"
460
+ grcov_path = download_grcov ()
447
461
448
462
if args .stats :
449
463
generate_report (grcov_path , "coveralls" , "output.json" , artifact_paths )
You can’t perform that action at this time.
0 commit comments