commit: 471145080920d7798f2e00a1001f7d454b29f02f
Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Mon May 8 18:53:50 2023 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Tue May 9 15:42:47 2023 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=47114508
crystal-utils.eclass: add crystal_spec function
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
eclass/crystal-utils.eclass | 8 ++++++++
eclass/shards.eclass | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/eclass/crystal-utils.eclass b/eclass/crystal-utils.eclass
index 3c0b7d48a..8456c5af6 100644
--- a/eclass/crystal-utils.eclass
+++ b/eclass/crystal-utils.eclass
@@ -164,4 +164,12 @@ crystal_build() {
ecrystal build "${build_args[@]}" "${@}"
}
+# @FUNCTION: crystal_spec
+# @USAGE: [<args>...]
+# @DESCRIPTION:
+# Function for running tests. All arguments are passed to crystal.
+crystal_spec() {
+ ecrystal spec --verbose "${@}" || die -n "Tests failed"
+}
+
fi
diff --git a/eclass/shards.eclass b/eclass/shards.eclass
index 122464cc5..5fd9f6c10 100644
--- a/eclass/shards.eclass
+++ b/eclass/shards.eclass
@@ -87,7 +87,7 @@ shards_src_test() {
debug-print-function ${FUNCNAME} "${@}"
if [[ -d "spec" ]]; then
- ecrystal spec --verbose "${@}" || die "Tests failed"
+ crystal_spec "${@}"
fi
return 0