eclipse-mosquitto / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
9.05k stars 2.39k forks source link

tests do not work via cmake on BSD, due to assumption that /usr/bin/make is GNU make #1242

Open gdt opened 5 years ago

gdt commented 5 years ago

Running "gmake tests" results in a failure, apparently because ctest somehow invokes /usr/bin/make rather than finding/using GNU make. The command that is run is /usr/pkg/bin/ctest --force-new-ctest-process which leads to 1: Test command: /usr/bin/make "-C" "/home/n0/gdt/pkgsrc-current/pkgsrc/wip/mosquitto/work/mosquitto-1.6.1/test" "test"

I would address this by somehow having MAKE=${MAKE} put into the environment and respected, as the top-level gmake test (from the pkgsrc wrapper) should have MAKE set to gmake.

gdt commented 5 years ago

In CMakeLists.txt, changing make to gmake in the add_test line results in getting further. Obviously this is not an ok solution.

A further problem is in lib/util_mosq.c, where the following patch (in two places) avoids a syntax error during tests.

-#elif defined(__GLIBC__) && __GLIBC_PREREQ(2, 25)
+#elif defined(__GLIBC__)
ralight commented 5 years ago

Sorry Greg, I really should have anticipated the make problem.

gdt commented 5 years ago

No need to apologize - we are making progress at quite a good pace.

ckrey commented 2 weeks ago

I think this issue can be closed as solved

gdt commented 2 weeks ago

@ckrey Do you mean that you have successfully run tests using the cmake build flavaor on systems where /usr/bin/make is not gmake? Which ones? With the latest release? master?

ckrey commented 2 weeks ago

@gdt sorry, I didn't read carefully and misunderstood