pull/18/head
fasiondog 5 years ago
parent c7fd13ac51
commit 590420ecc7
  1. 24
      packages/c/catch2/xmake.lua

@ -0,0 +1,24 @@
package("catch2")
set_homepage("https://github.com/catchorg/Catch2")
set_description("Catch2 is a multi-paradigm test framework for C++. which also supports Objective-C (and maybe C). ")
add_urls("https://github.com/catchorg/Catch2/archive/v$(version).zip")
add_versions("2.9.2", "dc486300de22b0d36ddba1705abb07b9e5780639d824ba172ddf7062b2a1bf8f")
on_install(function (package)
os.cp("single_include/catch2", package:installdir("include"))
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
int factorial(int number) { return number <= 1 ? number : factorial(number - 1) * number; }
TEST_CASE("testing the factorial function") {
CHECK(factorial(1) == 1);
CHECK(factorial(2) == 2);
CHECK(factorial(3) == 6);
CHECK(factorial(10) == 3628800);
}
]]}, {configs = {languages = "c++11"}, includes = "catch2/catch.hpp", defines = "CATCH_CONFIG_MAIN "}))
end)
Loading…
Cancel
Save