Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

PARQUET-437: Add googletest setup and ADD_PARQUET_TEST helper#19

Closed
wesm wants to merge 4 commits intoapache:masterfrom
wesm:googletest-infra
Closed

PARQUET-437: Add googletest setup and ADD_PARQUET_TEST helper#19
wesm wants to merge 4 commits intoapache:masterfrom
wesm:googletest-infra

Conversation

@wesm
Copy link
Copy Markdown
Member

@wesm wesm commented Jan 19, 2016

I adapted this functionality from Apache Kudu (incubating). There are no real unit tests, yet, but you can now run ctest after building to run all tests that have been created with ADD_PARQUET_TEST.

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 19, 2016

I think I got an older version of gtest, let me try updating to 1.7.0.

@wesm wesm force-pushed the googletest-infra branch from 16b54c7 to e237a55 Compare January 19, 2016 22:43
@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 19, 2016

OK, this is now googletest 1.7.0 with the source files manually inlined into gtest-all.cc to simplify compilation.

@nongli
Copy link
Copy Markdown
Contributor

nongli commented Jan 19, 2016

Why are we inlining the source?

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 19, 2016

Here was the original https://github.com/google/googletest/blob/release-1.7.0/src/gtest-all.cc. I can omit gtest-all.cc and instead list out each of the individual sources

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 19, 2016

Either way is fine with me

@nongli
Copy link
Copy Markdown
Contributor

nongli commented Jan 20, 2016

Why are we adding the gtest source into this repo? This seems different than how we manage other third party dependencies.

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 20, 2016

Let me set things up to make googletest the same as the other thirdparty libraries

@nongli
Copy link
Copy Markdown
Contributor

nongli commented Jan 20, 2016

Thanks. I think kudu was particularly fancy and has patched it but I don't think we need that yet. If we do, we can think harder about how to deal with cases like that.

@wesm wesm force-pushed the googletest-infra branch from e237a55 to add00eb Compare January 20, 2016 01:09
@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 20, 2016

Annoyingly googletest is blacklisted in homebrew. Almost have this working

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 20, 2016

@nongli OK, I got the build working. The Linux compiler settings were messing up OS X but I fixed that finally

.travis.yml Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this pull this from thirdparty/versions.sh?

@nongli
Copy link
Copy Markdown
Contributor

nongli commented Jan 20, 2016

Thanks for doing this. Can you add a quick update to the README and the end of the build step on how to run tests?

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 20, 2016

Sure thing.

@wesm wesm force-pushed the googletest-infra branch from 037ecea to 2fbedf2 Compare January 20, 2016 21:33
@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 20, 2016

Something's up with Travis. I pushed commits to address the comments and the builds errored with no logs. Trying a touched version of the last passing build

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 20, 2016

@wesm wesm force-pushed the googletest-infra branch 2 times, most recently from 423c99d to 24250f5 Compare January 21, 2016 04:23
@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 21, 2016

Okay, after a few bash mishaps we are back to green. @nongli have a look and lmk if any more comments.

…d support scripts for using ctest after make
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work for me. I think build_thirdparty leaves the working directory in build/.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking now

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 25, 2016

@nongli fixed; this was already fixed this in #23 actually

@nongli
Copy link
Copy Markdown
Contributor

nongli commented Jan 26, 2016

How do you run setup_build_env.sh? If i just run it

./setup_build_env.sh, it doesn't set *_HOME so cmake . can't find them.

If I source it, it seems to mess up the shell environment (I think -e is set).

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 26, 2016

It should work now

@nongli
Copy link
Copy Markdown
Contributor

nongli commented Jan 26, 2016

Running into this now. Any ideas? The version mismatch is weird.

ld: warning: object file (../../build/thirdparty/googletest-release-1.7.0/libgtest.a(gtest-all.cc.o)) was built for newer OSX version (10.10) than being linked (10.9)
Undefined symbols for architecture x86_64:
  "testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)", referenced from:
      ___cxx_global_var_init in reader-test.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 26, 2016

I think that's an -fPIC issue, let me try to build from scratch on my Mac

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 26, 2016

I was able to compile without making any changes but I made sure that gtest is being compiled with -fPIC (it was not before, I think that's your linker error). I also removed the CMAKE_OSX_DEPLOYMENT_TARGET which was causing the ld version warning.

@nongli
Copy link
Copy Markdown
Contributor

nongli commented Jan 26, 2016

@wesm can you remove the brackets in the title. I'll merge this.

@wesm wesm changed the title [PARQUET-437]: Add googletest setup and ADD_PARQUET_TEST helper PARQUET-437: Add googletest setup and ADD_PARQUET_TEST helper Jan 26, 2016
@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 26, 2016

done

@asfgit asfgit closed this in b31baa0 Jan 26, 2016
@nongli
Copy link
Copy Markdown
Contributor

nongli commented Jan 26, 2016

@wesm merged. Thanks!

@wesm
Copy link
Copy Markdown
Member Author

wesm commented Jan 26, 2016

thanks!

@wesm wesm deleted the googletest-infra branch January 26, 2016 18:30
majetideepak pushed a commit to majetideepak/parquet-cpp that referenced this pull request Jan 26, 2016
I adapted this functionality from Apache Kudu (incubating). There are no real unit tests, yet, but you can now run `ctest` after building to run all tests that have been created with `ADD_PARQUET_TEST`.

Author: Wes McKinney <wes@cloudera.com>

Closes apache#19 from wesm/googletest-infra and squashes the following commits:

758328f [Wes McKinney] BLD: disable fixed OSX deployment target. Compile gtest with -fPIC
61cc5bb [Wes McKinney] Remove 'set -e' from setup_build_env.sh
6435970 [Wes McKinney] Fix setup_build_env.sh script
a54a219 [Wes McKinney] Add googletest to thirdparty and add ADD_PARQUET_TEST cmake helper and support scripts for using ctest after make
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants