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

TST/CI: Add post-install tests for CMake, pkg-config, and geos-config #429

Closed
wants to merge 1 commit into from

Conversation

mwtoews
Copy link
Contributor

@mwtoews mwtoews commented Apr 2, 2021

The primary objective with this PR is to test installing GEOS on a host, and run post-install tests that build and link apps based on the installed library. CMake, pkg-config, and geos-config solutions are tested independently. Autoconf and automake are also tested from a CMake-built library.

This largely supersedes #346, when autotools was natively supported.

See Trac #1113.

@mwtoews mwtoews force-pushed the postinstall2 branch 2 times, most recently from 18c825f to 8651b0c Compare April 9, 2021 10:19
@mwtoews mwtoews force-pushed the postinstall2 branch 5 times, most recently from 78428dd to 31e74fc Compare April 10, 2021 02:26
@mwtoews mwtoews marked this pull request as ready for review April 10, 2021 02:31
@mwtoews
Copy link
Contributor Author

mwtoews commented Apr 10, 2021

Ready for review for anyone willing to go thru a patch with C/C++/Autoconf/Automake/Make/CMake/POSIX sh/Windows BAT/YAML in it.

The non-GitHub linked CI tests have not been verified yet.

@pramsey
Copy link
Member

pramsey commented Apr 11, 2021

This is a very large and finicky piece of work to bring in, touching as it does every CI target. Having done only small and easy bits of CI work and seen them eat multiple days each time I shrink from picking this up on pure laziness grounds. Do we break external build frequently?

@mwtoews
Copy link
Contributor Author

mwtoews commented Apr 11, 2021

Two recent issues that I've discovered while developing the previous post-install tests include:

  1. gh-347
  2. gh-326

Probably most of these would have eventually been picked up on an alpha/beta/RC phase, but not always.

The post-install tests can also be run on other installations of libgeos, e.g. from conda. Just run the script with a different prefix.

@mwtoews
Copy link
Contributor Author

mwtoews commented Apr 12, 2021

Because there's lots going on in this PR, here is my English version of the methods:

There are three ways to link a program to libgeos:

  1. CMake via find_package(GEOS REQUIRED) (docs)
  2. geos-config used in (e.g.) a Makefile, like using geos-config --cflags to set CFLAGS
  3. pkg-config used in (e.g.) a Makefile, or Autoconf via PKG_CHECK_MODULES([GEOS], [geos]) (docs)

In the post-install suite, there are two trivial "apps" that are built against libgeos:

  1. C app using the C API, checked by all three methods
  2. C++ app using the C++ API, checked by CMake and geos-config methods (but not pkg-config)

Besides testing a successful compilation, each build goes through two checks:

  1. The programs just print the GEOS version to stdout, so check this output against what is known by CMake/geos-config/pkg-config
  2. Where possible, check the output of ldd (or whatever is native) to check that it contains a reference to libgeos / geos.dll. I'm not sure how MSVC does this, so these tests are skipped.

The checks are written using CTest (in the CMakeLists.txt files) or POSIX sh for geos-config/pkg-config (Automake supports a handy TESTS variable).

@pramsey
Copy link
Member

pramsey commented Apr 16, 2021

@robe2 any chance I can suck you into this? You have visibility into more CI envs than anyone else...

@robe2
Copy link
Member

robe2 commented Nov 5, 2021

@robe2 any chance I can suck you into this? You have visibility into more CI envs than anyone else...

Sorry just saw this. I haven't read thru it all but can probably look at it in a week or so.

@mwtoews
Copy link
Contributor Author

mwtoews commented Nov 5, 2021

@robe2 I haven't mentioned here, but I'm already scheming a 3rd version of this test suite that checks static and dynamic libraries. It's on my laptop, but not done yet. So a review can wait until it's ready.

@dbaston dbaston added the CMake label Dec 7, 2021
@robe2
Copy link
Member

robe2 commented May 16, 2022

@mwtoews Where did we leave off on this?

@mwtoews
Copy link
Contributor Author

mwtoews commented May 16, 2022

It's still on my todo list. Let's close this one for now, and I'll open a new PR when ready. It should look similar to the one for PROJ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants