[lua-torch-torch7] 04/06: rules: also run upstream unit tests

Zhou Mo cdluminate-guest at moszumanska.debian.org
Sun Aug 21 12:53:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

cdluminate-guest pushed a commit to branch master
in repository lua-torch-torch7.

commit f6c954a9e24e4bca99f067488f3bbf2044a868bf
Author: Zhou Mo <cdluminate at gmail.com>
Date:   Sun Aug 21 12:42:59 2016 +0000

    rules: also run upstream unit tests
---
 debian/changelog |  1 +
 debian/rules     | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6cbb423..e62cc24 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ lua-torch-torch7 (0~20160803-g17ff317-2) UNRELEASED; urgency=medium
     to fix the lua-torch-dok support.
   * Diverge the symbols control file of libTH.so for amd64 and i386,
     since SSE and AVX instruction sets are missing on other architectures.
+  * Override dh_auto_test to run upstream unit test `torch.test()` .
 
  -- Zhou Mo <cdluminate at gmail.com>  Sun, 21 Aug 2016 12:22:30 +0000
 
diff --git a/debian/rules b/debian/rules
index d9f21f1..2d4189d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -58,6 +58,18 @@ override_dh_auto_build:
 	# build the rest lua stuff with dh-lua
 	dh_auto_build --buildsystem=lua
 
+override_dh_auto_test:
+	-$(RM) -rf deb.test
+	# prepare lua files to launch a "torch.test()"
+	set -e; if ! test -d deb.test/torch; then mkdir -p deb.test/torch; fi
+	set -e; find . -name '*.so*' -exec cp -v '{}' deb.test/ \;
+	set -e; find . -name '*.lua' -exec cp -v '{}' deb.test/torch/ \;
+	set -e; cd deb.test; ln -s torch/init.lua torch.lua;
+	set -e; cd deb.test; \
+		LD_LIBRARY_PATH=$(ROOTDIR)/deb.test \
+		$(LUAJIT) -e "require 'torch'; torch.test();"
+	dh_auto_test
+
 override_dh_auto_install:
 	# install libTH.so
 	dh_auto_install --buildsystem=cmake -B TH.build

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/lua-torch-torch7.git



More information about the debian-science-commits mailing list