improve test.lua

pull/13/head
ruki 6 years ago
parent e12398632a
commit 21b9cde1ad
No known key found for this signature in database
GPG Key ID: 33341DF9719963FA
  1. 2
      .appveyor.yml
  2. 2
      .travis.yml
  3. 5
      packages/f/freetype/xmake.lua
  4. 29
      scripts/test.lua

@ -11,5 +11,5 @@ before_build:
- cmd: xmake --version
build_script:
- cmd: xmake l scripts/test.lua
- cmd: xmake l scripts/test.lua -D

@ -14,5 +14,5 @@ install:
- cd -
script:
- travis_wait 60 xmake l ./scripts/test.lua
- travis_wait 60 xmake l ./scripts/test.lua -D

@ -12,10 +12,7 @@ package("freetype")
add_versions("2.9.1", "db8d87ea720ea9d5edc5388fc7a0497bb11ba9fe972245e0f7f4c7e8b1e1e84d")
end
add_deps("libpng")
if not is_plat("macosx") then
add_deps("bzip2", "zlib")
end
add_deps("libpng", "bzip2", "zlib")
if not is_plat("windows") then
add_includedirs("include/freetype2")

@ -1,5 +1,22 @@
-- imports
import("core.base.option")
-- the options
local options =
{
{'v', "verbose", "k", nil, "Enable verbose information." }
, {'D', "diagnosis", "k", nil, "Enable diagnosis information." }
, {nil, "packages", "vs", nil, "The package list." }
}
-- the main entry
function main(...)
local packages = {...}
-- parse arguments
local argv = option.parse({...}, options, "Test all the given or changed packages.")
-- get packages
local packages = argv.packages
if #packages == 0 then
local files = os.iorun("git diff --name-only HEAD^")
for _, file in ipairs(files:split('\n'), string.trim) do
@ -24,5 +41,13 @@ function main(...)
print(os.curdir())
os.exec("xmake repo --add local-repo %s", repodir)
os.exec("xmake repo -l")
os.exec("xmake require -f -D -y %s", table.concat(packages, " "))
local require_argv = {"require", "-f", "-y"}
if argv.verbose then
table.insert(require_argv, "-v")
end
if argv.diagnosis then
table.insert(require_argv, "-D")
end
table.join2(require_argv, packages)
os.execv("xmake", require_argv)
end

Loading…
Cancel
Save