diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-10-30 21:38:55 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2019-10-31 08:39:48 +0900 |
commit | 1c03026ea3cd90cbc37eb4c612aca3c6129032c8 (patch) | |
tree | 88ed03fb0859a39f4ddb2a8c9c8f2c4db1e4d2f4 /test/racc/helper.rb | |
parent | 5f8795a07b163fe3f373ad443db1949de21c747b (diff) | |
download | ruby-1c03026ea3cd90cbc37eb4c612aca3c6129032c8.tar.gz |
Try to run assert_output_unchanged with racc tests
Diffstat (limited to 'test/racc/helper.rb')
-rw-r--r-- | test/racc/helper.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/racc/helper.rb b/test/racc/helper.rb index 744c0a7f2e..d05ba4abfc 100644 --- a/test/racc/helper.rb +++ b/test/racc/helper.rb @@ -2,7 +2,12 @@ verbose = $VERBOSE $VERBOSE = true begin -require 'minitest/autorun' +require 'test/unit' +begin + require_relative './lib/core_assertions' + Test::Unit::TestCase.include Test::Unit::CoreAssertions +rescue LoadError +end require 'racc/static' require 'fileutils' require 'tempfile' @@ -71,8 +76,9 @@ module Racc end def assert_exec(asset) + lib_path = File.expand_path("../../lib", __FILE__) file = File.basename(asset, '.y') - ruby("#{@TAB_DIR}/#{file}") + ruby "-I#{lib_path}", "#{@TAB_DIR}/#{file}" end def strip_version(source) @@ -80,6 +86,9 @@ module Racc end def assert_output_unchanged(asset) + # racc generates the difference results in GitHub Actions + omit if ENV['GITHUB_ACTION'] + file = File.basename(asset, '.y') expected = File.read("#{REGRESS_DIR}/#{file}") @@ -91,7 +100,8 @@ module Racc end def racc(*arg, **opt) - ruby "-S", RACC, *arg, **opt + lib_path = File.expand_path("../../lib", __FILE__) + ruby "-I#{lib_path}", "-S", RACC, *arg, **opt end def ruby(*arg, **opt) |