summaryrefslogtreecommitdiffstats
path: root/tester/rtems-run
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2020-09-25 11:22:34 +1000
committerChris Johns <chrisj@rtems.org>2020-09-26 10:49:27 +1000
commit87262b429d633420402e735a770f6d6cfedecf9a (patch)
tree6c9ee3464198f2d307b127d41060657565d2d34b /tester/rtems-run
parentlinkers: Update due to API changes (diff)
downloadrtems-tools-87262b429d633420402e735a770f6d6cfedecf9a.tar.bz2
Move all python commands to use env python
- If you host does not provide a python command consult the User manual for ways you can run the python commands. - Full package paths are being used to avoid namespace pollution and crosstalk.
Diffstat (limited to 'tester/rtems-run')
-rwxr-xr-xtester/rtems-run31
1 files changed, 17 insertions, 14 deletions
diff --git a/tester/rtems-run b/tester/rtems-run
index cf5f263..8c8b87d 100755
--- a/tester/rtems-run
+++ b/tester/rtems-run
@@ -1,7 +1,7 @@
-#! /bin/sh
+#! /usr/bin/env python
#
# RTEMS Tools Project (http://www.rtems.org/)
-# Copyright 2018 Chris Johns (chrisj@rtems.org)
+# Copyright 2017, 2020 Chris Johns (chrisj@rtems.org)
# All rights reserved.
#
# This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -28,15 +28,18 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
-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"
+
+from __future__ import print_function
+
+import sys, os
+
+base = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
+rtems = os.path.join(base, 'share', 'rtems')
+sys.path = sys.path[0:1] + [rtems, base] + sys.path[1:]
+
+try:
+ import tester.rt.run
+ tester.rt.run.run(sys.argv)
+except ImportError:
+ print("Incorrect RTEMS Tools installation", file = sys.stderr)
+ sys.exit(1)