mirror of
https://github.com/samsonjs/compiler.git
synced 2026-03-25 08:45:52 +00:00
26 lines
565 B
Ruby
Executable file
26 lines
565 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
|
|
ROOT = Dir.pwd.sub(/\/test.*$/, '')
|
|
$LOAD_PATH << ROOT
|
|
|
|
require 'build'
|
|
|
|
# usage: test.rb <func> [outdir] [binformat] [format]
|
|
|
|
def main
|
|
func = ARGV.shift
|
|
outdir = ARGV.shift || '.'
|
|
binformat = (ARGV.shift || 'elf').downcase
|
|
format = (ARGV.shift || 'asm').downcase
|
|
platform = `uname -s`.chomp.downcase
|
|
print "testing #{func} ... "
|
|
success = run( build("test_#{func}.code", outdir, platform, binformat) )
|
|
if success == 0
|
|
puts "pass"
|
|
else
|
|
puts "FAIL! (#{success})"
|
|
end
|
|
exit(success.to_i)
|
|
end
|
|
|
|
main if $0 == __FILE__
|