dev-haskell/tasty-golden: add 2.3.5

Signed-off-by: hololeap <hololeap@protonmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
hololeap 2023-10-02 23:09:56 -06:00 committed by Sam James
parent 1f8dba8ff4
commit 0fc1c1b210
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
4 changed files with 158 additions and 6 deletions

View File

@ -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

View File

@ -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
)

View File

@ -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>

View File

@ -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
}