[rtems-tools commit] rtemstoolkit/host: Fix the darwin support.

Chris Johns chrisj at rtems.org
Wed Nov 28 23:20:23 UTC 2018


Module:    rtems-tools
Branch:    master
Commit:    6db01e577fed1dc88018106b81dd531f2ecc1fd0
Changeset: http://git.rtems.org/rtems-tools/commit/?id=6db01e577fed1dc88018106b81dd531f2ecc1fd0

Author:    Chris Johns <chrisj at rtems.org>
Date:      Thu Nov 29 10:14:14 2018 +1100

rtemstoolkit/host: Fix the darwin support.

- Add python as a unit test variant.

---

 rtemstoolkit/darwin.py |  3 +--
 rtemstoolkit/host.py   |  4 ++--
 wscript                | 13 +++++++------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/rtemstoolkit/darwin.py b/rtemstoolkit/darwin.py
index f7ce0da..e780d1d 100644
--- a/rtemstoolkit/darwin.py
+++ b/rtemstoolkit/darwin.py
@@ -49,7 +49,7 @@ def cpus():
 
 def overrides():
     uname = os.uname()
-    ncpus = '%d' % (cores())
+    ncpus = '%d' % (cpus())
     defines = {
         '_ncpus':         ('none',    'none',     ncpus),
         '_os':            ('none',    'none',     'darwin'),
@@ -63,7 +63,6 @@ def overrides():
         '_usr':           ('dir',     'optional', '/usr/local'),
         '_var':           ('dir',     'optional', '/usr/local/var'),
         '__ldconfig':     ('exe',     'none',     ''),
-        '__cvs':          ('exe',     'required', 'cvs'),
         '__xz':           ('exe',     'required', '%{_usr}/bin/xz'),
         'with_zlib':      ('none',    'none',     '--with-zlib=no'),
         '_forced_static': ('none',    'none',     '')
diff --git a/rtemstoolkit/host.py b/rtemstoolkit/host.py
index ba24c9d..5319c92 100644
--- a/rtemstoolkit/host.py
+++ b/rtemstoolkit/host.py
@@ -56,11 +56,11 @@ def _load():
         if uname[0].startswith('MINGW64_NT') or uname[0].startswith('CYGWIN_NT'):
             name = 'windows'
         elif uname[0] == 'Darwin':
-            name = darwin
+            name = 'darwin'
         elif uname[0] == 'FreeBSD':
             name = 'freebsd'
         elif uname[0] == 'NetBSD':
-            name = netbsd
+            name = 'netbsd'
         elif uname[0] == 'Linux':
             name = 'linux'
         elif uname[0] == 'SunOS':
diff --git a/wscript b/wscript
index e3aaecb..f491d70 100644
--- a/wscript
+++ b/wscript
@@ -100,6 +100,7 @@ def configure(ctx):
     #
     # Find which versions of python are installed for testing.
     #
+    ctx.find_program('python', mandatory = False)
     ctx.find_program('python2', mandatory = False)
     ctx.find_program('python3', mandatory = False)
     #
@@ -158,12 +159,12 @@ def rtemstoolkit_tests(ctx):
     log = ctx.path.find_or_declare('tests.log')
     ctx.logger = waflib.Logs.make_logger(log.abspath(), 'build')
     failures = False
-    for py in ['2', '3']:
-        PY = 'PYTHON%s' % (py)
-        if PY in ctx.env:
-            from rtemstoolkit import all as toolkit_tests
-            from rtemstoolkit import args as toolkit_test_args
-            for tt in toolkit_tests:
+    from rtemstoolkit import all as toolkit_tests
+    from rtemstoolkit import args as toolkit_test_args
+    for tt in toolkit_tests:
+        for py in ['', '2', '3']:
+            PY = 'PYTHON%s' % (py)
+            if PY in ctx.env:
                 test = 'rtemstoolkit.%s' % (tt)
                 ctx.start_msg('Test python%s %s' % (py, test))
                 cmd = '%s -m %s' % (ctx.env[PY][0], test)




More information about the vc mailing list