diff options
| author | Chris Reuter <[email protected]> | 2021-10-21 21:33:17 -0400 |
|---|---|---|
| committer | Chris Reuter <[email protected]> | 2021-10-21 21:58:45 -0400 |
| commit | 5c4273f944b538bc24ed98c52991ea8bf9044654 (patch) | |
| tree | 2d65523aa60dff53a4cedd95e92abf25b0755a39 /test | |
| parent | b6b4ac8270fcef135291cbde60d18f1c8a4c98e4 (diff) | |
| download | mruby-5c4273f944b538bc24ed98c52991ea8bf9044654.tar.gz mruby-5c4273f944b538bc24ed98c52991ea8bf9044654.zip | |
Added testing support for cross-MinGW builds.
This adds a build_config that will cross-build a Windows executable
using the MinGW cross-compiler and will also run the unit (i.e.
'rake test') using Wine.
For this to work, I made some modifications to the underlying test
scripts as well as some minor changes to a couple of the tests
themselves.
Diffstat (limited to 'test')
| -rw-r--r-- | test/bintest.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/test/bintest.rb b/test/bintest.rb index a6888c9fb..773d61edc 100644 --- a/test/bintest.rb +++ b/test/bintest.rb @@ -3,13 +3,27 @@ require 'test/assert.rb' GEMNAME = "" -def cmd(s) +def cmd_list(s) path = s == "mrbc" ? ENV['MRBCFILE'] : "#{ENV['BUILD_DIR']}/bin/#{s}" path = path.sub(/\.exe\z/, "") if /mswin(?!ce)|mingw|bccwin/ =~ RbConfig::CONFIG['host_os'] path = "#{path}.exe".tr("/", "\\") end - path + + path_list = [path] + + emu = ENV['EMULATOR'] + path_list.unshift emu if emu && !emu.empty? + + path_list +end + +def cmd(s) + return cmd_list(s).join(' ') +end + +def cmd_bin(s) + return cmd_list(s).pop end def shellquote(s) |
