libmx3 / mx3

a sample project showcasing/collecting cross platform techniques on mobile
MIT License
1.17k stars 146 forks source link

Enumerate gtests in xcode #42

Closed daviswalker closed 9 years ago

daviswalker commented 9 years ago

This isn't so much of an issue as a suggestion for a pattern. I ran across this repo: https://github.com/mattstevens/xcode-googletest. He enumerates the gtest cases into XCTest cases, which enables the tests to be controlled via the test interface in Xcode. This allows for a pretty sweet test-driven workflow for library development.

Gyp won't generate a test bundle as far as I can see, so what I've done is create a test project that includes the test cases and this runner class. I set up gyp to make my library produce a framework, which the test bundle cleanly links to.

This setup is still a little finnicky - sometimes the test cases show up in the test interface in xcode, sometimes not. But I still like it a lot better than relying strictly on gtest's command line output. If anyone experiments with this and can find a way to make this a reliable pattern, please post!

skabbes commented 9 years ago

You mind putting your code up somewhere? I've become fairly familiar with gyp, so maybe we can hack around on it. I would imagine this is useful enough that chromium might even accept a patch upstream to facilitate this.

daviswalker commented 9 years ago

Sorry for the lengthy delay - I posted a pull request that shows the pattern.

daviswalker commented 9 years ago

Implemented! Thanks @skabbes