mrubyc-test 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 134dba24482cd854d18c548f67c6884f29762de6c5cff34c8dd16b33349cfc49
4
- data.tar.gz: 16c91f515cc2507629df555eef9222be0c92fccf0e5a11b72883854e99ceb7e7
3
+ metadata.gz: 42dad60691e5384546bea0da13394891c4b0a18ca96033542e9674f2cc6637c3
4
+ data.tar.gz: 5c36b3b893edb879b94acdb752a60a892c9b38b0b7d018ecb2b6fca67cf657ff
5
5
  SHA512:
6
- metadata.gz: a83d79c076b05e91f452293501776ab70d590214c84169bdb65a5c329ff10a554135077ad814b91846361a7658a9b40f919ff765a333b5cbe2be9d95c13b173a
7
- data.tar.gz: db81ffe8ca22180eb7ac156c39d3bbaeac5c2048c60f38aa9020c5a642c0fc9f8e48d5924accd81488828224383ec4dd754c88baeb9221b55677b9a5ec0904d4
6
+ metadata.gz: 00bd3455fca3ae3336f263ec19881c8007e3c6dffb24e47082e82f86228e4143989ea122f8dbb9220d8108ff726f786daeed31085346cafdb2f87532f7a3adc6
7
+ data.tar.gz: 3bbf2aeb541bd4bfc6e5109049103a5b9a09a39195594295db5fac490d1d1c6bb687e72589b78de761307b9dbe01e1d930e3874568f6a2d1f6309b421e98acf1
data/Gemfile.lock CHANGED
@@ -1,20 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mrubyc-test (0.7.0)
5
- activesupport (~> 6.0)
4
+ mrubyc-test (0.7.1)
5
+ activesupport (~> 7.0)
6
6
  rufo (~> 0.12)
7
- thor (~> 1.0)
7
+ thor (~> 1.2)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.1.6)
12
+ activesupport (7.0.3)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 1.6, < 2)
15
15
  minitest (>= 5.1)
16
16
  tzinfo (~> 2.0)
17
- zeitwerk (~> 2.3)
18
17
  concurrent-ruby (1.1.10)
19
18
  diff-lcs (1.5.0)
20
19
  i18n (1.10.0)
@@ -38,15 +37,14 @@ GEM
38
37
  thor (1.2.1)
39
38
  tzinfo (2.0.4)
40
39
  concurrent-ruby (~> 1.0)
41
- zeitwerk (2.5.4)
42
40
 
43
41
  PLATFORMS
44
42
  ruby
45
43
 
46
44
  DEPENDENCIES
47
- bundler (~> 2.0)
45
+ bundler (~> 2)
48
46
  mrubyc-test!
49
- rake (~> 13.0)
47
+ rake (~> 13)
50
48
  rspec (~> 3.9)
51
49
 
52
50
  BUNDLED WITH
@@ -19,9 +19,10 @@ module Mrubyc
19
19
  Module.const_get(class_name.upcase)
20
20
  end
21
21
  unless model_class
22
- print "\e[33m"
23
- puts "[WARN] #{model_file} doesn't have corresponding class `#{class_name}`."
24
- print "\e[m"
22
+ # Deprecate 2022-06-01
23
+ #print "\e[33m"
24
+ #puts "[WARN] #{model_file} doesn't have corresponding class `#{class_name}`."
25
+ #print "\e[m"
25
26
  next
26
27
  end
27
28
  model_class.class_eval do
@@ -13,12 +13,12 @@ module Mrubyc
13
13
  test_erb = ERB.new(
14
14
  File.read(
15
15
  File.expand_path('../../../../templates/test.rb.erb', __FILE__)
16
- ), nil, '-'
16
+ ), trim_mode: '-'
17
17
  )
18
18
  models_erb = ERB.new(
19
19
  File.read(
20
20
  File.expand_path('../../../../templates/models.rb.erb', __FILE__)
21
- ), nil, '-'
21
+ ), trim_mode: '-'
22
22
  )
23
23
  mrubyc_class_dir = File.expand_path('../../../../mrubyc-ext/', __FILE__)
24
24
  File.write(File.join(
@@ -1,5 +1,5 @@
1
1
  module Mrubyc
2
2
  module Test
3
- VERSION = "0.7.0"
3
+ VERSION = "0.7.1"
4
4
  end
5
5
  end
data/lib/mrubyc-test.rb CHANGED
@@ -47,34 +47,30 @@ module Mrubyc::Test
47
47
  tmp_dir = File.join(Dir.pwd, config['test_tmp_dir'])
48
48
  puts "cd #{tmp_dir}"
49
49
  puts
50
- exit_code = 0
51
50
  pwd = Dir.pwd
52
51
  hal_path = "#{pwd}/#{config['mrubyc_src_dir']}/hal"
53
52
  hal_bak_path = "#{pwd}/#{config['mrubyc_src_dir']}/~hal"
54
53
  FileUtils.mv(hal_path, hal_bak_path) if FileTest.exist?(hal_path)
54
+ exit_code = 0
55
55
  begin
56
56
  FileUtils.ln_s "#{pwd}/#{config['test_tmp_dir']}/hal", "#{pwd}/#{config['mrubyc_src_dir']}/hal"
57
57
  Dir.chdir(tmp_dir) do
58
58
  [
59
- "#{mrbc_path} -B test test.rb",
60
- "#{mrbc_path} -B models models.rb",
61
- "cc -O0 -g3 -Wall -I #{pwd}/#{config['mrubyc_src_dir']} -o test main.c #{pwd}/#{config['mrubyc_src_dir']}/*.c #{pwd}/#{config['mrubyc_src_dir']}/hal/*.c -DMRBC_USE_HAL_POSIX #{ENV["CFLAGS"]} #{ENV["LDFLAGS"]}",
62
- "./test"].each do |cmd|
59
+ "#{mrbc_path} -B test test.rb",
60
+ "#{mrbc_path} -B models models.rb",
61
+ "cc -O0 -g3 -Wall -I #{pwd}/#{config['mrubyc_src_dir']} -o test main.c #{pwd}/#{config['mrubyc_src_dir']}/*.c #{pwd}/#{config['mrubyc_src_dir']}/hal/*.c -DMRBC_USE_MATH=1 -DMRBC_USE_HAL_POSIX #{ENV["CFLAGS"]} #{ENV["LDFLAGS"]}",
62
+ "./test"
63
+ ].each do |cmd|
63
64
  puts cmd
64
65
  puts
65
- exit_code = system(cmd) ? 0 : 1
66
- if exit_code > 0
67
- print "\e[31m"
68
- puts "exit code: #{exit_code}"
69
- puts "\e[0m"
70
- exit(exit_code)
71
- end
66
+ exit_code = 1 unless system(cmd)
72
67
  end
73
68
  end
74
69
  ensure
75
70
  FileUtils.rm hal_path
76
71
  FileUtils.mv(hal_bak_path, hal_path) if FileTest.exist?(hal_bak_path)
77
72
  end
73
+ return exit_code
78
74
  end
79
75
 
80
76
  def init_env
@@ -132,10 +128,16 @@ module Mrubyc::Test
132
128
  end
133
129
  "RBENV_VERSION=#{mruby_version} mrbc"
134
130
  end
131
+ exit_code = 0
135
132
  Dir.glob(test_path).each_slice(options[:every]) do |test_files|
136
133
  prepare(test_files, options[:verbose], method_name_pattern)
137
- make(mrbc_path)
134
+ exit_code += make(mrbc_path)
135
+ end
136
+ if exit_code > 0
137
+ puts "\e[31mFinished with error(s)\e[0m"
138
+ exit 1
138
139
  end
140
+ puts "\e[32mFinished without error\e[0m"
139
141
  end
140
142
 
141
143
  desc "version", "Print the version"
data/mrubyc-test.gemspec CHANGED
@@ -23,11 +23,11 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_development_dependency "bundler", "~> 2.0"
27
- spec.add_development_dependency "rake", "~> 13.0"
26
+ spec.add_development_dependency "bundler", "~> 2"
27
+ spec.add_development_dependency "rake", "~> 13"
28
28
  spec.add_development_dependency "rspec", "~> 3.9"
29
29
 
30
- spec.add_dependency "thor", "~> 1.0"
31
- spec.add_dependency "activesupport", "~> 6.0"
30
+ spec.add_dependency "thor", "~> 1.2"
31
+ spec.add_dependency "activesupport", "~> 7.0"
32
32
  spec.add_dependency "rufo", "~> 0.12"
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrubyc-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HASUMI Hitoshi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-10 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '13.0'
33
+ version: '13'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '13.0'
40
+ version: '13'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.0'
61
+ version: '1.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.0'
68
+ version: '1.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '6.0'
75
+ version: '7.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '6.0'
82
+ version: '7.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rufo
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubygems_version: 3.3.3
155
+ rubygems_version: 3.3.14
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Test Framework for mruby/c