summaryrefslogtreecommitdiff
path: root/dev-haskell/tasty-golden
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-23 08:35:49 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-23 08:35:49 +0100
commit386855c4d1ef509c1fd32abd721589c81669613b (patch)
tree35dc984118f0a7dc2df88313d83bb5779fd12514 /dev-haskell/tasty-golden
parent0118ac4510d7b85ca62da20e4abd1286dd8bd752 (diff)
gentoo auto-resync : 23:10:2023 - 08:35:49
Diffstat (limited to 'dev-haskell/tasty-golden')
-rw-r--r--dev-haskell/tasty-golden/Manifest5
-rw-r--r--dev-haskell/tasty-golden/files/tasty-golden-2.3.5-fix-tests.patch76
-rw-r--r--dev-haskell/tasty-golden/metadata.xml7
-rw-r--r--dev-haskell/tasty-golden/tasty-golden-2.3.5.ebuild80
4 files changed, 161 insertions, 7 deletions
diff --git a/dev-haskell/tasty-golden/Manifest b/dev-haskell/tasty-golden/Manifest
index aea6dddd0615..3e95459a29c8 100644
--- a/dev-haskell/tasty-golden/Manifest
+++ b/dev-haskell/tasty-golden/Manifest
@@ -1,3 +1,6 @@
+AUX tasty-golden-2.3.5-fix-tests.patch 3743 BLAKE2B 47bdaded8f05499d2ad3a0ff418617e24ce42e598f6e35a8a607477e615f9ed28f5014e49d23e225d69d5df5c8e07e36bed3c0c3fad453e8c88efb97d8d189b1 SHA512 6fc4e552d65dcb9b61d40e4e9a3dda4d5de4a1cac47a730411d822149a37a7f0165929a414b9884544473650f6576fe78f04ad3b4b49a9aabdd9edbda4e753b2
DIST tasty-golden-2.3.1.1.tar.gz 7219 BLAKE2B c6160ece4ce5a35d7acc6f390a15fd83c8a13951d5bf243576aca5c65b05b8de9f57ea6227745da57c4527bcbef093dc53c955c547bb5a1c909b195a9ee9ca77 SHA512 b7871d2ddcf7f45e0f1df52982b6370308dd0c48588318985977cb88f93f4b759b1f2bdff44e31ec86f230f04304bcee14286f62c2d2ae01a6105b8a3250e5fb
+DIST tasty-golden-2.3.5.tar.gz 15179 BLAKE2B 43d4749bca69b7be0b6cfa3f0c5e3fcbe503b6cd39912306656ccd80c71c2fd2fccbd0d4c56414a07717781e3a885856211c8b283ef51449286924cdd36d945b SHA512 e98935654b0df84a5bbfe36d772c0895b4bb50a6fcc30d305261c3845f7c8a5ab0c0d2297157809cb61fd230d567dadcd763b953d79d9fadeb8e6edb9af5980f
EBUILD tasty-golden-2.3.1.1.ebuild 845 BLAKE2B d748a773e8338fa8db1d7da5f07d59ce24a2d6697895454f989b7968f6bd97950fd98ad97b63b7060beb177e287a48c344e5ad9312ff008e4b8303137333c4ed SHA512 ac7a6f4e75482b54370e8865707bc9b03fdd7c3b403efcabc7b4a0bcb5ed492cfb4fa3de710d2891fb11fed0f43d42b3125d4d5401c65ea2d2db2da50e807387
-MISC metadata.xml 647 BLAKE2B 4ce8d660031c4a04076bf7beecbdfb6c88eb8753a536f447bfa18b94ab5936847bf90a55dbc8483ba855417051cc91bff697140d382ef19ee6be64aabbd8b7ad SHA512 2454a9ad7068588facbfd474c2f55d772275638e60f75ffec2ff7630186ae50f11ab4b84d81871f46c9c8121701efac1aaa32a1ff3e1094c064cbac657e8fbd0
+EBUILD tasty-golden-2.3.5.ebuild 1609 BLAKE2B 15bbaa88feda7731d75d6adc8dc873f4e20d38c63e42269b75c6ec3a021c90d27d0876513fdd9b1128d0d597937d146334385a192083c2a47e96543fe0431c6b SHA512 d231a722ba5c1181abd17c64c8dab9ef418985f230b71193d00c43d55e8426093a9fb7b2a895ef9e6ede5869db3ce75594502226a77b91171ba90f3cca8dd5a9
+MISC metadata.xml 396 BLAKE2B d1441854bb788f0a4e97f397d51830d02622a2031d35e0b7997ee2fa84e401e17185849136f006874eb8c2c78b0012af39aa9112e6efccd276f87d41c6dc2148 SHA512 35f139c60ff096d7742c5f04f1a7c7968cc073d0b94aba03727c09f7455b99e8401d1989d841c1952e6c7a69e4d2f3ccf01f357a0d7ce725f9814477ead5a180
diff --git a/dev-haskell/tasty-golden/files/tasty-golden-2.3.5-fix-tests.patch b/dev-haskell/tasty-golden/files/tasty-golden-2.3.5-fix-tests.patch
new file mode 100644
index 000000000000..bfdb79277ae9
--- /dev/null
+++ b/dev-haskell/tasty-golden/files/tasty-golden-2.3.5-fix-tests.patch
@@ -0,0 +1,76 @@
+From: hololeap <hololeap@protonmail.com>
+Signed-off-by: hololeap <hololeap@protonmail.com>
+
+* There was a slight discrepency between the expected and actual results
+ of the "before-golden" test, likely due to a change in tasty's output.
+
+* The example executable is renamed to tasty-golden-example in the ebuild
+ to prevent possible name collisions.
+
+diff -urN tasty-golden-2.3.5/tests/golden/before-accept.golden tasty-golden-2.3.5-r1/tests/golden/before-accept.golden
+--- tasty-golden-2.3.5/tests/golden/before-accept.golden 2020-02-21 05:21:09.000000000 -0700
++++ tasty-golden-2.3.5-r1/tests/golden/before-accept.golden 2022-11-04 13:15:02.987564783 -0600
+@@ -7,6 +7,7 @@
+ Failing tests
+ goldenVsFile: FAIL
+ Files 'example/golden/fail/goldenVsFile.golden' and 'example/golden/fail/goldenVsFile.actual' differ
++ Use -p '$0=="Tests.Failing tests.goldenVsFile"' to rerun this test only.
+ goldenVsFileDiff: FAIL
+ 1d0
+ < 1
+@@ -35,6 +36,7 @@
+ 169d156
+ <<truncated>
+ Use --accept or increase --size-cutoff to see full output.
++ Use -p '/Failing tests.goldenVsFileDiff/' to rerun this test only.
+ goldenVsString: FAIL
+ Test output was different from 'example/golden/fail/goldenVsString.golden'. It was:
+ 2
+@@ -87,8 +89,9 @@
+ 55
+ 56<truncated>
+ Use --accept or increase --size-cutoff to see full output.
++ Use -p '$0=="Tests.Failing tests.goldenVsString"' to rerun this test only.
+ goldenVsStringDiff: FAIL
+- Test output was different from 'example/golden/fail/goldenVsStringDiff.golden'. Output of ["diff","example/golden/fail/goldenVsStringDiff.golden","/tmp/goldenVsStringDiff.actual"]:
++ Test output was different from 'example/golden/fail/goldenVsStringDiff.golden'. Output of ["diff","example/golden/fail/goldenVsStringDiff.golden","/var/tmp/portage/dev-haskell/tasty-golden-2.3.5/temp/goldenVsStringDiff.actual"]:
+ 1d0
+ < 1
+ 4d2
+@@ -116,5 +119,6 @@
+ 169d156
+ <<truncated>
+ Use --accept or increase --size-cutoff to see full output.
++ Use -p '/Failing tests.goldenVsStringDiff/' to rerun this test only.
+
+ 4 out of 8 tests failed
+diff -urN tasty-golden-2.3.5/tests/test.hs tasty-golden-2.3.5-r1/tests/test.hs
+--- tasty-golden-2.3.5/tests/test.hs 2021-02-24 06:27:55.000000000 -0700
++++ tasty-golden-2.3.5-r1/tests/test.hs 2022-11-04 13:04:13.007572500 -0600
+@@ -89,7 +89,7 @@
+ -- timings.
+ --
+ -- NB: cannot use multiline literals because of CPP.
+- let cmd = shell ("cd " ++ tmp ++ " && example | " ++
++ let cmd = shell ("cd " ++ tmp ++ " && tasty-golden-example | " ++
+ "sed -Ee 's/[[:digit:]-]+\\.actual/.actual/g; s/ \\([[:digit:].]+s\\)//' > " ++
+ our</>"tests/golden/before-accept.actual || true")
+ runProcess_ cmd
+@@ -102,7 +102,7 @@
+ (do
+ tmp <- tmpIO
+ our <- getCurrentDirectory
+- let cmd = shell ("cd " ++ tmp ++ " && example --accept | sed -Ee 's/ \\([[:digit:].]+s\\)//' > " ++
++ let cmd = shell ("cd " ++ tmp ++ " && tasty-golden-example --accept | sed -Ee 's/ \\([[:digit:].]+s\\)//' > " ++
+ our </>"tests/golden/with-accept.actual")
+ runProcess_ cmd
+ )
+@@ -114,7 +114,7 @@
+ (do
+ tmp <- tmpIO
+ our <- getCurrentDirectory
+- let cmd = shell ("cd " ++ tmp ++ " && example | sed -Ee 's/ \\([[:digit:].]+s\\)//' > " ++
++ let cmd = shell ("cd " ++ tmp ++ " && tasty-golden-example | sed -Ee 's/ \\([[:digit:].]+s\\)//' > " ++
+ our</>"tests/golden/after-accept.actual")
+ runProcess_ cmd
+ )
diff --git a/dev-haskell/tasty-golden/metadata.xml b/dev-haskell/tasty-golden/metadata.xml
index 113e8620095b..eeae1e3d3b3f 100644
--- a/dev-haskell/tasty-golden/metadata.xml
+++ b/dev-haskell/tasty-golden/metadata.xml
@@ -5,13 +5,8 @@
<email>haskell@gentoo.org</email>
<name>Gentoo Haskell</name>
</maintainer>
- <longdescription>
- This package provides support for «golden testing».
- A golden test is an IO action that writes its result to a file.
- To pass the test, this output file should be identical to the corresponding
- 'golden' file, which contains the correct result for the test.
- </longdescription>
<upstream>
+ <remote-id type="hackage">tasty-golden</remote-id>
<remote-id type="github">UnkindPartition/tasty-golden</remote-id>
</upstream>
</pkgmetadata>
diff --git a/dev-haskell/tasty-golden/tasty-golden-2.3.5.ebuild b/dev-haskell/tasty-golden/tasty-golden-2.3.5.ebuild
new file mode 100644
index 000000000000..95bcf980ebb6
--- /dev/null
+++ b/dev-haskell/tasty-golden/tasty-golden-2.3.5.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# ebuild generated by hackport 0.7.3.0
+#hackport: flags: build-example:examples
+
+CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
+inherit haskell-cabal
+
+DESCRIPTION="Golden tests support for tasty"
+HOMEPAGE="https://github.com/UnkindPartition/tasty-golden"
+
+LICENSE="MIT"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="examples"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.3.5-fix-tests.patch"
+)
+
+CABAL_CHDEPS=(
+ 'executable example' "executable ${PN}-example"
+)
+
+CABAL_TEST_REQUIRED_BINS=(
+ "${PN}-example"
+)
+
+RDEPEND="
+ dev-haskell/async:=[profile?]
+ >=dev-haskell/optparse-applicative-0.3.1:=[profile?]
+ dev-haskell/tagged:=[profile?]
+ >=dev-haskell/tasty-1.3:=[profile?]
+ dev-haskell/temporary:=[profile?]
+ dev-haskell/typed-process:=[profile?]
+ >=dev-lang/ghc-8.4.3:=
+"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-2.2.0.1
+ test? (
+ dev-haskell/tasty-hunit
+ )
+"
+
+src_configure() {
+ if use examples || use test; then
+ local example_flag=build-example
+ else
+ local example_flag=-build-example
+ fi
+
+ haskell-cabal_src_configure \
+ --flag="${example_flag}"
+}
+
+src_install() {
+ local components=(
+ "lib:${PN}"
+ )
+
+ if use examples; then
+ components+=(
+ "exe:${PN}-example"
+ )
+ fi
+
+ haskell-cabal_src_install "${components[@]}"
+}
+
+pkg_postinst() {
+ if use examples; then
+ elog "The example executable installed with this package (normally named 'example')"
+ elog "has been renamed to '${PN}-example' to help prevent name collisions."
+ fi
+
+ haskell-cabal_pkg_postinst
+}