Klemens Nanni <[email protected]> wrote:
> I have no fix for this but would like to get tests enabled where
> possible.
>
> Since enabling tests breaks the build and thus the package, how about
> disabling tests on sparc6?
>
> I guess some other arch will fail as well, but we can still fix that
> once bulk reports come in.
(we could also enable the tests only on amd64 and then add other arches
when we test them)
> Until then, at least amd64 gets test coverage and we can work on it
> in-tree.
>
> Feedback? Objection? OK?
> In case nothing comes up I'll just commit this in a few days.
I hoped we could avoid this kind of conditional for tests, but since we
don't it's ok for me. Just one comment:
> +.include <bsd.port.arch.mk>
> +.if ${MACHINE_ARCH} == "sparc64"
AFAIK there's no need to pull in bsd.port.arch.mk, MACHINE_ARCH is
available outside of it.
> +# XXX hash/hash_test.cc:614:22: error: use of deleted function
> 'absl::lts_20211102::hash_internal::PoisonedHash::PoisonedHash()'
> NO_TEST = Yes
> +.else
> +# use googletest from ports
> +CONFIGURE_ARGS +=
> -DABSL_USE_EXTERNAL_GOOGLETEST:BOOL=${LOCALBASE}/include/gtest
> +# turn on tests builds
> +CONFIGURE_ARGS += -DBUILD_TESTING:BOOL=ON
you could also close the conditional here: if NO_TEST is set to "Yes" I
guess TEST_ENV and pre-test are ignored too. (not tested and just a
nit, i'm fine either the way.) Even if pre-test would run it's not
doing anything important and `make test' is not a step done in package
building anyway. your call :)
> +# use TEST_TMPDIR instead of /tmp for tests temp data (like in bazel build)
> +TEST_ENV += TEST_TMPDIR=${WRKBUILD}/test_tmp \
> + LD_LIBRARY_PATH=/usr/lib:${WRKBUILD}/test_lib
> +
> +pre-test:
> + @mkdir -p ${WRKBUILD}/test_tmp
> + @mkdir -p ${WRKBUILD}/test_lib
> + cd ${WRKBUILD}/test_lib && \
> + find ${WRKBUILD} -name "*\.so\.*\.*" | xargs -I {} ln -s {} .
> +.endif
>
> .include <bsd.port.mk>