mkmf-lite 0.3.2 → 0.4.0

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: de796a0bf860b6d6b4a7c21554977316e0ea07d4dfc03a3c7fc907d1ee0a68f9
4
- data.tar.gz: dc854961978a892591511f5359ea95dbd5cd09739b8be4a577dc4afdb3d19b6b
3
+ metadata.gz: 7b31149c447c19e46fb23c75314391a1ce130d13d3682a6c27c908f65b4ebf4c
4
+ data.tar.gz: 46e3d7df97248fe7e57f371b75ba3ecff658e1410d598c501d091f8cd8982117
5
5
  SHA512:
6
- metadata.gz: 81541850a6fc87d563b90feeb428bb587d0958f6440fcabe68e3719ef85f546bad732553da1a7aa565ba6b1eefec05774fbdbf2da19c15245aaa9bbeac82e0db
7
- data.tar.gz: 55e3a0961fce9355ef96cc6a7fb32b2ccfc05deee2700d250051c7b826fca091cbc76c252f5bc5ab958e36ddd81614acf5af42ec3defb4da9d7d81301930318f
6
+ metadata.gz: 3421a088bf652b63d4ba22ab5ba488488527641dd3a2e37173373c6c182ded5bbb2a79f83e98719e0a09d6fb40db1180a4c41639130ef1c28a67159dc0dfa5f7
7
+ data.tar.gz: ceec89082d0e5a2e40347855d3934f425004a38753d0e9920e0ca98af50e39980c892aa0489e10524c48438dba40a5cec4d5fe070a16c245d2aad9528c737fe7
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,8 @@
1
+ == 0.4.0 - 4-Jul-2020
2
+ * Replaced test-unit with rspec, rewrote the tests, and made relevant
3
+ changes to the gemspec, etc.
4
+ * Pinned the ptools version to 1.3.x.
5
+
1
6
  == 0.3.2 - 19-Mar-2020
2
7
  * Properly include a LICENSE file as per the Apache-2.0 license.
3
8
 
@@ -1,7 +1,6 @@
1
1
  * CHANGES.rdoc
2
2
  * LICENSE
3
3
  * MANIFEST.rdoc
4
- * README.rdoc
5
4
  * Rakefile
6
5
  * mkmf-lite.gemspec
7
6
  * certs/djberg96_pub.pem
@@ -10,4 +9,4 @@
10
9
  * lib/mkmf/templates/have_func_pointer.erb
11
10
  * lib/mkmf/templates/have_header.erb
12
11
  * lib/mkmf/templates/have_struct_member.erb
13
- * test/test_mkmf_lite.rb
12
+ * spec/mkmf_lite_spec.rb
@@ -47,7 +47,7 @@ You can ignore these (or, upgrade your Jruby).
47
47
  Apache-2.0
48
48
 
49
49
  == Copyright
50
- (C) 2010-2019 Daniel J. Berger
50
+ (C) 2010-2020 Daniel J. Berger
51
51
  All Rights Reserved
52
52
 
53
53
  == Warranty
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/clean'
3
- require 'rake/testtask'
3
+ require 'rspec/core/rake_task'
4
4
 
5
5
  CLEAN.include("**/*.gem", "**/*.rbc")
6
6
 
@@ -20,9 +20,7 @@ namespace 'gem' do
20
20
  end
21
21
  end
22
22
 
23
- Rake::TestTask.new do |t|
24
- t.verbose = true
25
- t.warning = true
26
- end
23
+ desc "Run the test suite"
24
+ RSpec::Core::RakeTask.new(:spec)
27
25
 
28
- task :default => :test
26
+ task :default => :spec
@@ -7,7 +7,7 @@ require 'open3'
7
7
  module Mkmf
8
8
  module Lite
9
9
  # The version of the mkmf-lite library
10
- MKMF_LITE_VERSION = '0.3.2'.freeze
10
+ MKMF_LITE_VERSION = '0.4.0'.freeze
11
11
 
12
12
  private
13
13
 
@@ -3,19 +3,19 @@ require 'rubygems'
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'mkmf-lite'
5
5
  spec.summary = 'A lighter version of mkmf designed for use as a library'
6
- spec.version = '0.3.2'
6
+ spec.version = '0.4.0'
7
7
  spec.author = 'Daniel J. Berger'
8
8
  spec.license = 'Apache-2.0'
9
9
  spec.email = 'djberg96@gmail.com'
10
10
  spec.homepage = 'http://github.com/djberg96/mkmf-lite'
11
- spec.test_file = 'test/test_mkmf_lite.rb'
11
+ spec.test_file = 'spec/mkmf_lite_spec.rb'
12
12
  spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
13
13
  spec.cert_chain = ['certs/djberg96_pub.pem']
14
14
 
15
15
  spec.extra_rdoc_files = Dir['*.rdoc']
16
16
 
17
- spec.add_dependency('ptools')
18
- spec.add_development_dependency('test-unit', '>= 2.4.0')
17
+ spec.add_dependency('ptools', '~> 1.3')
18
+ spec.add_development_dependency('rspec', '~> 3.9')
19
19
 
20
20
  spec.metadata = {
21
21
  'homepage_uri' => 'https://github.com/djberg96/mkmf-lite',
@@ -0,0 +1,111 @@
1
+ ########################################################################
2
+ # mkmf_lite_spec.rb
3
+ #
4
+ # Tests for the mkmf-lite library.
5
+ ########################################################################
6
+ require 'rubygems'
7
+ require 'rspec'
8
+ require 'mkmf/lite'
9
+
10
+ describe Mkmf::Lite do
11
+ subject { Class.new{ |obj| obj.extend Mkmf::Lite } }
12
+
13
+ let(:st_type) { 'struct stat' }
14
+ let(:st_member) { 'st_uid' }
15
+ let(:st_header) { 'sys/stat.h' }
16
+
17
+ describe "constants" do
18
+ example "version information" do
19
+ expect(described_class::MKMF_LITE_VERSION).to eq('0.4.0')
20
+ expect(described_class::MKMF_LITE_VERSION).to be_frozen
21
+ end
22
+ end
23
+
24
+ describe "have_header" do
25
+ example "have_header basic functionality" do
26
+ expect(subject).to respond_to(:have_header)
27
+ end
28
+
29
+ example "have_header returns expected boolean value" do
30
+ expect(subject.have_header('stdio.h')).to eq(true)
31
+ expect(subject.have_header('foobar.h')).to eq(false)
32
+ end
33
+
34
+ example "have_header accepts an array of directories as a second argument" do
35
+ expect{ subject.have_header('stdio.h', '/usr/local/include') }.not_to raise_error
36
+ expect{ subject.have_header('stdio.h', '/usr/local/include', '/usr/include') }.not_to raise_error
37
+ end
38
+ end
39
+
40
+ context "have_func" do
41
+ example "have_func basic functionality" do
42
+ expect(subject).to respond_to(:have_func)
43
+ end
44
+
45
+ example "have_func with no arguments returns expected boolean value" do
46
+ expect(subject.have_func('abort')).to eq(true)
47
+ expect(subject.have_func('abortxyz')).to eq(false)
48
+ end
49
+
50
+ example "have_func with arguments returns expected boolean value" do
51
+ expect(subject.have_func('printf', 'stdio.h')).to eq(true)
52
+ expect(subject.have_func('printfx', 'stdio.h')).to eq(false)
53
+ end
54
+
55
+ example "have_func requires at least one argument" do
56
+ expect{ subject.have_func }.to raise_error(ArgumentError)
57
+ end
58
+
59
+ example "have_func accepts a maximum of two arguments" do
60
+ expect{ subject.have_func('printf', 'stdio.h', 'bogus') }.to raise_error(ArgumentError)
61
+ end
62
+ end
63
+
64
+ context "have_struct_member" do
65
+ example "have_struct_member basic functionality" do
66
+ expect(subject).to respond_to(:have_struct_member)
67
+ end
68
+
69
+ example "have_struct_member returns expected boolean value" do
70
+ expect(subject.have_struct_member(st_type, st_member, st_header)).to eq(true)
71
+ expect(subject.have_struct_member(st_type, 'pw_bogus', st_header)).to eq(false)
72
+ expect(subject.have_struct_member(st_type, st_member)).to eq(false)
73
+ end
74
+
75
+ example "have_struct_member requires at least two arguments" do
76
+ expect{ subject.have_struct_member() }.to raise_error(ArgumentError)
77
+ expect{ subject.have_struct_member('struct passwd') }.to raise_error(ArgumentError)
78
+ end
79
+
80
+ example "have_struct_member accepts a maximum of three arguments" do
81
+ expect{ subject.have_struct_member('struct passwd', 'pw_name', 'pwd.h', true) }.to raise_error(ArgumentError)
82
+ end
83
+ end
84
+
85
+ context "check_sizeof" do
86
+ example "check_sizeof basic functionality" do
87
+ expect(subject).to respond_to(:check_sizeof)
88
+ expect{ subject.check_sizeof(st_type, st_header) }.not_to raise_error
89
+ end
90
+
91
+ example "check_sizeof requires at least one argument" do
92
+ expect{ subject.check_sizeof }.to raise_error(ArgumentError)
93
+ expect{ subject.check_sizeof('struct passwd', 'pw_name', 1) }.to raise_error(ArgumentError)
94
+ end
95
+
96
+ example "check_sizeof accepts a maximum of two arguments" do
97
+ expect{ subject.check_sizeof('div_t', 'stdlib.h', 1) }.to raise_error(ArgumentError)
98
+ end
99
+
100
+ example "check_sizeof works with one or two arguments" do
101
+ expect{ subject.check_sizeof('div_t') }.not_to raise_error
102
+ expect{ subject.check_sizeof('div_t', 'stdlib.h') }.not_to raise_error
103
+ end
104
+
105
+ example "check_sizeof returns an integer value" do
106
+ size = subject.check_sizeof(st_type, st_header)
107
+ expect(size).to be_kind_of(Integer)
108
+ expect(size).to be > 0
109
+ end
110
+ end
111
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkmf-lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -35,36 +35,36 @@ cert_chain:
35
35
  ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
36
  WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date: 2020-03-19 00:00:00.000000000 Z
38
+ date: 2020-07-05 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ptools
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: '1.3'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: '1.3'
54
54
  - !ruby/object:Gem::Dependency
55
- name: test-unit
55
+ name: rspec
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ">="
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 2.4.0
60
+ version: '3.9'
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ">="
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 2.4.0
67
+ version: '3.9'
68
68
  description: |2
69
69
  The mkmf-lite library is a light version of the the mkmf library
70
70
  designed for use as a library. It does not create packages, builds,
@@ -75,9 +75,9 @@ email: djberg96@gmail.com
75
75
  executables: []
76
76
  extensions: []
77
77
  extra_rdoc_files:
78
+ - README.rdoc
78
79
  - CHANGES.rdoc
79
80
  - MANIFEST.rdoc
80
- - README.rdoc
81
81
  files:
82
82
  - CHANGES.rdoc
83
83
  - LICENSE
@@ -93,7 +93,7 @@ files:
93
93
  - lib/mkmf/templates/have_header.erb
94
94
  - lib/mkmf/templates/have_struct_member.erb
95
95
  - mkmf-lite.gemspec
96
- - test/test_mkmf_lite.rb
96
+ - spec/mkmf_lite_spec.rb
97
97
  homepage: http://github.com/djberg96/mkmf-lite
98
98
  licenses:
99
99
  - Apache-2.0
@@ -124,4 +124,4 @@ signing_key:
124
124
  specification_version: 4
125
125
  summary: A lighter version of mkmf designed for use as a library
126
126
  test_files:
127
- - test/test_mkmf_lite.rb
127
+ - spec/mkmf_lite_spec.rb
metadata.gz.sig CHANGED
Binary file
@@ -1,119 +0,0 @@
1
- ########################################################################
2
- # test_mkmf_lite.rb
3
- #
4
- # Tests for the mkmf-lite library.
5
- ########################################################################
6
- require 'rubygems'
7
- require 'test-unit'
8
- require 'mkmf/lite'
9
-
10
- class TC_Mkmf_Lite < Test::Unit::TestCase
11
- include Mkmf::Lite
12
-
13
- def self.startup
14
- @@windows = File::ALT_SEPARATOR
15
- end
16
-
17
- def setup
18
- @st_type = 'struct stat'
19
- @st_member = 'st_uid'
20
- @st_header = 'sys/stat.h'
21
- end
22
-
23
- test "version information" do
24
- assert_equal('0.3.2', MKMF_LITE_VERSION)
25
- assert_true(MKMF_LITE_VERSION.frozen?)
26
- end
27
-
28
- test "have_header basic functionality" do
29
- assert_respond_to(self, :have_header)
30
- end
31
-
32
- test "have_header returns expected boolean value" do
33
- assert_true(have_header('stdio.h'))
34
- assert_false(have_header('foobar.h'))
35
- end
36
-
37
- test "have_header accepts an array of directories as a second argument" do
38
- assert_nothing_raised{ have_header('stdio.h', '/usr/local/include') }
39
- assert_nothing_raised{ have_header('stdio.h', '/usr/local/include', '/usr/include') }
40
- end
41
-
42
- test "have_func basic functionality" do
43
- assert_respond_to(self, :have_func)
44
- end
45
-
46
- test "have_func with no arguments returns expected boolean value" do
47
- assert_true(have_func('abort'))
48
- assert_false(have_func('abortxyz'))
49
- end
50
-
51
- test "have_func with arguments returns expected boolean value" do
52
- assert_true(have_func('printf', 'stdio.h'))
53
- assert_false(have_func('printfx', 'stdio.h'))
54
- end
55
-
56
- test "have_func requires at least one argument" do
57
- assert_raise(ArgumentError){ have_func }
58
- end
59
-
60
- test "have_func accepts a maximum of two arguments" do
61
- assert_raise(ArgumentError){ have_func('printf', 'stdio.h', 'bogus') }
62
- end
63
-
64
- test "have_struct_member basic functionality" do
65
- assert_respond_to(self, :have_struct_member)
66
- end
67
-
68
- test "have_struct_member returns expected boolean value" do
69
- assert_true(have_struct_member(@st_type, @st_member, @st_header))
70
- assert_false(have_struct_member(@st_type, 'pw_bogus', @st_header))
71
- assert_false(have_struct_member(@st_type, @st_member))
72
- end
73
-
74
- test "have_struct_member requires at least two arguments" do
75
- assert_raise(ArgumentError){ have_struct_member() }
76
- assert_raise(ArgumentError){ have_struct_member('struct passwd') }
77
- end
78
-
79
- test "have_struct_member accepts a maximum of three arguments" do
80
- assert_raise(ArgumentError){
81
- have_struct_member('struct passwd', 'pw_name', 'pwd.h', true)
82
- }
83
- end
84
-
85
- test "check_sizeof basic functionality" do
86
- assert_respond_to(self, :check_sizeof)
87
- assert_nothing_raised{ check_sizeof(@st_type, @st_header) }
88
- end
89
-
90
- test "check_sizeof requires at least one argument" do
91
- assert_raise(ArgumentError){ check_sizeof }
92
- assert_raise(ArgumentError){ check_sizeof('struct passwd', 'pw_name', 1) }
93
- end
94
-
95
- test "check_sizeof accepts a maximum of two arguments" do
96
- assert_raise(ArgumentError){ check_sizeof('div_t', 'stdlib.h', 1) }
97
- end
98
-
99
- test "check_sizeof works with one or two arguments" do
100
- assert_nothing_raised{ check_sizeof('div_t') }
101
- assert_nothing_raised{ check_sizeof('div_t', 'stdlib.h') }
102
- end
103
-
104
- test "check_sizeof returns an integer value" do
105
- size = check_sizeof(@st_type, @st_header)
106
- assert_kind_of(Integer, size)
107
- assert_true(size > 0)
108
- end
109
-
110
- def teardown
111
- @st_type = nil
112
- @st_member = nil
113
- @st_header = nil
114
- end
115
-
116
- def self.shutdown
117
- @@windows = nil
118
- end
119
- end