Skip to content
Snippets Groups Projects
Commit 3de77e4e authored by Jack Nagel's avatar Jack Nagel
Browse files

Stop recording the fails_with cause internally

The string passed as the cause is currently unused, so we don't need to
actually store it.
parent e582d2c8
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,15 @@ end
class CompilerFailure
attr_reader :name
attr_rw :cause, :version
attr_rw :version
# Allows Apple compiler `fails_with` statements to keep using `build`
# even though `build` and `version` are the same internally
alias_method :build, :version
# The cause is no longer used so we need not hold a reference to the string
def cause(_); end
def self.for_standard standard
COLLECTIONS.fetch(standard) do
raise ArgumentError, "\"#{standard}\" is not a recognized standard"
......@@ -45,26 +48,18 @@ class CompilerFailure
"#<#{self.class.name}: #{name} #{version}>"
end
MESSAGES = {
:cxx11 => "This compiler does not support C++11"
}
cxx11 = proc { cause MESSAGES[:cxx11] }
COLLECTIONS = {
:cxx11 => [
create(:gcc_4_0, &cxx11),
create(:gcc, &cxx11),
create(:llvm, &cxx11),
create(:clang) { build 425; cause MESSAGES[:cxx11] },
create(:gcc => "4.3", &cxx11),
create(:gcc => "4.4", &cxx11),
create(:gcc => "4.5", &cxx11),
create(:gcc => "4.6", &cxx11),
create(:gcc_4_0),
create(:gcc),
create(:llvm),
create(:clang) { build 425 },
create(:gcc => "4.3"),
create(:gcc => "4.4"),
create(:gcc => "4.5"),
create(:gcc => "4.6"),
],
:openmp => [
create(:clang) { cause "clang does not support OpenMP" },
]
:openmp => [create(:clang)],
}
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment