diff options
| author | Markus Reiter | 2016-11-13 22:00:15 +0100 |
|---|---|---|
| committer | Markus Reiter | 2016-11-16 23:52:38 +0100 |
| commit | 7457af2b231528e1287281f6cfe651600d5f3f5d (patch) | |
| tree | 0da872ad2906fad53f176e05056181e0c6ccceaa /Library/Homebrew/test/stdlib_test.rb | |
| parent | 9dc1f8f3cd405bc299eb688075687f951afd3e13 (diff) | |
| download | brew-7457af2b231528e1287281f6cfe651600d5f3f5d.tar.bz2 | |
Move test files back directly to `test/`.
Diffstat (limited to 'Library/Homebrew/test/stdlib_test.rb')
| -rw-r--r-- | Library/Homebrew/test/stdlib_test.rb | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Library/Homebrew/test/stdlib_test.rb b/Library/Homebrew/test/stdlib_test.rb new file mode 100644 index 000000000..ee53e7c8c --- /dev/null +++ b/Library/Homebrew/test/stdlib_test.rb @@ -0,0 +1,61 @@ +require "testing_env" +require "formula" +require "cxxstdlib" + +class CxxStdlibTests < Homebrew::TestCase + def setup + @clang = CxxStdlib.create(:libstdcxx, :clang) + @gcc = CxxStdlib.create(:libstdcxx, :gcc) + @gcc4 = CxxStdlib.create(:libstdcxx, :gcc_4_0) + @gcc48 = CxxStdlib.create(:libstdcxx, "gcc-4.8") + @gcc49 = CxxStdlib.create(:libstdcxx, "gcc-4.9") + @lcxx = CxxStdlib.create(:libcxx, :clang) + @purec = CxxStdlib.create(nil, :clang) + end + + def test_apple_libstdcxx_intercompatibility + assert @clang.compatible_with?(@gcc) + assert @clang.compatible_with?(@gcc4) + end + + def test_compatibility_same_compilers_and_type + assert @gcc.compatible_with?(@gcc) + assert @gcc48.compatible_with?(@gcc48) + assert @clang.compatible_with?(@clang) + end + + def test_apple_gnu_libstdcxx_incompatibility + assert !@clang.compatible_with?(@gcc48) + assert !@gcc48.compatible_with?(@clang) + end + + def test_gnu_cross_version_incompatibility + assert !@gcc48.compatible_with?(@gcc49) + assert !@gcc49.compatible_with?(@gcc48) + end + + def test_libstdcxx_libcxx_incompatibility + assert !@clang.compatible_with?(@lcxx) + assert !@lcxx.compatible_with?(@clang) + end + + def test_apple_compiler_reporting + assert_predicate @clang, :apple_compiler? + assert_predicate @gcc, :apple_compiler? + assert_predicate @gcc4, :apple_compiler? + refute_predicate @gcc48, :apple_compiler? + end + + def test_type_string_formatting + assert_equal "libstdc++", @clang.type_string + assert_equal "libc++", @lcxx.type_string + end + + def test_compatibility_for_non_cxx_software + assert @purec.compatible_with?(@clang) + assert @clang.compatible_with?(@purec) + assert @purec.compatible_with?(@purec) + assert @purec.compatible_with?(@gcc48) + assert @gcc48.compatible_with?(@purec) + end +end |
