2
0

xmake.lua 1.4 KB

123456789101112131415161718192021222324252627282930
  1. package("unity_test")
  2. set_homepage("http://www.throwtheswitch.org/unity")
  3. set_description("Simple Unit Testing for C")
  4. set_license("MIT")
  5. add_urls("https://github.com/ThrowTheSwitch/Unity/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/ThrowTheSwitch/Unity.git")
  7. add_versions("v2.6.0", "aa4c9fb1ae5fc5242f914c65f3557e817e40cb37f04a31e5ff76d1ab89dbf674")
  8. add_versions("v2.5.2", "3786de6c8f389be3894feae4f7d8680a02e70ed4dbcce36109c8f8646da2671a")
  9. add_versions("v2.5.1", "5ce08ef62f5f64d18f8137b3eaa6d29199ee81d1fc952cef0eea96660a2caf47")
  10. add_versions("v2.5.0", "d470165dc46652cf73fda54e2650b483b94a7e24ccf793ded28615729b2f41ed")
  11. add_versions("v2.4.3", "a8c5e384f511a03c603bbecc9edc24d2cb4a916998d51a29cf2e3a2896920d03")
  12. add_deps("cmake")
  13. on_install(function (package)
  14. local configs = {"-DUNITY_EXTENSION_FIXTURE=ON", "-DUNITY_EXTENSION_MEMORY=ON"}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  17. import("package.tools.cmake").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:check_csnippets({test = [[
  21. void test_main(void) {
  22. TEST_ASSERT_EQUAL_INT(1, 1);
  23. }
  24. ]]}, {includes = "unity/unity.h"}))
  25. end)