* [gentoo-commits] repo/gentoo:master commit in: dev-lang/nim/files/, profiles/arch/amd64/x32/, dev-lang/nim/
@ 2023-01-11 3:53 Maciej Barć
0 siblings, 0 replies; only message in thread
From: Maciej Barć @ 2023-01-11 3:53 UTC (permalink / raw
To: gentoo-commits
commit: 88d533201c2b782f3abb14812215fb8b3da7cd12
Author: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Sat Nov 26 13:38:40 2022 +0000
Commit: Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Wed Jan 11 03:44:06 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88d53320
dev-lang/nim: enable tests
Some categories are skipped:
* arc, valgrind: need function valgrind
* ic: random failures
Signed-off-by: Anna Vyalkova <cyber+gentoo <AT> sysrq.in>
Closes: https://github.com/gentoo/gentoo/pull/29006
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>
.../nim/files/nim-1.6.10-testament-skipfile.txt | 40 +++++++++++++
dev-lang/nim/metadata.xml | 1 +
dev-lang/nim/nim-1.6.10-r2.ebuild | 67 ++++++++++++++++++++--
profiles/arch/amd64/x32/package.use.mask | 1 +
4 files changed, 105 insertions(+), 4 deletions(-)
diff --git a/dev-lang/nim/files/nim-1.6.10-testament-skipfile.txt b/dev-lang/nim/files/nim-1.6.10-testament-skipfile.txt
new file mode 100644
index 000000000000..46d22c9fe915
--- /dev/null
+++ b/dev-lang/nim/files/nim-1.6.10-testament-skipfile.txt
@@ -0,0 +1,40 @@
+# broken
+tests/assert/tassert_c.nim
+tests/async/tasync_traceback.nim
+tests/errmsgs/tcall_with_default_arg.nim
+tests/errmsgs/tproper_stacktrace.nim
+tests/errmsgs/tproper_stacktrace2.nim
+tests/errmsgs/tproper_stacktrace3.nim
+tests/js/tmangle.nim
+tests/js/twritestacktrace.nim
+tests/lent/tbasic_lent_check.nim
+tests/misc/trunner.nim
+tests/misc/tstrace.nim
+tests/pragmas/thintprocessing.nim
+tests/pragmas/tused.nim
+tests/pragmas/twarning_off.nim
+tests/stdlib/tos.nim
+tests/stdlib/tstackframes.nim
+tests/stdlib/tstats.nim
+tests/system/talloc.nim
+tests/testament/tshould_not_work.nim
+# require network
+tests/stdlib/thttpclient.nim
+tests/stdlib/tnetconnect.nim
+tests/stdlib/tssl.nim
+# don't work without megatest
+tests/misc/tjoinable.nim
+tests/testament/tjoinable.nim
+# don't work with "--hint:all:off" hack
+tests/concepts/t3330.nim
+tests/stylecheck/t20397_2.nim
+tests/stylecheck/treject.nim
+tests/stylecheck/tusages.nim
+# need external dependencies
+tests/manyloc/keineschweine/keineschweine.nim
+tests/manyloc/nake/nakefile.nim
+tests/niminaction/Chapter7/Tweeter/src/tweeter.nim
+# need functional valgrind
+tests/destructor/tnewruntime_strutils.nim
+tests/destructor/tv2_raise.nim
+tests/views/tsplit_into_openarray.nim
diff --git a/dev-lang/nim/metadata.xml b/dev-lang/nim/metadata.xml
index d24270e82fb6..b544028faf59 100644
--- a/dev-lang/nim/metadata.xml
+++ b/dev-lang/nim/metadata.xml
@@ -38,5 +38,6 @@
</upstream>
<use>
<flag name="experimental">Apply experimental patches</flag>
+ <flag name="test-js">Enable tests that require Node.js</flag>
</use>
</pkgmetadata>
diff --git a/dev-lang/nim/nim-1.6.10-r2.ebuild b/dev-lang/nim/nim-1.6.10-r2.ebuild
index 5140ee232527..5bbd9b8328f5 100644
--- a/dev-lang/nim/nim-1.6.10-r2.ebuild
+++ b/dev-lang/nim/nim-1.6.10-r2.ebuild
@@ -19,10 +19,29 @@ SRC_URI="
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
-IUSE="doc experimental"
-RESTRICT="test" # need to sort out depends and numerous failures
+IUSE="doc experimental test-js test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ test? (
+ dev-db/sqlite:3
+ dev-libs/boehm-gc
+ dev-libs/libffi
+ dev-libs/libpcre:3
+ dev-libs/openssl
+ media-libs/libsdl
+ media-libs/libsfml
+ )
+"
-BDEPEND="sys-process/parallel"
+BDEPEND="
+ sys-process/parallel
+ test? (
+ test-js? (
+ net-libs/nodejs
+ )
+ )
+"
PATCHES=(
"${FILESDIR}"/${PN}-0.20.0-paths.patch
@@ -51,6 +70,9 @@ nim_gen_config() {
$([[ "${NOCOLOR}" == true || "${NOCOLOR}" == yes ]] && echo '--colors:"off"')
-d:"release"
--parallelBuild:"$(makeopts_jobs)"
+
+ # some tests don't work with processing hints
+ --processing:"off"
EOF
}
@@ -105,8 +127,45 @@ src_compile() {
src_test() {
local -x PATH="${S}/bin:${PATH}"
+ local nimflags=(
+ # Leave only the safe hints enabled
+ --hint:all:off
+ --hint:User:on
+ --hint:UserRaw:on
+ )
+ local testament_args=(
+ --skipFrom:"${FILESDIR}/${P}-testament-skipfile.txt"
+ --nim:"bin/nim"
+ --targets:"$(usex test-js 'c js' 'c')"
+ )
+
+ [[ "${NOCOLOR}" == true || "${NOCOLOR}" == yes ]] && \
+ testament_args+=( --colors:off )
+
+ local -a categories
+ readarray -t categories < <(find tests -mindepth 1 -maxdepth 1 -type d -printf "%P\n" | sort)
+
+ # AdditionalCategories from "testament/categories.nim"
+ categories+=( debugger examples lib )
- edo ./koch test
+ local tcat checkpoint
+ for tcat in "${categories[@]}"; do
+ # Use checkpoints for less painful testing
+ checkpoint="${T}/.testament-${tcat}"
+ [[ -f "${checkpoint}" ]] && continue
+
+ case ${tcat} in
+ testdata) ;;
+ arc|ic|valgrind)
+ einfo "Skipped category '${tcat}'" ;;
+ *)
+ einfo "Running tests in category '${tcat}'"
+ edo ./bin/testament "${testament_args[@]}" \
+ category "${tcat}" "${nimflags[@]}"
+ esac
+
+ touch "${checkpoint}" || die
+ done
}
src_install() {
diff --git a/profiles/arch/amd64/x32/package.use.mask b/profiles/arch/amd64/x32/package.use.mask
index 9e25c7136ea1..5bc1efcfa711 100644
--- a/profiles/arch/amd64/x32/package.use.mask
+++ b/profiles/arch/amd64/x32/package.use.mask
@@ -41,6 +41,7 @@ www-servers/uwsgi uwsgi_plugins_rados
# Michał Górny <mgorny@gentoo.org> (2018-01-12)
# Those packages require net-libs/nodejs.
+dev-lang/nim test-js
dev-python/nbdime webtools
dev-ruby/ammeter test
dev-ruby/jsobfu test
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-11 3:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-11 3:53 [gentoo-commits] repo/gentoo:master commit in: dev-lang/nim/files/, profiles/arch/amd64/x32/, dev-lang/nim/ Maciej Barć
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox