Giter Site home page Giter Site logo

xcode-googletest's People

Contributors

kylealanhale avatar mattstevens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcode-googletest's Issues

Workaround for Xcode's TestNavigator caching the tests after the first run?

First, this is a cool project, thanks for sharing it. (BTW, can you please add a license file so we know what the terms of usage are?)

I noticed a problem with Xcode in that after the first run of the tests (and discovering the Google tests which are added by runtime injection) it caches those suites and tests. If you add a second test to CounterTest.cpp:

TEST(Counter2, Decrement) {
Counter counter;
EXPECT_EQ(-1, counter.Decrement());
}

Now if you run GoogleTestCase again in TestNavigator it will only run the Counter test case with the initial tests (InitialState and Increment). The only workaround I found is to close the project and re-open it in XCode which causes XCode to lose all the dynamic XCTest information so when you run the GoogleTestCase if will discover (and cache) the new tests. Needless to say this is utterly annoying as I have to re-open the project any time I add/remove/disable a test.

Are you aware of this issue and if yes, do you know of a better workaround/fix?

Thanks!

SetUpTestCase & TearDownTestCase are called multiple times per test case

Because each test method is registered separately, when I want to run a whole test case from the Test Navigator, multiple calls to RUN_ALL_TESTS() will be made (one for each test in the test case). This has the undesirable effect that SetUpTestCase & TearDownTestCase are now broken, instead of being called once per test case, they are called once per test method (just like SetUp/TearDown). I don't know how to fix this, otherwise I would have created a pull request :-)

The gtest filter allows using a test case name as a valid filter and has the desired result - runs all the enabled tests in that case. The problem I couldn't figure out is how to create a selector for the test case itself (as opposed to individual methods) that is invoked when I click the "play" arrow in the Test Navigator on the test case.

The strange 'TEST EXECUTE FAILED' only on iOS

In license_test.cpp only one test. And it looks lie this:

TEST(Test, License) {
#if !defined(WITH_LICENSE)
	GTEST_SKIP();
#else
	checkLicense();
#endif
}

In case, if the macro WITH_LICENSE is not defined.

On Linux (android and windows), I am observing something like this:

[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from Test
[ RUN      ] Test.License
[  SKIPPED ] Test.License (0 ms)
[----------] 1 test from Test (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 0 tests.
[  SKIPPED ] 1 test, listed below:
[  SKIPPED ] Test.License

But on iOS (iOS 13.4 Deployment 11.0 / arm64) it falls each time with log:

Executed 1 test, with 0 failures (0 unexpected) in 0.017 (0.017) seconds
Test Suite 'License' started at 2022-05-16 11:44:35.799
Test Case '-[Test License]' started.
.../license_test.cpp:103: error: -[Test License] : Skipped
.../ios/GoogleTests.mm:158: error: -[Test License] : ((totalTestsRun) equal to (1)) failed: ("0") is not equal to ("1") - Expected to run a single test for filter "Test.License"
Test Case '-[Test License]' failed (0.002 seconds).
Test Suite 'Test' failed at 2022-05-16 11:44:35.802.
...
** TEST EXECUTE FAILED **
Testing started on 'iPhone X black'

Compiler and build system information:

-- [polly] Used toolchain: iOS 13.4 Deployment 11.0 / arm64 / clang / c++11 support
debug CMAKE_CURRENT_LIST_DIR = /Users/admin/dev/polly
-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032

The version of googletest is - v1.10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.