summaryrefslogtreecommitdiffstats
path: root/tester/rtems-run
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-11-07 14:55:20 +1100
committerChris Johns <chrisj@rtems.org>2018-11-08 18:13:45 +1100
commite058db02816d7729e7cfa898522a6073f5d7e714 (patch)
treeaa70574c9b277224be596553881e75fc3924111c /tester/rtems-run
parentrtemstoolkit: Fix the parsing of the revision string to a number. (diff)
downloadrtems-tools-e058db02816d7729e7cfa898522a6073f5d7e714.tar.bz2
python: Provide support to select a valid python version.
- Update imports after wrapping the code. - Fix python3 issues. - Fix config path issues for in repo and install runs. Closes #3537
Diffstat (limited to 'tester/rtems-run')
-rwxr-xr-xtester/rtems-run29
1 files changed, 14 insertions, 15 deletions
diff --git a/tester/rtems-run b/tester/rtems-run
index d6f2f56..cf5f263 100755
--- a/tester/rtems-run
+++ b/tester/rtems-run
@@ -1,7 +1,7 @@
-#! /usr/bin/env python
+#! /bin/sh
#
# RTEMS Tools Project (http://www.rtems.org/)
-# Copyright 2017 Chris Johns (chrisj@rtems.org)
+# Copyright 2018 Chris Johns (chrisj@rtems.org)
# All rights reserved.
#
# This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -28,16 +28,15 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
-
-import sys, os
-base = os.path.dirname(os.path.abspath(sys.argv[0]))
-parent = os.path.dirname(base)
-rtems = os.path.join(parent, 'share', 'rtems')
-sys.path = [parent, rtems, os.path.join(rtems, 'tester')] + sys.path
-
-try:
- import rt.run
- rt.run.run()
-except ImportError:
- print >> sys.stderr, "Incorrect RTEMS Tools installation"
- sys.exit(1)
+set -e
+base=$(dirname $(dirname $0))
+cmd=tester/rt/cmd-run.py
+PYTHON_WRAPPER=rtemstoolkit/python-wrapper.sh
+if test -f ${base}/${PYTHON_WRAPPER}; then
+ PYTHON_CMD=${base}/${cmd}
+ . ${base}/${PYTHON_WRAPPER}
+elif test -f ${base}/share/rtems/${PYTHON_WRAPPER}; then
+ PYTHON_CMD=${base}/share/rtems/${cmd}
+ . ${base}/share/rtems/${PYTHON_WRAPPER}
+fi
+echo "error: RTEMS Toolkit python wrapper not found, plrease report"