From nobody Sat Aug 27 17:53:22 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MFPSf2bwFz4ZtBw; Sat, 27 Aug 2022 17:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MFPSf2CB6z3rRP; Sat, 27 Aug 2022 17:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661622802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dfqjpPvbm28RXEwk/s3MoiLVI+AZOpql9lhnm/4TYNw=; b=GWhxMF/Ulywl3fqCfbaCg+DblY5catKai1zwt6b3wyp7j0vbm+/W3Eym1PIH9+b7aSuVho wFx4/DuyOx2VY/rshurYwS8ZUo3v3+X9mVlcWt8SVMZAlZ0owxTbNlWkLo/XLQ/7Ln9NTj f5tMwyTlk+FokcfPYL2AVdRt3Qnpv1yHjy4wOag7+KyUGYlGJA95cswxZsMoQVrRbT4dLK jq8ei5c0G8/OLZ8YXH6V60bJ88jPsiSZJ6uwzyrwy0L1b319aM/QnYAhPMESrccZ1Io++w d2K8dCotSnqrwCLXlu4QsGZcpwCz0xXFcH+zXNjZl3D13WWYW93stz8iIsGMPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MFPSf1HjMzq51; Sat, 27 Aug 2022 17:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27RHrMi6001809; Sat, 27 Aug 2022 17:53:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27RHrMnS001808; Sat, 27 Aug 2022 17:53:22 GMT (envelope-from git) Date: Sat, 27 Aug 2022 17:53:22 GMT Message-Id: <202208271753.27RHrMnS001808@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 5b8dd2d0c6fc - main - science/dimod: Fix tests List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b8dd2d0c6fcb225f099355a18e29f4736dffb57 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661622802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dfqjpPvbm28RXEwk/s3MoiLVI+AZOpql9lhnm/4TYNw=; b=iElJ9q982RffEQTpXrnIbTu+W5yXuHawCAUPPOIWXH2jtFS3wdXWN6vVlaPIjg7xd8I2C6 edBEdyh+kkkv+V3QHPc605ABmAQ+GNf1sNrsr80erW58nIj2R80QnhDfeiqsoaGM8KBOa9 RBx4m/ZFOkl7rLAB0luSlIe6dGSpzJq2opPqEeAAle41l2KeNJBhPEx7vKb75Vp/qhttge J18TtIBxfqp14Nhc8La2rY0hR0FlwBSqNTe/SFFVN8l7T76LDoZ6arlrWvHs1MmXlWInlP TfKkJ4q5BXqBiQgS2UfT4Xegng3nGOF7ae1gP5gu4dJvXaF2iyGBmyS2nV8+OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661622802; a=rsa-sha256; cv=none; b=j6lJPAap7n0pPCpkI65zlUphDBT1eaygmYuC0rfPF947QcUyvoZbhH0yW1arspiKZ9VqRb HS/R+rdmDybS2i7tCv37nc/5YORH91WJ6CnCYmdbnk1taRgrIYqEAI+iEi2LdLUnWSFKK7 7AqIwJtnhJWO5JQx9w24d6oP7Hfu/nzhqvu5+lVigLVo7D+6sXHtvYMhXd1D9sxtafjjVk BMyXrhGg81PGf3uNu0j0ZWDK68veaJpnTl73sS9hg9+prUsl8uH/2a7acMzK7xm200zDbS +3+g5c1/+TA7AzuFYngPitghkHtosNKylb+/As+zGI2MsqLYgaZc8PLZyV/aCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=5b8dd2d0c6fcb225f099355a18e29f4736dffb57 commit 5b8dd2d0c6fcb225f099355a18e29f4736dffb57 Author: Yuri Victorovich AuthorDate: 2022-08-27 17:50:29 +0000 Commit: Yuri Victorovich CommitDate: 2022-08-27 17:53:10 +0000 science/dimod: Fix tests --- science/dimod/Makefile | 7 +++++-- science/dimod/files/patch-testscpp_Makefile | 18 ++++++++++++++++++ science/dimod/files/patch-testscpp_test__main.cpp | 9 +++++++++ .../patch-testscpp_tests_test__quadratic__model.cpp | 11 +++++++++++ .../dimod/files/patch-testscpp_tests_test__utils.cpp | 11 +++++++++++ 5 files changed, 54 insertions(+), 2 deletions(-) diff --git a/science/dimod/Makefile b/science/dimod/Makefile index 4d59970402e3..21da4eff0726 100644 --- a/science/dimod/Makefile +++ b/science/dimod/Makefile @@ -8,9 +8,12 @@ COMMENT= DWave: Shared API for QUBO/Ising samplers LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE +TEST_DEPENDS= catch>0:devel/catch + +USES= compiler:c++11-lang pkgconfig + USE_GITHUB= yes GH_ACCOUNT= dwavesystems -GH_TUPLE= catchorg:Catch2:f0dc4d9:catch/testscpp/Catch2 NO_BUILD= yes NO_ARCH= yes @@ -26,7 +29,7 @@ do-install: cd ${WRKSRC}/dimod/include && \ ${COPYTREE_SHARE} dimod ${STAGEDIR}${PREFIX}/include -do-test: # tests fail to compile, see https://github.com/dwavesystems/dimod/issues/1238 +do-test: @cd ${WRKSRC}/testscpp && ${SETENV} ${MAKE_ENV} ${MAKE} .include diff --git a/science/dimod/files/patch-testscpp_Makefile b/science/dimod/files/patch-testscpp_Makefile new file mode 100644 index 000000000000..f0f295b10761 --- /dev/null +++ b/science/dimod/files/patch-testscpp_Makefile @@ -0,0 +1,18 @@ +--- testscpp/Makefile.orig 2022-08-16 14:45:27 UTC ++++ testscpp/Makefile +@@ -13,12 +13,12 @@ coverage: + rm baseline.info test.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + +-tests: test_main.out ++tests: test_main + ./test_main + + test_main: test_main.cpp +- g++ -std=c++11 -Wall -Werror -c test_main.cpp +- g++ -std=c++11 -Wall -Werror test_main.o tests/*.cpp -o test_main -I $(SRC) ++ g++ $(CXXFLAGS) `pkg-config --cflags catch2` -std=c++11 -Wall -c test_main.cpp ++ g++ $(CXXFLAGS) `pkg-config --cflags --libs catch2` -std=c++11 -Wall test_main.o tests/*.cpp -o test_main -I $(SRC) + + catch2: + git submodule init diff --git a/science/dimod/files/patch-testscpp_test__main.cpp b/science/dimod/files/patch-testscpp_test__main.cpp new file mode 100644 index 000000000000..bb485e158894 --- /dev/null +++ b/science/dimod/files/patch-testscpp_test__main.cpp @@ -0,0 +1,9 @@ +--- testscpp/test_main.cpp.orig 2022-08-27 15:45:50 UTC ++++ testscpp/test_main.cpp +@@ -1,5 +1,5 @@ + #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file +-#include "Catch2/single_include/catch2/catch.hpp" ++#include + + /* + The purpose of this file is to include Catch's main(). Tests can be found inside tests directory. diff --git a/science/dimod/files/patch-testscpp_tests_test__quadratic__model.cpp b/science/dimod/files/patch-testscpp_tests_test__quadratic__model.cpp new file mode 100644 index 000000000000..b29152b9e491 --- /dev/null +++ b/science/dimod/files/patch-testscpp_tests_test__quadratic__model.cpp @@ -0,0 +1,11 @@ +--- testscpp/tests/test_quadratic_model.cpp.orig 2022-08-27 15:54:59 UTC ++++ testscpp/tests/test_quadratic_model.cpp +@@ -14,7 +14,7 @@ + + #include + +-#include "../Catch2/single_include/catch2/catch.hpp" ++#include + #include "dimod/quadratic_model.h" + + namespace dimod { diff --git a/science/dimod/files/patch-testscpp_tests_test__utils.cpp b/science/dimod/files/patch-testscpp_tests_test__utils.cpp new file mode 100644 index 000000000000..6283681a7a6b --- /dev/null +++ b/science/dimod/files/patch-testscpp_tests_test__utils.cpp @@ -0,0 +1,11 @@ +--- testscpp/tests/test_utils.cpp.orig 2022-08-27 15:49:35 UTC ++++ testscpp/tests/test_utils.cpp +@@ -15,7 +15,7 @@ + #include + #include + +-#include "../Catch2/single_include/catch2/catch.hpp" ++#include + #include "dimod/utils.h" + + namespace dimod {