about summary refs log tree commit homepage
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 97f68d5..c515d83 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -2,21 +2,29 @@
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 all::
 pkg = yahns
-RUBY = ruby
+rubybin := $(shell which ruby)
+RUBY = $(rubybin)
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
         @./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
 lib := lib
 
+ifeq ($(RUBY_TEST_OPTS),)
+  ifeq ($(V),1)
+    RUBY_TEST_OPTS := -v
+  endif
+endif
+
 all:: test
 test_units := $(wildcard test/test_*.rb)
 test: $(test_units)
 $(test_units):
-        $(RUBY) -I $(lib) $@ -v
+        $(RUBY) -I $(lib) $@ $(RUBY_TEST_OPTS)
 
 test-mt: export N = $(shell nproc 2>/dev/null || echo 4)
+test-mt: t := $(addprefix -r./,$(test_units))
 test-mt:
-        $(RUBY) -I $(lib) $(addprefix -r./,$(test_units)) -eTime.now --
+        $(RUBY) -I $(lib) $(t) -erubyv -- $(RUBY_TEST_OPTS)
 
 check-warnings:
         @(for i in $$(git ls-files '*.rb'| grep -v '^setup\.rb$$'); \