Parcourir la source

improve tests

ruki il y a 6 ans
Parent
commit
bd89083dfc
3 fichiers modifiés avec 10 ajouts et 3 suppressions
  1. 1 1
      packages/p/pcre/xmake.lua
  2. 1 1
      packages/p/pcre2/xmake.lua
  3. 8 1
      packages/t/tbox/xmake.lua

+ 1 - 1
packages/p/pcre/xmake.lua

@@ -62,5 +62,5 @@ package("pcre")
     on_test(function (package)
         local bitwidth = package:config("bitwidth") or "8"
         local testfunc = string.format("pcre%s_compile", bitwidth ~= "8" and bitwidth or "")
-        assert(import("lib.detect.has_cfuncs")(testfunc, {configs = package:fetch(), includes = "pcre.h", links = package:get("links")}))
+        assert(import("lib.detect.has_cfuncs")(testfunc, {configs = package:fetch(), includes = "pcre.h"}))
     end)

+ 1 - 1
packages/p/pcre2/xmake.lua

@@ -64,5 +64,5 @@ package("pcre2")
     end)
 
     on_test(function (package)
-        assert(import("lib.detect.has_cfuncs")("pcre2_compile", {configs = package:fetch(), includes = "pcre2.h", links = package:get("links")}))
+        assert(import("lib.detect.has_cfuncs")("pcre2_compile", {configs = package:fetch(), includes = "pcre2.h"}))
     end)

+ 8 - 1
packages/t/tbox/xmake.lua

@@ -23,6 +23,13 @@ package("tbox")
         if package:debug() then
             package:add("defines", "__tb_debug__")
         end
+        if package:plat() == "windows" then
+            package:add("syslinks", "ws2_32")
+        elseif package:plat() == "mingw" then
+            package:add("syslinks", "ws2_32", "pthread")
+        else
+            package:add("syslinks", "pthread")
+        end
     end)
 
     on_install(function (package)
@@ -44,5 +51,5 @@ package("tbox")
     end)
 
     on_test(function (package)
-        assert(import("lib.detect.has_cfuncs")("tb_exit", {configs = package:fetch(), includes = "tbox/tbox.h", links = "tbox"}))
+        assert(import("lib.detect.has_cfuncs")("tb_exit", {configs = package:fetch(), includes = "tbox/tbox.h"}))
     end)