Sha256: 71e06d50b292b0ed9b655a610dfcdd215a00b938d95d0de5ca37f5b948daa289

Contents?: true

Size: 968 Bytes

Versions: 4

Compression:

Stored size: 968 Bytes

Contents

require 'helper'

class TestGpp < Test::Unit::TestCase
  
  context "G++ compiler" do
    
    should "compile and run the Bubble Sort Algorithm" do
      gpp = Jeka::Compiler::Gpp.new([File.join(File.dirname(__FILE__), 'bubble_sort', 'cpp', 'bubble_sort.cpp')],
                                    {:o => 'bubble_sort_cpp'})
      
      stdout, stderr, process_status, benchmark = gpp.build
      assert_equal 0, process_status
      assert_equal [], stdout
      assert_equal [], stderr
      
      stdout, stderr, exit_status = gpp.run('9 8 7 6 5 4 3 2 1')
      assert_equal 0, exit_status
      assert_equal ["1 2 3 4 5 6 7 8 9"], stdout
      assert_equal [], stderr
      assert benchmark.has_key?(:user_cpu_time)
      assert benchmark.has_key?(:system_cpu_time)
      assert benchmark.has_key?(:childrens_use_cpu_time)
      assert benchmark.has_key?(:childrens_system_cpu_time)
      assert benchmark.has_key?(:elapsed_real_time)
    end
    
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jeka-0.2.3 test/test_gpp.rb
jeka-0.2.2 test/test_gpp.rb
jeka-0.2.1 test/test_gpp.rb
jeka-0.2.0 test/test_gpp.rb