bake-toolkit 2.40.0 → 2.40.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bakeqac +25 -21
- data/lib/bakeqac/options/options.rb +52 -11
- data/lib/common/root.rb +1 -1
- data/lib/common/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47018509fb45c727f0be0b11470726b01d13606a
|
4
|
+
data.tar.gz: 3b0fa9295363deb6ee596df9c4c3d1c87d4c40e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0ba48431dba2e59155c9d8026acce4a9f1d23a844ae4c347131d71a1b7150a24201e62f0b4afbd7e4c9a3581a12d2ee4a1a993c951ca744ce25aa82ae59889f
|
7
|
+
data.tar.gz: aa757eb55d06270e41ecfb84d885ec0db3d94b37702f589cfd39f965f4df8870f1caed7b8126fffaeff6c3ba94a92d1119dced7509a9b2e49aab885de98a0008
|
data/bin/bakeqac
CHANGED
@@ -321,33 +321,37 @@ $cmdRemoveLocks = qaExe + ["admin", "--qaf-project", @options.qacdata, "--remove
|
|
321
321
|
|
322
322
|
# 3. print
|
323
323
|
numberOfMessages = 0
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
htmlFiles = Dir.glob("components/qacpp*/doc-en_US/messages/%04d.html" % errorNum)
|
334
|
-
|
324
|
+
sortedLines.each do |line|
|
325
|
+
success = true if line.include?"The specified project does not have any source files" # to proceed we assume that this is a valid scenario
|
326
|
+
if (!@options.qacnoformat && line.start_with?("MSG: ")) || (@options.qacnoformat && line.include?(": Msg("))
|
327
|
+
Bake.formatter.printWarning(line)
|
328
|
+
if @options.qacdoc
|
329
|
+
errorNumScan = line.scan(/[^\(]*\([^\(]*\([^:]*:(\d*)/)
|
330
|
+
if errorNumScan.length > 0
|
331
|
+
errorNum = errorNumScan[0][0].to_i
|
332
|
+
Dir.chdir(@options.qac_home) do
|
333
|
+
htmlFiles = Dir.glob("components/qacpp*/doc-en_US/messages/%04d.html" % errorNum).each do |htmlFile|
|
334
|
+
puts "doc: #{File.expand_path(htmlFile)}"
|
335
|
+
end
|
336
|
+
end
|
337
|
+
Dir.chdir(@options.mcpp_home) do
|
338
|
+
htmlFiles = Dir.glob("components/mcpp*/doc-en_US/messages/%04d.html" % errorNum).each do |htmlFile|
|
335
339
|
puts "doc: #{File.expand_path(htmlFile)}"
|
336
340
|
end
|
337
341
|
end
|
338
342
|
end
|
339
|
-
numberOfMessages += 1
|
340
|
-
elsif line.include? " ======= Results for "
|
341
|
-
Bake.formatter.printAdditionalInfo(line)
|
342
|
-
else
|
343
|
-
Bake.formatter.printInfo(line)
|
344
343
|
end
|
344
|
+
numberOfMessages += 1
|
345
|
+
elsif line.include? " ======= Results for "
|
346
|
+
Bake.formatter.printAdditionalInfo(line)
|
347
|
+
else
|
348
|
+
Bake.formatter.printInfo(line)
|
345
349
|
end
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
350
|
+
end
|
351
|
+
Bake.formatter.printSuccess("\n**** Number of messages: #{numberOfMessages} ****")
|
352
|
+
if !success # HACK, see above
|
353
|
+
Bake.formatter.printInfo("\nNote: qacli exited with error, maybe the number of messages was too high and output was truncated.")
|
354
|
+
success = true
|
351
355
|
end
|
352
356
|
else
|
353
357
|
puts consoleOutput # error
|
@@ -6,12 +6,14 @@ require 'common/options/finder'
|
|
6
6
|
module Bake
|
7
7
|
|
8
8
|
class BakeqacOptions < Parser
|
9
|
-
attr_reader :rcf, :acf, :qacstep, :qac_home, :cct_append # String
|
9
|
+
attr_reader :rcf, :acf, :qacstep, :qac_home, :mcpp_home, :cct_append # String
|
10
10
|
attr_reader :c11, :c14, :qacmsgfilter, :qacfilefilter, :qacnoformat, :qacunittest, :qacdoc, :cct_patch # Boolean
|
11
11
|
attr_reader :cct # Array
|
12
12
|
attr_reader :qacretry # int
|
13
13
|
attr_accessor :qacdata # String
|
14
14
|
|
15
|
+
RCF_DEFAULT = "config/rcf/mcpp-1_5_1-en_US.rcf".freeze()
|
16
|
+
|
15
17
|
def initialize(argv)
|
16
18
|
super(argv)
|
17
19
|
|
@@ -65,11 +67,12 @@ module Bake
|
|
65
67
|
puts " --cct <file> Set a specific compiler compatibility template, can be defined multiple times."
|
66
68
|
puts " If not specified, $(QAC_HOME)/config/cct/<platform>.ctt will be used and additionally"
|
67
69
|
puts " a file named qac.cct will be searched up to root and also used if found."
|
68
|
-
puts " --rcf <file> Set a specific rule config file. If not specified, $(
|
70
|
+
puts " --rcf <file> Set a specific rule config file. If not specified, $(MCPP_HOME)/#{RCF_DEFAULT} will be used."
|
69
71
|
puts " --acf <file> Set a specific analysis config file, otherwise $(QAC_HOME)/config/acf/default.acf will be used."
|
70
72
|
puts " --qaccctpatch If specified, some adaptions to cct are made. Might improve the result - no guarantee."
|
71
73
|
puts " --qacdata <dir> QAC writes data into this folder. Default is <working directory>/.qacdata."
|
72
|
-
puts " --qacstep admin
|
74
|
+
puts " --qacstep <steps> Can be admin,analyze,view,report,mdr (separated by \",\" without spaces)."
|
75
|
+
puts " Defines the steps to execute, see documentation. Default: admin,analyze,view"
|
73
76
|
puts " --qacnofilefilter Some files will be filtered per default, like /test/."
|
74
77
|
puts " --qacnomsgfilter Some messages will be filter per default filters to reduce noise."
|
75
78
|
puts " --qacrawformat Raw QAC output (with incomplete MISRA rules!)."
|
@@ -144,9 +147,35 @@ module Bake
|
|
144
147
|
Bake.formatter.printError("Error: specify the environment variable QAC_HOME.")
|
145
148
|
ExitHelper.exit(1)
|
146
149
|
end
|
150
|
+
@qac_home = ENV["QAC_HOME"].gsub(/\\/,"/")
|
151
|
+
@qac_home = @qac_home[0, @qac_home.length-1] if @qac_home.end_with?"/"
|
152
|
+
if !File.directory?(@qac_home)
|
153
|
+
Bake.formatter.printError("Error: QAC_HOME points to invalid directory.")
|
154
|
+
ExitHelper.exit(1)
|
155
|
+
end
|
156
|
+
|
157
|
+
# find mcpp install folder
|
158
|
+
# prio 1: explicit env var
|
159
|
+
if ENV["MCPP_HOME"] && !ENV["MCPP_HOME"].empty?
|
160
|
+
@mcpp_home = ENV["MCPP_HOME"].gsub(/\\/,"/")
|
161
|
+
@mcpp_home = @mcpp_home[0, @mcpp_home.length-1] if @mcpp_home.end_with?"/"
|
162
|
+
if !File.directory?(@mcpp_home)
|
163
|
+
Bake.formatter.printError("Error: MCPP_HOME points to invalid directory: #{@mcpp_home}")
|
164
|
+
ExitHelper.exit(1)
|
165
|
+
end
|
166
|
+
# prio 2: with qac_home
|
167
|
+
elsif File.exists?(@qac_home+"/#{RCF_DEFAULT}")
|
168
|
+
@mcpp_home = @qac_home
|
169
|
+
# prio 3: next to qac_home
|
170
|
+
elsif File.exists?(File.dirname(@qac_home)+"/mcpp-1.5.1/#{RCF_DEFAULT}")
|
171
|
+
@mcpp_home = File.dirname(@qac_home)+"/mcpp-1.5.1"
|
172
|
+
else
|
173
|
+
Bake.formatter.printError("Error: cannot find MCPP home folder. Specify MCPP_HOME.")
|
174
|
+
ExitHelper.exit(1)
|
175
|
+
end
|
147
176
|
|
148
177
|
if !@qacstep.nil?
|
149
|
-
@qacstep.split(
|
178
|
+
@qacstep.split(/[,|]/).each do |s|
|
150
179
|
if not ["admin", "analyze", "view", "report", "mdr"].include?s
|
151
180
|
Bake.formatter.printError("Error: incorrect qacstep name.")
|
152
181
|
ExitHelper.exit(1)
|
@@ -154,9 +183,6 @@ module Bake
|
|
154
183
|
end
|
155
184
|
end
|
156
185
|
|
157
|
-
@qac_home = ENV["QAC_HOME"].gsub(/\\/,"/")
|
158
|
-
@qac_home = qac_home[0, qac_home.length-1] if qac_home.end_with?"/"
|
159
|
-
|
160
186
|
if @cct.empty?
|
161
187
|
gccVersion = Bake::Toolchain::getGccVersion
|
162
188
|
if gccVersion.length < 2
|
@@ -185,9 +211,9 @@ module Bake
|
|
185
211
|
end
|
186
212
|
|
187
213
|
while (@cct.empty? or gccVersion[0]>=4)
|
188
|
-
@cct = [qac_home + "/config/cct/GNU_GCC-g++_#{gccVersion[0]}.#{gccVersion[1]}-i686-#{plStr}-C++#{@cVersion}.cct"]
|
214
|
+
@cct = [@qac_home + "/config/cct/GNU_GCC-g++_#{gccVersion[0]}.#{gccVersion[1]}-i686-#{plStr}-C++#{@cVersion}.cct"]
|
189
215
|
break if File.exist?@cct[0]
|
190
|
-
@cct = [qac_home + "/config/cct/GNU_GCC-g++_#{gccVersion[0]}.#{gccVersion[1]}-x86_64-#{plStr}-C++#{@cVersion}.cct"]
|
216
|
+
@cct = [@qac_home + "/config/cct/GNU_GCC-g++_#{gccVersion[0]}.#{gccVersion[1]}-x86_64-#{plStr}-C++#{@cVersion}.cct"]
|
191
217
|
break if File.exist?@cct[0]
|
192
218
|
if gccVersion[1]>0
|
193
219
|
gccVersion[1] -= 1
|
@@ -202,11 +228,26 @@ module Bake
|
|
202
228
|
@cct_append = cctInDir.gsub(/[\\]/,'/') if cctInDir
|
203
229
|
|
204
230
|
if @acf.nil?
|
205
|
-
@acf = qac_home + "/config/acf/default.acf"
|
231
|
+
@acf = @qac_home + "/config/acf/default.acf"
|
206
232
|
end
|
207
233
|
|
208
234
|
if @rcf.nil?
|
209
|
-
@rcf =
|
235
|
+
@rcf = @mcpp_home + "/#{RCF_DEFAULT}"
|
236
|
+
end
|
237
|
+
|
238
|
+
@cct.each do |cct|
|
239
|
+
if !File.exists?(cct)
|
240
|
+
Bake.formatter.printError("Error: cct file not found: #{cct}")
|
241
|
+
ExitHelper.exit(1)
|
242
|
+
end
|
243
|
+
end
|
244
|
+
if !File.exists?(@acf)
|
245
|
+
Bake.formatter.printError("Error: acf file not found: #{@acf}")
|
246
|
+
ExitHelper.exit(1)
|
247
|
+
end
|
248
|
+
if !File.exists?(@rcf)
|
249
|
+
Bake.formatter.printError("Error: rcf file not found: #{@rcf}")
|
250
|
+
ExitHelper.exit(1)
|
210
251
|
end
|
211
252
|
|
212
253
|
end
|
data/lib/common/root.rb
CHANGED
data/lib/common/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bake-toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.40.
|
4
|
+
version: 2.40.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Schaal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|