Grow stack automatically
This commit is contained in:
33
Rakefile
33
Rakefile
@ -39,40 +39,9 @@ file BINARY => SOURCES do |t|
|
||||
sh({ 'DFLAGS' => (DFLAGS * ' ') }, 'dub', 'build', '--compiler=gdc')
|
||||
end
|
||||
|
||||
task default: TESTS
|
||||
task default: BINARY
|
||||
|
||||
desc 'Run all tests and check the results'
|
||||
task test: TESTS
|
||||
task test: BINARY do
|
||||
TESTS.each do |test|
|
||||
expected = Pathname
|
||||
.new(test)
|
||||
.sub_ext('.txt')
|
||||
.sub(/^build\/[[:alpha:]]+\//, 'tests/expectations/')
|
||||
.to_path
|
||||
|
||||
puts "Running #{test}"
|
||||
if test.include? '/riscv/'
|
||||
spike = [
|
||||
'/opt/riscv/bin/spike',
|
||||
'--isa=RV32IMAC',
|
||||
'/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
|
||||
print last_stdout.read
|
||||
last_stdout.close
|
||||
|
||||
fail unless wait_threads.last.value.exitstatus.zero?
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Run unittest blocks'
|
||||
task unittest: SOURCES do |t|
|
||||
sh('dub', 'test', '--compiler=gdc-12')
|
||||
|
Reference in New Issue
Block a user