diff options
author | hololeap <hololeap@protonmail.com> | 2023-10-02 23:09:56 -0600 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-10-23 04:10:10 +0100 |
commit | 0fc1c1b210a2d500bdf8af28ce51ef780bdbc378 (patch) | |
tree | 16896e581c81b0053daaee74168fbc7f0e14fb3c /dev-haskell/tasty-golden | |
parent | dev-haskell/tasty-expected-failure: Migrate to CABAL_CHDEPS (diff) | |
download | gentoo-0fc1c1b210a2d500bdf8af28ce51ef780bdbc378.tar.gz gentoo-0fc1c1b210a2d500bdf8af28ce51ef780bdbc378.tar.bz2 gentoo-0fc1c1b210a2d500bdf8af28ce51ef780bdbc378.zip |
dev-haskell/tasty-golden: add 2.3.5
Signed-off-by: hololeap <hololeap@protonmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-haskell/tasty-golden')
-rw-r--r-- | dev-haskell/tasty-golden/Manifest | 1 | ||||
-rw-r--r-- | dev-haskell/tasty-golden/files/tasty-golden-2.3.5-fix-tests.patch | 76 | ||||
-rw-r--r-- | dev-haskell/tasty-golden/metadata.xml | 7 | ||||
-rw-r--r-- | dev-haskell/tasty-golden/tasty-golden-2.3.5.ebuild | 80 |
4 files changed, 158 insertions, 6 deletions
diff --git a/dev-haskell/tasty-golden/Manifest b/dev-haskell/tasty-golden/Manifest index 3fc798d232db..c17d8d304d02 100644 --- a/dev-haskell/tasty-golden/Manifest +++ b/dev-haskell/tasty-golden/Manifest @@ -1 +1,2 @@ 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 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 +} |