realm / SwiftCov

A tool to generate test code coverage information for Swift.
MIT License
561 stars 41 forks source link

Python crashes after generating incorrect coverage files #6

Closed Thomvis closed 9 years ago

Thomvis commented 9 years ago

I'm trying to run swiftcov on BrightFutures (https://github.com/Thomvis/BrightFutures), but Python crashes and the coverage reports seem to be incorrect (every line begins with -:). I haven't tried to run it on a different project yet.

In the Xcode console, the last lines read:

Generating gcov files...
Created './coverage/ExecutionContext.swift.gcov'
Created './coverage/BoxType.swift.gcov'
...
Created './coverage/Errors.swift.gcov'
Coverage files successfully generated to './coverage'
Failed to execute xcode build command

Full console log can be found here: https://gist.github.com/Thomvis/bd5a11c53180db9613be.

At that time, a window pops up saying 'Python quit unexpectedly'. See screenshot: screen shot 2015-05-26 at 22 01 03

Full log can be found here: https://gist.github.com/Thomvis/1e90c2465b54560d0cde

An example .gcov file can be found here: https://gist.github.com/Thomvis/854ba0715902a5f60406

Arguments used to run swiftcov: generate --output ./coverage xcodebuild -project BrightFutures.xcodeproj -scheme 'BrightFutures-Mac' -configuration Release -sdk macosx test

Let me know if you need more info!

kishikawakatsumi commented 9 years ago

I cannot reproduce this issue yet. Could you please share the reproducible project? Please send to kk@realm.io .

And to isolate the problem, please let me confirm following:

Can you succeeded to run about the example project? https://github.com/realm/SwiftCov/tree/master/Examples/ExampleFramework

What happens if Debug configuration? Please try to run after changing the configuration option to Debug.

Thank you very much for reporting. :bow:

kishikawakatsumi commented 9 years ago

@Thomvis I finally understood the issue. You probably run swiftcov from Xcode? It is a weird behavior; the issue was caused only when run from Xcode. The coverage report is not generated correctly and crash at the end of the process.

If so, please install swiftcov command and run from command line. Since it is not likely to fix immediately.

Thomvis commented 9 years ago

@kishikawakatsumi yes I am running it from Xcode. Will try to run it from the command line and report back.

Thomvis commented 9 years ago

Running it from the command line fixed it. Great! Really cool to inspect those .gcov files.