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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42287a77d42f0f8b3d6b342d6499dce58ae70271
4
- data.tar.gz: 91bf5ac072e877a89ed2bffad1808fb6944d548d
3
+ metadata.gz: d2396ff645fdc99c2b7b88d2cf30d9cc3a854afe
4
+ data.tar.gz: 856b88138976c39aba1cc8e544535e9ed0bf00b4
5
5
  SHA512:
6
- metadata.gz: 84ee601aa25f8cea175029e99f90eb935bb83b14b64b11942a575ea23be640eaf6ab24085f1a803aa7b545d044e8d2f7aecc31691fc042c8fe592d78094fceb3
7
- data.tar.gz: 7b7b77521279d6127191456365be3479cf1203664b37a6fd6438b439b2fd544238306c5db39d0e5454976f65c9fd18aa0077446e21ccef3bfcb810699a7f71ca
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 (!@options.qacstep.nil? and @options.qacstep.include?"create") or
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
- puts line if @options.qacfilter
89
+ filterOutput << line if @options.qacfilter
89
90
  if line.start_with?("Rebuilding ")
90
- endFound = true
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
- File.open("#{@options.qacdata}/filter.txt", "w+") do |f|
97
- f.puts(filter)
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 success && @options.qacfilter
122
- foundFile = false
123
- consoleOutput.each_line do |line|
124
- line.strip!
125
- foundFile = false if line.empty? or line.include? " ======= Results for "
126
- scan_res = line.scan(/\/\/ ======= Results for ([a-zA-Z]{0,1})(:{0,1})(.*)/)
127
- if scan_res.length > 0
128
- converted_line = (scan_res[0][0].downcase + scan_res[0][1] + scan_res[0][2].gsub(/\\/,"/"))
129
- filter.each do |fil|
130
- if converted_line.include?fil and not converted_line.include?(fil+"/test/") and not converted_line.include?(fil+"/mock/")
131
- foundFile = true
132
- break
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
- puts line if foundFile and not line.include?"QAC++ Deep Flow Static Analyser"
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 create is done if qacdata does not exist, build and result are done if previous steps were successful."
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 @cct.empty?
67
- if ENV["QAC_HOME"]
66
+ if not ENV["QAC_HOME"]
67
+ Bake.formatter.printError("Error: specify the environment variable QAC_HOME.")
68
+ end
68
69
 
69
- gccVersion = Bake::Toolchain::getGccVersion
70
- if gccVersion.length < 2
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
- if RUBY_PLATFORM =~ /mingw/
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
- cttStr = "GNU_GCC-g++_#{gccVersion[0]}.#{gccVersion[1]}-i686-#{plStr}#{@cVersion}.cct"
84
- @cct << (ENV["QAC_HOME"] + "/config/cct/#{cttStr}")
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
- Bake.formatter.printError("Error: specify either the environment variable QAC_HOME or set --cct.")
88
- ExitHelper.exit(1)
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
- if ENV["QAC_HOME"]
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
- Bake.formatter.printError("Error: specify either the environment variable QAC_RULE, QAC_HOME or set --rfc.")
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
 
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.23.2"
4
+ "2.23.3"
5
5
  end
6
6
 
7
7
  def self.printBakeVersion(ry = "")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bake-toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.23.2
4
+ version: 2.23.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Schaal