From: gemmaro <gemmaro.dev@gmail.com>
To: 63951@debbugs.gnu.org
Cc: gemmaro <gemmaro.dev@gmail.com>, Christopher Baines <mail@cbaines.net>
Subject: [bug#63951] [PATCH 2/2] gnu: ruby-atoulme-saikuro: Fix tests.
Date: Thu, 8 Jun 2023 08:54:50 +0900 [thread overview]
Message-ID: <4ae36dbf9d05d5b605fd93f3cc0a3f6988e08706.1686181717.git.gemmaro.dev@gmail.com> (raw)
In-Reply-To: <cover.1686181717.git.gemmaro.dev@gmail.com>
* gnu/packages/ruby.scm (ruby-atoulme-saikuro)
[propagated-inputs]: Add ruby-irb-1.1.1 and ruby-e2mmap.
[arguments]: Enable tests.
---
gnu/packages/ruby.scm | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index c5b94ffd15d..37b16ae2fdc 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1305,9 +1305,27 @@ (define-public ruby-atoulme-saikuro
(base32
"0kvd2nsxffbza61d3q4j94wrbnbv50r1zy3a7q26f6k706fw1f19"))))
(build-system ruby-build-system)
- ;; FIXME: There are no unit tests. The tests are demonstrations of the
- ;; "saikuro" tool.
- (arguments `(#:tests? #f))
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-module-resolution
+ (lambda _
+ (substitute* "lib/saikuro.rb"
+ ;; irb 1.2.0 or later doesn't have RubyToken
+ (("require 'irb/ruby-lex'")
+ "require 'rubygems'\ngem 'irb', '=1.1.1'\nrequire 'irb/ruby-lex'"))))
+ (delete 'check)
+ (add-after 'install 'check
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (saikuro (string-append out "/bin/saikuro")))
+ (setenv "GEM_PATH" (string-append
+ (getenv "GEM_PATH") ":"
+ #$output "/lib/ruby/vendor_ruby"))
+ (invoke saikuro "--cyclo" "--token" "--input_directory" "tests")))))))
+ (propagated-inputs (list ruby-irb-1.1.1
+ ruby-e2mmap)) ;required by rubygems
(synopsis "Cyclomatic complexity analyzer")
(description "Saikuro is a Ruby cyclomatic complexity analyzer. When
given Ruby source code Saikuro will generate a report listing the cyclomatic
--
2.40.1
next prev parent reply other threads:[~2023-06-07 23:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 23:50 [bug#63951] [PATCH 0/2] gnu: ruby-atoulme-saikuro: Fix tests gemmaro
2023-06-07 23:54 ` [bug#63951] [PATCH 1/2] gnu: Add ruby-irb@1.1.1 gemmaro
2023-06-07 23:54 ` gemmaro [this message]
2023-06-26 9:20 ` bug#63951: [PATCH 0/2] gnu: ruby-atoulme-saikuro: Fix tests Christopher Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ae36dbf9d05d5b605fd93f3cc0a3f6988e08706.1686181717.git.gemmaro.dev@gmail.com \
--to=gemmaro.dev@gmail.com \
--cc=63951@debbugs.gnu.org \
--cc=mail@cbaines.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).