-
Notifications
You must be signed in to change notification settings - Fork 172
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
unittest's pkg-config file is incompatible with Debian/Ubuntu's #145
Comments
Thanks for the note. I'm tempted to say this is just a documentation issue, and we put something in the docs that say "if your distribution comes with UnitTest++ 1.4.0 pre-installed... do this thing different." Not sure there's a better way. Thoughts? |
My perspective is of someone writing code with tests that has to build on such systems, and on other systems, so really one has to do "both", not "different". |
How can we request Ubuntu to use the modern GitHub unittest++ rather than
the old SourceForge version?
GR
…Sent from my Nexus 6P
On 20 Jan 2017 3:41 am, "Patrick Johnmeyer" ***@***.***> wrote:
Thanks for the note. I'm tempted to say this is just a documentation
issue, and we put something in the docs that say "if your distribution
comes with UnitTest++ 1.4.0 pre-installed... do this thing different." Not
sure there's a better way. Thoughts?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#145 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEy9nGHwrbl3io578wHgmaBNbfrjCDtTks5rUBDKgaJpZM4LjeY0>
.
|
@grahamreeds There is already a Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=784665 (Ubuntu gets libunittest++ from Debian). This will probably be fixed sooner or later. That is not really the problem; the problem is that old unittest++ will continue to be available in supported versions of Debian and Ubuntu for some years. |
I'm going to assume that you are not able (for some reason) to bring along your own dependencies. Wouldn't it be fairly easy to, as part of your build process, bootstrap with some symlinks that make your project's include style work? That said, I don't see that there is anything UnitTest++ as a project can do about this. If you are dealing with a 1.6+ UnitTest++, you could always add an additional include path to your project, allowing your code to always just |
I'm not sure what you mean by "bring along your own dependencies". It's not common to package dependencies in source unless they're essential; easier to use system-supplied (and system-integrated) libraries and tools. In the case of unittest++, I'd certainly not expect to package it as part of a program that uses it for tests. Documenting "you could always add an additional include path to your project", with translations into code (e.g. for CMake and autotools) would be a reasonable workaround for code bases that have to deal with this situation. For example, in enchant, we currently have:
|
Just today I ran into this issue. Personally, I think the library maintainer trying to work around every OS package maintainer's choices is the road to perdition... so I fixed it in my code. I'm using CMake for my project, I'll present the solution here. First, I've always had the That header is named
Now in my cmake scripts I have some code to determine the Linux Distro and set the appropriate variables. That looks something like this:
UPDATE: I forgot to mention I had to modify my Find script.
It's a lot of work we shouldn't have had to do... but for whatever reason the Debian package maintainer is installing UT++ in a directory with lowercase naming... so it is what it is. |
Here's the full horror of what we've implemented in Enchant, which uses autoconf. Note that it includes backwards-compatibility with older pkg-config, and an extra tweak to work with Arch Linux, which ships a differently-broken pkgconfig file.
|
We had a similar discussion in the OpenSuse bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1010112 |
Debian & Ubuntu currently ship UnitTest++ 1.4.0, and have added their own pkg-config file, which unfortunately does things differently in two ways:
unittest++.pc
.-I/usr/include/unittest++
, so that the way to use UnitTest++ is#include <UnitTest++.h>
. Note that the installation path is lower case, so#include "UnitTest++/UnitTest++.h"
, as used in UnitTest++ documentation, will not work on Debian.I noticed this problem while working on a project with another developer who is using UnitTest++ 1.6, while I'm using Ubuntu's 1.4.
I guess it's too late for UnitTest++ to change its own pkg-config file, so unfortunately programs wanting to build on Debian and derivatives will for the foreseeable future have to do a double test, for both
unittest++
andUnitTest++
.Further, to avoid
#ifdef
fery when including the header, one of the pkg-config-supplied include paths will have to be changed by the build system, so the code can just#include <UnitTest++.h>
.This problem and the least invasive workaround should at least be documented, if there isn't a solution.
The text was updated successfully, but these errors were encountered: