Project

General

Profile

Bug #10959 ยป start.rb

Launches tests using rb_iseq_load wrapper - alvoskov (Alexey Voskov), 03/10/2015 03:33 PM

 
1
require_relative 'iseqtest'
2

    
3
def run_file(filename)
4
	# Compile instructions
5
	data = RubyVM::InstructionSequence.compile_file(filename)
6
	str = Marshal.dump(data.to_a)
7
	# Execute instructions
8
	run_iseq(data.to_a)
9
end
10

    
11
['test1.rb', 'test2.rb', 'test3.rb'].each do |filename|
12
	begin
13
		run_file(filename)
14
	rescue TypeError
15
		puts "#{filename}: EXCEPTION"
16
		puts $!
17
		puts "----------------------"
18
	else
19
		puts "#{filename}: OK"
20
	end
21
end