Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Oct 17, 2018
1 parent a35fccc commit eaa6bd6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions ext/enterprise_script_service/Rakefile
Expand Up @@ -14,6 +14,7 @@ raise(<<-MESSAGE) unless Dir.exist?(MRUBY_DIR.join("src"))
$ git submodule update
MESSAGE

ESS_ROOT = Pathname.new(__dir__).join("../..")
ROOT =
if ENV["INSTALL_DIR"] && File.directory?(ENV["INSTALL_DIR"])
Expand Down
1 change: 1 addition & 0 deletions ext/enterprise_script_service/mruby_config.rb
Expand Up @@ -5,6 +5,7 @@
mruby_engine_gembox_path =
if ENV["MRUBY_ENGINE_GEMBOX_PATH"] && File.exist?(ENV["MRUBY_ENGINE_GEMBOX_PATH"])
raise "`#{ENV['MRUBY_ENGINE_GEMBOX_PATH']}` require `.gembox` extension" unless ENV["MRUBY_ENGINE_GEMBOX_PATH"].end_with?(".gembox")

Pathname.new ENV["MRUBY_ENGINE_GEMBOX_PATH"][0..-8]
else
Pathname.new(__FILE__).dirname.join("mruby_engine")
Expand Down
1 change: 1 addition & 0 deletions lib/script_core/engine.rb
Expand Up @@ -8,6 +8,7 @@ def initialize(bin_path = ScriptCore::DEFAULT_BIN_PATH,
executable_name: "enterprise_script_service",
instructions_name: "enterprise_script_service.mrb")
raise Errno::ENOENT, "No such directory - #{bin_path}" unless File.directory?(bin_path)

@bin_path = bin_path

@executable = ScriptCore::Executable.new(@bin_path.join(executable_name))
Expand Down
1 change: 1 addition & 0 deletions lib/script_core/spawner.rb
Expand Up @@ -10,6 +10,7 @@ def wait(pid, flags = 0)
_pid, status = Process.wait2(pid, flags)

return unless status

if status.signaled?
255 + status.termsig
else
Expand Down
12 changes: 7 additions & 5 deletions script/regression
Expand Up @@ -9,19 +9,21 @@ def expected_result?(file)
return true if $CHILD_STATUS.success?
return true if $CHILD_STATUS.exitstatus == 1
return true if OUT_OF_MEMORY_EXPECTED.include?(file) && $CHILD_STATUS.termsig == 9

false
end

pwd = Pathname.new(__FILE__).dirname
mruby = pwd.join("../ext/enterprise_script_service/mruby/bin/mruby").to_s
testdir = pwd.join("../tests/regression")
test_dir = pwd.join("../tests/regression")

failures = false

Dir.entries(testdir).sort.each do |file|
filepath = testdir.join(file)
next unless File.file?(filepath)
cmd = "#{mruby} #{filepath}"
Dir.entries(test_dir).sort.each do |file|
file_path = test_dir.join(file)
next unless File.file?(file_path)

cmd = "#{mruby} #{file_path}"
system(cmd)

if expected_result?(file)
Expand Down

0 comments on commit eaa6bd6

Please sign in to comment.