1
0
Fork 0
mirror of https://github.com/rubyjs/libv8 synced 2023-03-27 23:21:48 -04:00

Add more version string specific tests

This commit is contained in:
ignisf 2014-06-15 15:16:35 +03:00
parent 659ccdc8ad
commit e50ad5fb95
4 changed files with 8 additions and 17 deletions

View file

@ -15,10 +15,6 @@ module Libv8
module_function
def system_compilers
available_compilers(*Compiler::KNOWN_COMPILERS)
end
def available_compilers(*compiler_names)
available = compiler_names.select { |compiler_name| available? compiler_name }
available.map { |compiler_name| type_of(compiler_name).new compiler_name }
@ -26,7 +22,7 @@ module Libv8
def type_of(compiler_name)
case version_string_of(compiler_name)
when /\bApple LLVM\b/ then AppleLLVM
when /^Apple LLVM\b/ then AppleLLVM
when /\bclang\b/i then Clang
when /^gcc/i then GCC
else GenericCompiler

View file

@ -23,16 +23,6 @@ module Libv8::Compiler
it 'returns true' do
stub_as_available 'c++', :clang, '3.4.1'
subject.compatible?.should be_true
stub_as_available 'c++', :clang, '3.10.0'
subject.compatible?.should be_true
end
end
context 'when clang\'s version is < 3.1' do
it 'returns false' do
stub_as_available 'c++', :clang, '3.0.0'
subject.compatible?.should be_false
end
end
end

View file

@ -7,11 +7,17 @@ module Libv8
it 'recognises correctly GCC' do
stub_as_available 'c++', :gcc, '4.9.0'
Compiler.available_compilers('c++').first.should be_a Compiler::GCC
stub_as_available 'g++', :gcc, '4.2.1-freebsd'
Compiler.available_compilers('g++').first.should be_a Compiler::GCC
end
it 'recognises correctly Clang' do
stub_as_available 'c++', :clang, '3.4.1'
Compiler.available_compilers('c++').first.should be_a Compiler::Clang
stub_as_available 'freebsd-clang++', :clang, '3.3-freebsd'
Compiler.available_compilers('freebsd-clang++').first.should be_a Compiler::Clang
end
it 'recognises correctly Apple\'s LLVM' do

View file

@ -5,9 +5,8 @@ module CompilerHelpers
"4.9.0" => %Q{Using built-in specs.\nCOLLECT_GCC=c++\nCOLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper\nTarget: x86_64-unknown-linux-gnu\nConfigured with: /build/gcc-multilib/src/gcc-4.9-20140604/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl --disable-cloog-version-check --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-multilib --disable-werror --enable-checking=release\nThread model: posix\ngcc version 4.9.0 20140604 (prerelease) (GCC)\n}
},
:clang => {
"3.3-freebsd" => %Q{FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610\nTarget: i386-unknown-freebsd9.2\nThread model: posix},
"3.4.1" => %Q{clang version 3.4.1 (tags/RELEASE_34/dot1-final)\nTarget: x86_64-unknown-linux-gnu\nThread model: posix\nFound candidate GCC installation: /usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\nSelected GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\n},
"3.10.0" => %Q{clang version 3.10.0 (tags/RELEASE_310/dot0-final)\nTarget: x86_64-unknown-linux-gnu\n},
"3.0.0" => %Q{clang version 3.0.0 (tags/RELEASE_30/dot0-final)\nTarget: x86_64-unknown-linux-gnu\n}
},
:apple_llvm => {
'5.1' => %Q{Configured with: --prefix=/Applications/Xcode.app/Contents/Developer//usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1\nApple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)\nTarget: x86_64-apple-darwin14.0.0\nThread model: posix\n}