Write an IR visitor
This commit is contained in:
20
Rakefile
20
Rakefile
@ -49,20 +49,26 @@ task test: BINARY do
|
||||
.new(test)
|
||||
.sub_ext('.txt')
|
||||
.sub(/^build\/[[:alpha:]]+\//, 'tests/expectations/')
|
||||
.read
|
||||
.to_i
|
||||
.to_path
|
||||
|
||||
puts "Running #{test}"
|
||||
if test.include? '/riscv/'
|
||||
system('/opt/riscv/bin/spike',
|
||||
'/opt/riscv/riscv32-unknown-elf/bin/pk', test,
|
||||
{ out: '/dev/null' })
|
||||
spike = [
|
||||
'/opt/riscv/bin/spike',
|
||||
'/opt/riscv/riscv32-unknown-elf/bin/pk',
|
||||
test
|
||||
]
|
||||
diff = ['diff', '-Nur', '--color', expected, '-']
|
||||
tail = ['tail', '-n', '1']
|
||||
|
||||
last_stdout, wait_threads = Open3.pipeline_r spike, tail, diff
|
||||
else
|
||||
raise 'Unsupported test platform'
|
||||
end
|
||||
actual = $?.exitstatus
|
||||
print last_stdout.read
|
||||
last_stdout.close
|
||||
|
||||
fail "#{test}: Expected #{expected}, got #{actual}" unless expected == actual
|
||||
fail unless wait_threads.last.value.exitstatus.zero?
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user