summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTitanSnow <[email protected]>2017-05-14 14:45:37 +0800
committerTitanSnow <[email protected]>2017-05-14 14:56:21 +0800
commit72292a6a32ed578eedbcd6e1f1739fd664663f98 (patch)
treeb3e435790c41d906d22d220e91c9faeb6d1e9943
parentd0ab950d6c28147d56fc287e937bafe651596b9e (diff)
add coverage for C ext
-rw-r--r--.travis.yml1
l---------core/pkg/tbox.pkg/lib/coverage1
-rw-r--r--core/xmake.lua6
3 files changed, 8 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 4440de76c..940c60038 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,6 +20,7 @@ install:
script:
- scripts/get.sh __local__
- xmake lua versioninfo
+ - xmake f -m coverage -P core
- xmake -P core
- export XMAKE_PROGRAM_DIR=$PWD/xmake
- core/build/xmake lua versioninfo
diff --git a/core/pkg/tbox.pkg/lib/coverage b/core/pkg/tbox.pkg/lib/coverage
new file mode 120000
index 000000000..30b81dbfd
--- /dev/null
+++ b/core/pkg/tbox.pkg/lib/coverage
@@ -0,0 +1 @@
+release \ No newline at end of file
diff --git a/core/xmake.lua b/core/xmake.lua
index b53b9a94c..fe911558e 100644
--- a/core/xmake.lua
+++ b/core/xmake.lua
@@ -48,6 +48,12 @@ if is_plat("macosx") then
add_ldflags("-all_load", "-pagezero_size 10000", "-image_base 100000000")
end
+-- for mode coverage
+if is_mode("coverage") then
+ add_cxflags("-coverage")
+ add_ldflags("-coverage")
+end
+
-- add package directories
add_packagedirs("pkg")