1 |
commit: eeb1f8f01069f88a8619c47c6794697677b8b421 |
2 |
Author: André Erdmann <dywi <AT> mailerd <DOT> de> |
3 |
AuthorDate: Tue Jul 2 21:07:58 2013 +0000 |
4 |
Commit: André Erdmann <dywi <AT> mailerd <DOT> de> |
5 |
CommitDate: Tue Jul 2 21:07:58 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=eeb1f8f0 |
7 |
|
8 |
run_tests.sh/run_tests.py |
9 |
|
10 |
run_tests.py runs some tests from roverlay/tests. |
11 |
|
12 |
run_tests.sh runs run_tests.py with both python2 and python3 as interpreter. |
13 |
|
14 |
--- |
15 |
run_tests.py | 10 ++++++++++ |
16 |
run_tests.sh | 21 +++++++++++++++++++++ |
17 |
2 files changed, 31 insertions(+) |
18 |
|
19 |
diff --git a/run_tests.py b/run_tests.py |
20 |
new file mode 100755 |
21 |
index 0000000..b3156f1 |
22 |
--- /dev/null |
23 |
+++ b/run_tests.py |
24 |
@@ -0,0 +1,10 @@ |
25 |
+#!/usr/bin/python |
26 |
+ |
27 |
+import unittest |
28 |
+ |
29 |
+import tests.depres |
30 |
+ |
31 |
+ |
32 |
+if __name__ == '__main__': |
33 |
+ tests = tests.depres.suite() |
34 |
+ unittest.TextTestRunner ( verbosity=2 ).run ( tests ) |
35 |
|
36 |
diff --git a/run_tests.sh b/run_tests.sh |
37 |
new file mode 100755 |
38 |
index 0000000..48ed757 |
39 |
--- /dev/null |
40 |
+++ b/run_tests.sh |
41 |
@@ -0,0 +1,21 @@ |
42 |
+#!/bin/sh |
43 |
+cd "${0%/*}" || exit |
44 |
+ |
45 |
+TESTPY="${PWD}/run_tests.py" |
46 |
+first=Y |
47 |
+ |
48 |
+conf="${PWD}/R-overlay.conf" |
49 |
+tconf="${conf}.tests" |
50 |
+ |
51 |
+[ -e "${tconf}" ] || { ln -vs -- "${conf}" "${tconf}" && first=; } || exit |
52 |
+ |
53 |
+for PYTHON in python2 python3; do |
54 |
+ if which ${PYTHON} 1>/dev/null 2>/dev/null; then |
55 |
+ [ -n "${first}" ] && first= || echo |
56 |
+ echo "*** Running ${TESTPY##*/} with PYTHON=${PYTHON} ***" |
57 |
+ echo |
58 |
+ PYTHONPATH="${PWD}" ${PYTHON} "${TESTPY}" |
59 |
+ else |
60 |
+ echo "PYTHON=${PYTHON} not found." 1>&2 |
61 |
+ fi |
62 |
+done |