bake-toolkit 2.23.2 → 2.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/bakeqac +37 -25
- data/lib/bakeqac/options/options.rb +34 -31
- data/lib/common/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d2396ff645fdc99c2b7b88d2cf30d9cc3a854afe
|
|
4
|
+
data.tar.gz: 856b88138976c39aba1cc8e544535e9ed0bf00b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 035d96aef78c118697e4f0c3d4f4cfdb258767edaab45eab028e102aa2ac9874559254757c631269a1d2b8dc03ab8ca8ac4c7ff2ec7689efbe3a3001d2fbbb1d
|
|
7
|
+
data.tar.gz: 70b719c86a0c854e5d50843e79db3a6019bd171bb74f4abf5f4fb2e917c75c423b8c620a620d6611dece5bd327e70f337754e9c33f42fa6648d662d8d34bded0
|
data/bin/bakeqac
CHANGED
|
@@ -40,10 +40,9 @@ module Bake
|
|
|
40
40
|
|
|
41
41
|
###### STEP 1: CREATE ######
|
|
42
42
|
|
|
43
|
-
if (
|
|
44
|
-
( @options.qacstep.nil? and !File.exist?(@options.qacdata))
|
|
43
|
+
if (@options.qacstep.nil? or @options.qacstep.include?"create")
|
|
45
44
|
|
|
46
|
-
cmd = ["qacli", "admin", "--qaf-project-config", "--qaf-project", @options.qacdata]
|
|
45
|
+
cmd = [@options.qac_home+"/common/bin/qacli", "admin", "--qaf-project-config", "--qaf-project", @options.qacdata]
|
|
47
46
|
@options.cct.each {|c| cmd << "--cct" << c }
|
|
48
47
|
cmd << "--rcf" << @options.rcf
|
|
49
48
|
cmd << "--acf" << @options.acf
|
|
@@ -51,13 +50,14 @@ module Bake
|
|
|
51
50
|
puts "bakeqac: creating database..."
|
|
52
51
|
|
|
53
52
|
success, consoleOutput = ProcessHelper.run(cmd, true)
|
|
53
|
+
puts consoleOutput if !success
|
|
54
54
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
###### STEP 2: BUILD ######
|
|
58
58
|
|
|
59
59
|
if success and (@options.qacstep.nil? or @options.qacstep.include?"build")
|
|
60
|
-
cmd = ["qacli", "analyze", "-P", @options.qacdata, "-b"]
|
|
60
|
+
cmd = [@options.qac_home+"/common/bin/qacli", "analyze", "-P", @options.qacdata, "-b"]
|
|
61
61
|
|
|
62
62
|
begin
|
|
63
63
|
devMode = File.exist?"c:/Projekte/git/bake/bin/bake"
|
|
@@ -78,6 +78,7 @@ module Bake
|
|
|
78
78
|
|
|
79
79
|
success, consoleOutput = ProcessHelper.run(cmd, !@options.qacfilter)
|
|
80
80
|
|
|
81
|
+
filterOutput = []
|
|
81
82
|
filter = []
|
|
82
83
|
endFound = false
|
|
83
84
|
consoleOutput.each_line do |line|
|
|
@@ -85,16 +86,23 @@ module Bake
|
|
|
85
86
|
if scan_res.length > 0
|
|
86
87
|
filter << (scan_res[0][0].downcase + scan_res[0][1] + scan_res[0][2].gsub(/\\/,"/").strip)
|
|
87
88
|
elsif !endFound
|
|
88
|
-
|
|
89
|
+
filterOutput << line if @options.qacfilter
|
|
89
90
|
if line.start_with?("Rebuilding ")
|
|
90
|
-
|
|
91
|
+
endFound = true
|
|
91
92
|
success = true if line.include?("Rebuilding done") # don't know why the return value is 2 in this case...
|
|
92
93
|
end
|
|
93
94
|
end
|
|
94
95
|
end
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
if @options.qacfilter
|
|
98
|
+
if success
|
|
99
|
+
puts filterOutput
|
|
100
|
+
File.open("#{@options.qacdata}/filter.txt", "w+") do |f|
|
|
101
|
+
f.puts(filter)
|
|
102
|
+
end
|
|
103
|
+
else
|
|
104
|
+
puts consoleOutput
|
|
105
|
+
end
|
|
98
106
|
end
|
|
99
107
|
|
|
100
108
|
end
|
|
@@ -107,33 +115,37 @@ module Bake
|
|
|
107
115
|
puts "bakeqac: printing results..."
|
|
108
116
|
|
|
109
117
|
filter = []
|
|
110
|
-
File.open("#{@options.qacdata}/filter.txt", "r") do |f|
|
|
111
|
-
f.each_line { |line| filter << line.strip }
|
|
112
|
-
end
|
|
113
118
|
|
|
114
119
|
if @options.qacfilter
|
|
120
|
+
File.open("#{@options.qacdata}/filter.txt", "r") do |f|
|
|
121
|
+
f.each_line { |line| filter << line.strip }
|
|
122
|
+
end
|
|
115
123
|
filter.delete_if { |f| (f.end_with? "/gtest") or (f.end_with? "/gmock") }
|
|
116
124
|
end
|
|
117
125
|
|
|
118
|
-
cmd = ["qacli", "view", "-P", @options.qacdata, "-m", "STDOUT"]
|
|
126
|
+
cmd = [@options.qac_home+"/common/bin/qacli", "view", "-P", @options.qacdata, "-m", "STDOUT"]
|
|
119
127
|
success, consoleOutput = ProcessHelper.run(cmd, !@options.qacfilter)
|
|
120
128
|
|
|
121
|
-
if
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
line
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
if @options.qacfilter
|
|
130
|
+
if success
|
|
131
|
+
foundFile = false
|
|
132
|
+
consoleOutput.each_line do |line|
|
|
133
|
+
line.strip!
|
|
134
|
+
foundFile = false if line.empty? or line.include? " ======= Results for "
|
|
135
|
+
scan_res = line.scan(/\/\/ ======= Results for ([a-zA-Z]{0,1})(:{0,1})(.*)/)
|
|
136
|
+
if scan_res.length > 0
|
|
137
|
+
converted_line = (scan_res[0][0].downcase + scan_res[0][1] + scan_res[0][2].gsub(/\\/,"/"))
|
|
138
|
+
filter.each do |fil|
|
|
139
|
+
if converted_line.include?fil and not converted_line.include?(fil+"/test/") and not converted_line.include?(fil+"/mock/")
|
|
140
|
+
foundFile = true
|
|
141
|
+
break
|
|
142
|
+
end
|
|
133
143
|
end
|
|
134
144
|
end
|
|
145
|
+
puts line if foundFile and not line.include?"QAC++ Deep Flow Static Analyser"
|
|
135
146
|
end
|
|
136
|
-
|
|
147
|
+
else
|
|
148
|
+
puts consoleOutput
|
|
137
149
|
end
|
|
138
150
|
end
|
|
139
151
|
|
|
@@ -5,7 +5,7 @@ require 'bake/toolchain/gcc'
|
|
|
5
5
|
module Bake
|
|
6
6
|
|
|
7
7
|
class BakeqacOptions < Parser
|
|
8
|
-
attr_reader :rcf, :acf, :qacdata, :qacstep # String
|
|
8
|
+
attr_reader :rcf, :acf, :qacdata, :qacstep, :qac_home # String
|
|
9
9
|
attr_reader :c11, :c14, :qacfilter # Boolean
|
|
10
10
|
attr_reader :cct # Array
|
|
11
11
|
|
|
@@ -44,7 +44,7 @@ module Bake
|
|
|
44
44
|
puts " --rcf <file> Sets a specific rule config file, otherwise $(QAC_RULE) will be used. If not set, $(QAC_HOME)/config/rcf/mcpp-1_5_1-en_US.rcf will be used."
|
|
45
45
|
puts " --acf <file> Sets a specific analysis config file, otherwise $(QAC_HOME)/config/acf/default.acf will be used."
|
|
46
46
|
puts " --qacdata <dir> QAC writes data into this folder. Default is <working directory>/qacdata."
|
|
47
|
-
puts " --qacstep create|build|result Steps can be ORed. Per default
|
|
47
|
+
puts " --qacstep create|build|result Steps can be ORed. Per default all steps will be executed."
|
|
48
48
|
puts " --qacfilter on|off If off, output will be printed immediately and unfiltered, default is on to reduce noise."
|
|
49
49
|
puts " --version Print version."
|
|
50
50
|
puts " -h, --help Print this help."
|
|
@@ -63,49 +63,52 @@ module Bake
|
|
|
63
63
|
def parse_options(bakeOptions)
|
|
64
64
|
parse_internal(true, bakeOptions)
|
|
65
65
|
|
|
66
|
-
if
|
|
67
|
-
|
|
66
|
+
if not ENV["QAC_HOME"]
|
|
67
|
+
Bake.formatter.printError("Error: specify the environment variable QAC_HOME.")
|
|
68
|
+
end
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Bake.formatter.printError("Error: could not determine GCC version.")
|
|
72
|
-
ExitHelper.exit(1)
|
|
73
|
-
end
|
|
70
|
+
@qac_home = ENV["QAC_HOME"].gsub(/\\/,"/")
|
|
71
|
+
@qac_home = qac_home[0, qac_home.length-1] if qac_home.end_with?"/"
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
plStr = "w64-mingw32"
|
|
77
|
-
elsif RUBY_PLATFORM =~ /cygwin/
|
|
78
|
-
plStr = "pc-cygwin"
|
|
79
|
-
else
|
|
80
|
-
plStr = "generic-linux"
|
|
81
|
-
end
|
|
73
|
+
if @cct.empty?
|
|
82
74
|
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
gccVersion = Bake::Toolchain::getGccVersion
|
|
76
|
+
if gccVersion.length < 2
|
|
77
|
+
Bake.formatter.printError("Error: could not determine GCC version.")
|
|
78
|
+
ExitHelper.exit(1)
|
|
79
|
+
end
|
|
85
80
|
|
|
81
|
+
if RUBY_PLATFORM =~ /mingw/
|
|
82
|
+
plStr = "w64-mingw32"
|
|
83
|
+
elsif RUBY_PLATFORM =~ /cygwin/
|
|
84
|
+
plStr = "pc-cygwin"
|
|
86
85
|
else
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
plStr = "generic-linux"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
while (@cct.empty? or gccVersion[0]>=5)
|
|
90
|
+
@cct = [qac_home + "/config/cct/GNU_GCC-g++_#{gccVersion[0]}.#{gccVersion[1]}-i686-#{plStr}#{@cVersion}.cct"]
|
|
91
|
+
break if File.exist?@cct[0]
|
|
92
|
+
@cct = [qac_home + "/config/cct/GNU_GCC-g++_#{gccVersion[0]}.#{gccVersion[1]}-x86_64-#{plStr}#{@cVersion}.cct"]
|
|
93
|
+
break if File.exist?@cct[0]
|
|
94
|
+
if gccVersion[1]>0
|
|
95
|
+
gccVersion[1] -= 1
|
|
96
|
+
else
|
|
97
|
+
gccVersion[0] -= 1
|
|
98
|
+
gccVersion[1] = 20
|
|
99
|
+
end
|
|
89
100
|
end
|
|
90
101
|
end
|
|
91
102
|
|
|
92
103
|
if @acf.nil?
|
|
93
|
-
|
|
94
|
-
@acf = ENV["QAC_HOME"] + "/config/acf/default.acf"
|
|
95
|
-
else
|
|
96
|
-
Bake.formatter.printError("Error: specify either the environment variable QAC_HOME or set --acf.")
|
|
97
|
-
ExitHelper.exit(1)
|
|
98
|
-
end
|
|
104
|
+
@acf = qac_home + "/config/acf/default.acf"
|
|
99
105
|
end
|
|
100
106
|
|
|
101
107
|
if @rcf.nil?
|
|
102
108
|
if ENV["QAC_RCF"]
|
|
103
|
-
@rcf = ENV["QAC_RCF"]
|
|
104
|
-
elsif ENV["QAC_HOME"]
|
|
105
|
-
@rcf = ENV["QAC_HOME"] + "/config/rcf/mcpp-1_5_1-en_US.rcf"
|
|
109
|
+
@rcf = ENV["QAC_RCF"].gsub(/\\/,"/")
|
|
106
110
|
else
|
|
107
|
-
|
|
108
|
-
ExitHelper.exit(1)
|
|
111
|
+
@rcf = qac_home + "/config/rcf/mcpp-1_5_1-en_US.rcf"
|
|
109
112
|
end
|
|
110
113
|
end
|
|
111
114
|
|
data/lib/common/version.rb
CHANGED