From 0bbfb6a37b6fa65c2aeb7a587ef75ce2fa4a4ec3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 18 Oct 2021 10:29:51 +0900 Subject: Fix error when srcdir not found So that `spec/mspec/bin/mspec --help` works at least. --- spec/default.mspec | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/default.mspec b/spec/default.mspec index 162fa8b9f2..2dbaeb83d3 100644 --- a/spec/default.mspec +++ b/spec/default.mspec @@ -10,17 +10,19 @@ class MSpecScript builddir = Dir.pwd srcdir = ENV['SRCDIR'] srcdir ||= File.read("Makefile", encoding: "US-ASCII")[/^\s*srcdir\s*=\s*(.+)/i, 1] rescue nil - srcdir = File.expand_path(srcdir) config = RbConfig::CONFIG # The default implementation to run the specs. set :target, File.join(builddir, "miniruby#{config['exeext']}") set :prefix, File.expand_path('ruby', File.dirname(__FILE__)) - set :flags, %W[ - -I#{srcdir}/lib - #{srcdir}/tool/runruby.rb --archdir=#{Dir.pwd} --extout=#{config['EXTOUT']} - -- - ] + if srcdir + srcdir = File.expand_path(srcdir) + set :flags, %W[ + -I#{srcdir}/lib + #{srcdir}/tool/runruby.rb --archdir=#{builddir} --extout=#{config['EXTOUT']} + -- + ] + end end module MSpecScript::JobServer -- cgit v1.2.1