[metis] 04/05: Add autopkgtest.
Anton Gladky
gladk at moszumanska.debian.org
Fri Jun 13 19:57:38 UTC 2014
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository metis.
commit a28f7cfa92ad52ac17eb26ace707f61b6d54e198
Author: Anton Gladky <gladk at debian.org>
Date: Fri Jun 13 21:48:55 2014 +0200
Add autopkgtest.
---
debian/control | 1 +
debian/tests/build1 | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++
debian/tests/check1 | 26 ++++++++++
debian/tests/control | 2 +
4 files changed, 165 insertions(+)
diff --git a/debian/control b/debian/control
index c668cd2..c9e8db2 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,7 @@ Build-Depends:
debhelper (>= 9)
Vcs-Git: git://anonscm.debian.org/debian-science/packages/metis.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/metis.git
+XS-Testsuite: autopkgtest
Package: libmetis-dev
Section: libdevel
diff --git a/debian/tests/build1 b/debian/tests/build1
new file mode 100755
index 0000000..66e634f
--- /dev/null
+++ b/debian/tests/build1
@@ -0,0 +1,136 @@
+#!/bin/sh
+# autopkgtest check for metis
+# LL_metis.cpp has been taken from:
+# http://liberlocus.blogspot.de/2013/01/metis-parmetis.html
+# 2014/06/13
+#
+# (C) 2014 Anton Gladky
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+cat <<EOF > LL_metis.cpp
+/*
+02.06.2013 LiberLocus
+Metis from manual page 2,
+*/
+
+
+#include <iostream>
+#include <metis.h>
+
+using namespace std;
+
+int main(int argc, char *argv[]){
+
+ int result;
+// Needed by parmetis
+ idx_t nvtxs=15, ncon=1;
+ idx_t *xadj=NULL, *vsize=NULL, *adjncy=NULL;
+ idx_t *vwgt=NULL, *adjwgt=NULL;
+
+ idx_t nparts = 3;
+ real_t *tpwgts = NULL, *ubvec= NULL;
+ idx_t *options=NULL;
+ idx_t objval;
+ idx_t part[15];
+
+ cout << " Metis example from LiberLocus."<< '\n';
+
+ xadj = new idx_t[16];
+ adjncy = new idx_t[44];
+
+ xadj[0] = 0;
+ xadj[1] = 2;
+ xadj[2] = 5;
+ xadj[3] = 8;
+ xadj[4] = 11;
+ xadj[5] = 13;
+ xadj[6] = 16;
+ xadj[7] = 20;
+ xadj[8] = 24;
+ xadj[9] = 28;
+ xadj[10] = 31;
+ xadj[11] = 33;
+ xadj[12] = 36;
+ xadj[13] = 39;
+ xadj[14] = 42;
+ xadj[15] = 44;
+
+ adjncy[0] = 1;
+ adjncy[1] = 5;
+ adjncy[2] = 0;
+ adjncy[3] = 2;
+ adjncy[4] = 6;
+ adjncy[5] = 1;
+ adjncy[6] = 3;
+ adjncy[7] = 7;
+ adjncy[8] = 2;
+ adjncy[9] = 4;
+ adjncy[10] = 8;
+ adjncy[11] = 3;
+ adjncy[12] = 9;
+ adjncy[13] = 0;
+ adjncy[14] = 6;
+ adjncy[15] = 10;
+ adjncy[16] = 1;
+ adjncy[17] = 5;
+ adjncy[18] = 7;
+ adjncy[19] = 11;
+ adjncy[20] = 2;
+ adjncy[21] = 6;
+ adjncy[22] = 8;
+ adjncy[23] = 12;
+ adjncy[24] = 3;
+ adjncy[25] = 7;
+ adjncy[26] = 9;
+ adjncy[27] = 13;
+ adjncy[28] = 4;
+ adjncy[29] = 8;
+ adjncy[30] = 14;
+ adjncy[31] = 5;
+ adjncy[32] = 11;
+ adjncy[33] = 6;
+ adjncy[34] = 10;
+ adjncy[35] = 12;
+ adjncy[36] = 7;
+ adjncy[37] = 11;
+ adjncy[38] = 13;
+ adjncy[39] = 8;
+ adjncy[40] = 12;
+ adjncy[41] = 14;
+ adjncy[42] = 9;
+ adjncy[43] = 13;
+
+// result = METIS_PartGraphRecursive( &nvtxs, &ncon, xadj, adjncy, vwgt,
+// vsize, adjwgt, &nparts, tpwgts,
+// ubvec, options, &objval, part);
+ result = METIS_PartGraphKway( &nvtxs, &ncon, xadj, adjncy, vwgt,
+ vsize, adjwgt, &nparts, tpwgts,
+ ubvec, options, &objval, part);
+
+ cout << "npart is " << '\n';
+ for(int i=0; i<15; i++){
+ cout << part[i] << " ";
+ }
+ cout << '\n';
+
+ delete xadj;
+ delete adjncy;
+
+ cout << "Metis returned successfully." << '\n';
+
+ return 0;
+
+}
+
+EOF
+
+g++ -o LL_metis LL_metis.cpp -lmetis
+echo "build: OK"
+[ -x LL_metis ]
+./LL_metis
+echo "run: OK"
diff --git a/debian/tests/check1 b/debian/tests/check1
new file mode 100755
index 0000000..9aa8555
--- /dev/null
+++ b/debian/tests/check1
@@ -0,0 +1,26 @@
+#!/bin/sh
+# autopkgtest check for metis
+# (C) 2014 Anton Gladky
+
+set -e
+
+export OMPI_MCA_orte_rsh_agent=/bin/false
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cp graphs/* $WORKDIR/
+cd $WORKDIR
+
+graphchk 4elt.graph
+graphchk copter2.graph
+graphchk mdual.graph
+graphchk test.mgraph
+
+gpmetis 4elt.graph 10
+gpmetis copter2.graph 10
+gpmetis mdual.graph 10
+gpmetis test.mgraph 10
+
+mpmetis metis.mesh 4
+m2gmetis metis.mesh 25
+echo "run: OK"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..dd2546c
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: check1 build1
+Depends: metis, libmetis-dev, build-essential
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/metis.git
More information about the debian-science-commits
mailing list