mips_tester 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -29,6 +29,7 @@
29
29
  # OS generated files #
30
30
  ######################
31
31
  .DS_Store?
32
+ .DS_Store
32
33
  ehthumbs.db
33
34
  Icon?
34
35
  Thumbs.db
data/lib/mips_tester.rb CHANGED
@@ -3,7 +3,7 @@ require 'tempfile' unless defined? Tempfile
3
3
  # Main MIPSTester module
4
4
  module MIPSTester
5
5
  # Library version
6
- VERSION = "0.1.0"
6
+ VERSION = "0.1.1"
7
7
 
8
8
  # MIPSFileError Exception, raised when test file is not valid or non-existent
9
9
  class MIPSFileError < Exception; end
@@ -69,7 +69,7 @@ module MIPSTester
69
69
 
70
70
  cli = `#{["java -jar",
71
71
  @mars_path,
72
- @regs.empty? ? "" : @regs.keys.join(" "),
72
+ @exp.empty? ? "" : @exp.keys.join(" "),
73
73
  @addresses.empty? ? "" : [@addresses.keys.min, @addresses.keys.max].join("-"),
74
74
  "nc dec",
75
75
  asm.path].join(" ")}`
@@ -0,0 +1 @@
1
+ add $t0, $t1, $t2 # $t0 = $t1 + $t2
data/spec/mips_spec.rb CHANGED
@@ -2,6 +2,10 @@ require 'spec_helper'
2
2
  include MIPSTester
3
3
 
4
4
  describe MIPS do
5
+ let :mips do
6
+ MIPS.new :mars_path => "/Applications/MARS_4_1.jar"
7
+ end
8
+
5
9
  context 'passing wrong parameters' do
6
10
  it 'should raise exception if not valid MARS path is given' do
7
11
  expect do
@@ -25,11 +29,7 @@ describe MIPS do
25
29
  end
26
30
 
27
31
 
28
- context 'work on empty file' do
29
- let :mips do
30
- MIPS.new :mars_path => "/Applications/MARS_4_1.jar"
31
- end
32
-
32
+ context 'work on empty file' do
33
33
  it 'should expect given register values' do
34
34
  mips.test fixture_path("empty.asm") do
35
35
  set :s0 => 0x0C, :s1 => 0x3F
@@ -58,4 +58,20 @@ describe MIPS do
58
58
  end.should be_true
59
59
  end
60
60
  end
61
+
62
+ context 'add.asm' do
63
+ it 'should expect 11 when adding 5 and 6' do
64
+ mips.test fixture_path("add.asm") do
65
+ set :t1 => 5, :t2 => 6
66
+ expect :t0 => 11
67
+ end.should be_true
68
+ end
69
+
70
+ it 'should expect -9 when adding 18 and -27' do
71
+ mips.test fixture_path("add.asm") do
72
+ set :t1 => 18, :t2 => -27
73
+ expect :t0 => -9
74
+ end.should be_true
75
+ end
76
+ end
61
77
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mips_tester
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Federico Ravasio
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-25 00:00:00 +02:00
14
- default_executable:
13
+ date: 2011-05-04 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rspec
@@ -42,10 +41,10 @@ files:
42
41
  - Rakefile
43
42
  - lib/mips_tester.rb
44
43
  - mips_tester.gemspec
44
+ - spec/fixtures/add.asm
45
45
  - spec/fixtures/empty.asm
46
46
  - spec/mips_spec.rb
47
47
  - spec/spec_helper.rb
48
- has_rdoc: true
49
48
  homepage: http://github.com/razielgn/mips_tester
50
49
  licenses: []
51
50
 
@@ -69,11 +68,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
68
  requirements: []
70
69
 
71
70
  rubyforge_project:
72
- rubygems_version: 1.6.2
71
+ rubygems_version: 1.7.2
73
72
  signing_key:
74
73
  specification_version: 3
75
74
  summary: Class to test MIPS asm files
76
75
  test_files:
76
+ - spec/fixtures/add.asm
77
77
  - spec/fixtures/empty.asm
78
78
  - spec/mips_spec.rb
79
79
  - spec/spec_helper.rb
80
+ has_rdoc: