Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split helper file to test-case and runner helper #168

Merged
merged 2 commits into from Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Rakefile
Expand Up @@ -19,9 +19,11 @@ end
require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << "test/lib"
t.ruby_opts << "-rhelper"
t.test_files = FileList["test/**/test_*.rb"]
if RUBY_VERSION >= "2.6"
t.ruby_opts = %w[--enable-frozen-string-literal --debug=frozen-string-literal]
t.ruby_opts << %w[--enable-frozen-string-literal --debug=frozen-string-literal]
end
end
gem 'rake-compiler', '>= 0.4.1'
Expand Down
2 changes: 1 addition & 1 deletion test/assets/mof.y
Expand Up @@ -565,7 +565,7 @@ require 'rubygems'
require 'cim'
require File.join(File.dirname(__FILE__), 'result')
require File.join(File.dirname(__FILE__), 'scanner')
require File.join(File.dirname(__FILE__), 'helper')
require File.join(File.dirname(__FILE__), 'case')

---- inner ----

Expand Down
5 changes: 0 additions & 5 deletions test/helper.rb → test/case.rb
Expand Up @@ -3,11 +3,6 @@
begin

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'
Expand Down
4 changes: 4 additions & 0 deletions test/lib/helper.rb
@@ -0,0 +1,4 @@
require_relative '../case'
require_relative 'core_assertions'

Racc::TestCase.include Test::Unit::CoreAssertions
2 changes: 1 addition & 1 deletion test/regress/mof
Expand Up @@ -14,7 +14,7 @@ require 'rubygems'
require 'cim'
require File.join(File.dirname(__FILE__), 'result')
require File.join(File.dirname(__FILE__), 'scanner')
require File.join(File.dirname(__FILE__), 'helper')
require File.join(File.dirname(__FILE__), 'case')

module MOF
class Parser < Racc::Parser
Expand Down
2 changes: 1 addition & 1 deletion test/test_chk_y.rb
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))

module Racc
class TestChkY < TestCase
Expand Down
2 changes: 1 addition & 1 deletion test/test_grammar_file_parser.rb
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))

module Racc
class TestGrammarFileParser < TestCase
Expand Down
2 changes: 1 addition & 1 deletion test/test_racc_command.rb
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))

module Racc
class TestRaccCommand < TestCase
Expand Down
2 changes: 1 addition & 1 deletion test/test_scan_y.rb
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))

module Racc
class TestScanY < TestCase
Expand Down