require 'test/unit'

class RiceTest < Test::Unit::TestCase
  # TODO: probably a better way to find this out...
  VERBOSE = ARGV.include?('-v')

  def test_unittest
    run_external_test('./unittest')
  end

  def test_vm_unittest
    run_external_test('./vm_unittest')
  end

  def run_external_test(executable)
    if VERBOSE then
      system(executable)
    else
      result = `#{executable}`
      if $? != 0 then
        puts result
      end
    end
    raise "Error: $?" if $? != 0
  end
end


require 'test/unit'
require 'rbconfig'

class RiceTest < Test::Unit::TestCase
  # TODO: probably a better way to find this out...
  VERBOSE = ARGV.include?('-v')

  EXEEXT = Config::CONFIG['EXEEXT']

  def test_unittest
    run_external_test("./unittest#{EXEEXT}")
  end

  def test_vm_unittest
    run_external_test("./vm_unittest#{EXEEXT}")
  end

  def run_external_test(executable)
    if VERBOSE then
      system(executable)
    else
      result = `#{executable}`
      if $? != 0 then
        puts result
      end
    end
    raise "Error: $?" if $? != 0
  end
end


Append EXEEXT to executable names.
Append EXEEXT to executable names.


git-svn-id: 81de8714785daa4de355a86eff9ce8518e4b389c@166 e2d4e900-5bc4-4db4-8b5f-7ecdbb188e69
