Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to build and run unittests on Windows #920

Merged
merged 4 commits into from Sep 2, 2014
Merged

Provide a way to build and run unittests on Windows #920

merged 4 commits into from Sep 2, 2014

Conversation

shuffle2
Copy link
Contributor

UnitTests have been integrated into msbuild as a standalone project which is compiled by default, but not run. The tests can be run as you would normally run an output binary from VS, or you (or the buildbot) can pass /p:RunUnitTests=true to msbuild.
Note that the tests are currently failing on windows :)
In order to add more tests, you only add files under UnitTests directory, no modification to the msbuild files should be required.

@shuffle2 shuffle2 changed the title msvc: get UnitTests compiling Provide a way to build and run unittests on Windows Aug 31, 2014
@@ -13,6 +13,9 @@ TEST(CommonFuncs, ArraySizeMacro)

EXPECT_EQ(4u, ArraySize(test));
EXPECT_EQ(42u, ArraySize(test2));

(void)test;
(void)test2;
}

TEST(CommonFuncs, RoundUpPow2Macro)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@shuffle2
Copy link
Contributor Author

shuffle2 commented Sep 1, 2014

@dolphin-emu-bot rebuild

@shuffle2
Copy link
Contributor Author

shuffle2 commented Sep 1, 2014

@dolphin-emu-bot rebuild
windows should report build failure as result of unittests failing...

@delroth
Copy link
Member

delroth commented Sep 1, 2014

@dolphin-emu-bot rebuild (let's try again)

@delroth
Copy link
Member

delroth commented Sep 1, 2014

@shuffle2 ask to wait until we make the unittest compilation happen only if we want to run tests.

@shuffle2
Copy link
Contributor Author

shuffle2 commented Sep 1, 2014

I also experimented with GoogleTest Runner which allows the builtin VS experience for gtest binaries. This will be the best way for developers to run tests locally, apart from using msbuild directly.
capture
I'll need to think a bit about a nice way to separate the build and blah blah...

@delroth
Copy link
Member

delroth commented Sep 1, 2014

Can we move the build separation to a following PR?

Would also really appreciate some documentation about running tests on Windows, the GTest extension, etc. :)

@shuffle2
Copy link
Contributor Author

shuffle2 commented Sep 2, 2014

@delroth It should be ready to merge now.
I decided not to have the "test" step only execute the tests...it will still compile if any changes are detected (nix/osx behaves the same way).

@shuffle2
Copy link
Contributor Author

shuffle2 commented Sep 2, 2014

BTW for VS users reading this, the easiest way to get the gtest adapter is:
extensions and updates->online->visual studio gallery
search for "gtest" and install GoogleTest Runner.
Then reopen VS, and Test Explorer will be functional.

delroth added a commit that referenced this pull request Sep 2, 2014
Provide a way to build and run unittests on Windows
@delroth delroth merged commit 5941653 into dolphin-emu:master Sep 2, 2014
@shuffle2 shuffle2 deleted the msvc-gtest branch September 2, 2014 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants