dev-lang/crystal: add EXTRA_SPEC_FLAGS variable
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 10 Nov 2018 11:35:59 +0000 (11:35 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 10 Nov 2018 11:36:13 +0000 (11:36 +0000)
This allows running only individual crystal tests
in src_test() phase. Useful to quickly debug single test:
    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal

Package-Manager: Portage-2.3.51, Repoman-2.3.12
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
dev-lang/crystal/crystal-0.27.0.ebuild
dev-lang/crystal/files/crystal-0.27.0-extra-spec-flags.patch [new file with mode: 0644]

index 71778f6c2c187cb746c0aee55bc1969c39c2bdd6..b7dcd5f70cfef5de0fa4c08e592a7b476676787b 100644 (file)
@@ -43,6 +43,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-0.25.0-verbose.patch
        "${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
        "${FILESDIR}"/${PN}-0.26.1-gentoo-tests-network-sandbox-3.patch
+       "${FILESDIR}"/${PN}-0.27.0-extra-spec-flags.patch
 )
 
 src_prepare() {
@@ -77,6 +78,9 @@ src_compile() {
 }
 
 src_test() {
+       # EXTRA_SPEC_FLAGS is useful to debug individual tests
+       # as part of full build:
+       #    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal
        emake spec \
                $(usex debug "" release=1) \
                progress=true \
@@ -89,7 +93,9 @@ src_test() {
                AR=$(tc-getAR) \
                \
                CRYSTAL_PATH=src \
-               CRYSTAL_CONFIG_VERSION=${PV}
+               CRYSTAL_CONFIG_VERSION=${PV} \
+               \
+               "EXTRA_SPEC_FLAGS=${EXTRA_SPEC_FLAGS}"
 }
 
 src_install() {
diff --git a/dev-lang/crystal/files/crystal-0.27.0-extra-spec-flags.patch b/dev-lang/crystal/files/crystal-0.27.0-extra-spec-flags.patch
new file mode 100644 (file)
index 0000000..bd86c13
--- /dev/null
@@ -0,0 +1,11 @@
+Allow injecting additional arguments to test suite.
+Useful to be able to run small subset of individual
+test suite:
+
+    make spec EXTRA_SPEC_FLAGS='-e parse_set_cookie'
+
+--- a/Makefile
++++ b/Makefile
+@@ -31 +31 @@ override FLAGS += $(if $(release),--release )$(if $(stats),--stats )$(if $(progr
+-SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )
++SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )$(EXTRA_SPEC_FLAGS)