test/test_pkg_config.rb in pkg-config-1.3.7 vs test/test_pkg_config.rb in pkg-config-1.3.8

- old
+ new

@@ -34,14 +34,65 @@ assert_pkg_config("cairo", ["--cflags-only-I"], @cairo.cflags_only_I) only_pkg_config_version(0, 29) assert_pkg_config("cairo-png", ["--cflags-only-I"], @cairo_png.cflags_only_I) end + def split_lib_flags(libs_command_line) + @cairo.__send__(:split_lib_flags, libs_command_line) + end + + def test_split_libs + assert_equal([ + "-L/usr/local/Cellar/gtk+3/3.24.10/lib", + "-L/usr/local/Cellar/pango/1.44.3/lib", + "-L/usr/local/Cellar/harfbuzz/2.5.3/lib", + "-L/usr/local/Cellar/gdk-pixbuf/2.38.1_1/lib", + "-L/usr/local/Cellar/cairo/1.16.0_2/lib", + "-L/usr/local/Cellar/glib/2.60.6/lib", + "-L/usr/local/opt/gettext/lib", + "-lgdk-3", + "-framework", "Cocoa", + "-framework", "Carbon", + "-framework", "CoreGraphics", + "-lpangocairo-1.0", + "-lpango-1.0", + "-lharfbuzz", + "-lgdk_pixbuf-2.0", + "-lcairo-gobject", + "-lcairo", + "-lgobject-2.0", + "-lglib-2.0", + "-lintl" + ], + split_lib_flags("-L/usr/local/Cellar/gtk+3/3.24.10/lib " + + "-L/usr/local/Cellar/pango/1.44.3/lib " + + "-L/usr/local/Cellar/harfbuzz/2.5.3/lib " + + "-L/usr/local/Cellar/gdk-pixbuf/2.38.1_1/lib " + + "-L/usr/local/Cellar/cairo/1.16.0_2/lib " + + "-L/usr/local/Cellar/glib/2.60.6/lib " + + "-L/usr/local/opt/gettext/lib " + + "-lgdk-3 " + + "-framework Cocoa " + + "-framework Carbon " + + "-framework CoreGraphics " + + "-lpangocairo-1.0 " + + "-lpango-1.0 " + + "-lharfbuzz " + + "-lgdk_pixbuf-2.0 " + + "-lcairo-gobject " + + "-lcairo " + + "-lgobject-2.0 " + + "-lglib-2.0 " + + "-lintl")) + end + def test_libs assert_pkg_config("cairo", ["--libs"], @cairo.libs) assert_pkg_config("cairo-png", ["--libs"], @cairo_png.libs) + end + def test_libs_msvc @cairo.msvc_syntax = true result = pkg_config("cairo", "--libs") msvc_result = result.gsub(/-lcairo\b/, "cairo.lib") msvc_result = msvc_result.gsub(/-L/, '/libpath:') assert_not_equal(msvc_result, result) @@ -49,21 +100,25 @@ end def test_libs_only_l assert_pkg_config("cairo", ["--libs-only-l"], @cairo.libs_only_l) assert_pkg_config("cairo-png", ["--libs-only-l"], @cairo_png.libs_only_l) + end + def test_libs_only_l_msvc @cairo_png.msvc_syntax = true result = pkg_config("cairo-png", "--libs-only-l") msvc_result = result.gsub(/-l(cairo|png[0-9]+|z)\b/, '\1.lib') assert_not_equal(msvc_result, result) assert_equal(msvc_result, @cairo_png.libs_only_l) end def test_libs_only_L assert_pkg_config("cairo", ["--libs-only-L"], @cairo.libs_only_L) assert_pkg_config("cairo-png", ["--libs-only-L"], @cairo_png.libs_only_L) + end + def test_libs_only_L_msvc @cairo_png.msvc_syntax = true result = pkg_config("cairo-png", "--libs-only-L") msvc_result = result.gsub(/-L/, '/libpath:') assert_not_equal(msvc_result, result) assert_equal(msvc_result, @cairo_png.libs_only_L)