Sha256: 66250af0efa24c3f81ddebe6300679e21b60cc80deecc618f6e4153b8cca5ce9

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require_relative '../lib/ffi/clang'

require 'pry'

include FFI::Clang

TMP_DIR = File.expand_path("tmp", __dir__)

module ClangSpecHelper
	def fixture_path(path)
		File.join File.expand_path("ffi/clang/fixtures", __dir__), path
	end

	def find_all(cursor, kind)
		cursor.find_all(kind)
	end

	def find_first(cursor, kind)
		cursor.find_first(kind)
	end

	def find_all_matching(cursor, &term)
		cursor.filter(&term)
	end

	def find_matching(cursor, &term)
		cursor.filter(&term).first
	end
end

RSpec.configure do |config|
	# Enable flags like --only-failures and --next-failure
	config.example_status_persistence_file_path = ".rspec_status"
	
	config.include ClangSpecHelper
	
	supported_versions = ['3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4.0']
	current_version = ENV['LLVM_VERSION'] || supported_versions.last
	supported_versions.reverse_each { |version|
		break if version == current_version
		sym = ('from_' + version.tr('.', '_')).to_sym
		config.filter_run_excluding sym => true
	}

	supported_versions.each { |version|
		break if version == current_version
		sym = ('upto_' + version.tr('.', '_')).to_sym
		config.filter_run_excluding sym => true
	}
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ffi-clang-0.7.0 spec/spec_helper.rb
ffi-clang-0.6.0 spec/spec_helper.rb