mumuki-c-runner 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 07bca358458da7b0194a52d8c7ad208fbe4092cb
4
+ data.tar.gz: f367a50d0244acb432d56507d197eec93bdb595b
5
+ SHA512:
6
+ metadata.gz: c5a4230efb4f2851eeb544e712f2a134ea155b1168f28038799fe09c6f073a5489d9bc6f29fcbf62e323fc94a6e1b57ff8ab78647eff106c612d980ab66f2bb3
7
+ data.tar.gz: 657bacd57ac1d9d9467ab3e5c370738ffd900cdd240b75b6633455ad7217e8502afc9ea65f572c60c785f8f390b1f49b02b95ddc57a2f7b7933df13973eec3d1
data/lib/c_runner.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'mumukit'
2
+
3
+ Mumukit.runner_name = 'c'
4
+ Mumukit.configure do |config|
5
+ config.docker_image = 'mumuki/mumuki-cspec-worker'
6
+
7
+ end
8
+
9
+ require_relative './test_hook'
10
+ require_relative './metadata_hook'
@@ -0,0 +1,14 @@
1
+ class CMetadataHook < Mumukit::Hook
2
+ def metadata
3
+ {language: {
4
+ name: 'c',
5
+ icon: {type: 'devicon', name: 'c'},
6
+ extension: 'c',
7
+ ace_mode: 'c'
8
+ },
9
+ test_framework: {
10
+ name: 'cspec',
11
+ test_extension: 'c'
12
+ }}
13
+ end
14
+ end
data/lib/test_hook.rb ADDED
@@ -0,0 +1,39 @@
1
+ class CTestHook < Mumukit::Templates::FileHook
2
+ isolated true
3
+
4
+ def tempfile_extension
5
+ '.c'
6
+ end
7
+
8
+ def command_line(filename)
9
+ "runcspec #{filename}"
10
+ end
11
+
12
+ def post_process_file(file, result, status)
13
+ if result.include? '!!TEST FINISHED WITH COMPILATION ERROR!!'
14
+ [result, :errored]
15
+ else
16
+ super
17
+ end
18
+ end
19
+
20
+ def compile_file_content(request)
21
+ <<EOF
22
+ #include <cspecs/cspec.h>
23
+
24
+ context (mumuki_test) {
25
+
26
+ describe ("Mumuki test") {
27
+
28
+ #{request.extra}
29
+
30
+ #{request.content}
31
+
32
+ #{request.test}
33
+
34
+ } end
35
+
36
+ }
37
+ EOF
38
+ end
39
+ end
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mumuki-c-runner
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Franco Leonardo Bulgarelli
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mumukit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.4'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: codeclimate-test-reporter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mumukit-bridge
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.3'
97
+ description:
98
+ email:
99
+ - franco@mumuki.org
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - lib/c_runner.rb
105
+ - lib/metadata_hook.rb
106
+ - lib/test_hook.rb
107
+ homepage: http://github.com/mumuki/mumuki-c-server
108
+ licenses:
109
+ - MIT
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 2.4.8
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: C Runner for Mumuki
131
+ test_files: []