Index: framework/FileUtils.cls
===================================================================
--- framework/FileUtils.cls	(revision 11796)
+++ framework/FileUtils.cls	(working copy)
@@ -1,7 +1,3 @@
-/*
-  SVN Revision: $Rev: 3047 $
-  Change Date:  $Date: 2008-08-22 19:56:58 -0700 (Fri, 22 Aug 2008) $
-*/
 /*----------------------------------------------------------------------------*/
 /*                                                                            */
 /* Copyright (c) 2007-2019 Rexx Language Association. All rights reserved.    */
@@ -43,6 +39,10 @@
  *
  * Provides common public routines and utility classes to do file system related
  * tasks, to make writing test units easier.
+
+ * Amended 14.02.2019 P.O. Jonsson
+ * Added support for Linux Mint 19.1
+
  */
 
 
@@ -66,6 +66,10 @@
  *          9999 is returned as an error indication.
  */
 ::routine issueCmd public
+
+--say 'In issueCmd'
+trace o
+
   use strict arg cmd, output
 
   if \ output~isInstanceOf(.array) then return 9999
@@ -77,6 +81,7 @@
     when .ooRexxUnit.OSName == "WINDOWS" then stdErrToStdOut = '2>&1'
     when .ooRexxUnit.OSName == "LINUX" then stdErrToStdOut = '2>&1'
     when .ooRexxUnit.OSName == "AIX" then stdErrToStdOut = '2>&1'
+    when .ooRexxUnit.OSName == "DARWIN" then stdErrToStdOut = '2>&1'
     otherwise stdErrToStdOut = '2>&1'
   end
 
@@ -109,6 +114,9 @@
  */
 ::routine findBuildDir public
 
+--say 'In findBuildDir'
+trace o
+
   -- When the -Dname=value arg is added to testOORexx then it will over-ride
   -- all else.  TODO check that this is the correct name.
   if .local~hasEntry("OOREXX_BUILD_HOME") then return .OOREXX_BUILD_HOME
@@ -115,7 +123,7 @@
 
   -- Setting the variable in the environment will be next in the order of
   -- precedence.  TODO change the REXX_BUILD_HOME var in the make files.
-  dir = value("OOREXX_BUILD_HOME", , 'ENVIRONMENT'); -- say 'dir:' dir
+  dir = value("OOREXX_BUILD_HOME", , 'ENVIRONMENT'); -- --say 'dir:' dir
   if dir \== "" then return dir
 
   -- Change directory to the directory the test suite was started from.  If we
@@ -158,6 +166,15 @@
       end
     end
 
+    when currentOS == "DARWIN" then do
+      -- this is only looking for ooRexx in the path set by the jenkins macOS slave machine, amend if necessary
+      -- this can certainly be made more beautiful
+      builddir = "~/workspace/ooRexx-macOS1014-build/oorexxBuild/bin/rexx"
+      FINDstream = .stream~new(builddir)
+      dir = FINDstream~qualify
+      if dir~pos(builddir~subStr(2,)) > 0 then dir = dir~left(dir~pos('/bin/rexx') -1)
+      else  dir = .nil
+    end
     otherwise do
       nop
     end
@@ -185,6 +202,9 @@
  */
 ::routine findInstallDir public
 
+--say 'In findInstallDir'
+trace o
+
   dir = .nil
   currentOS = .ooRexxUnit.OSName
 
@@ -198,7 +218,7 @@
     when currentOS == "WINDOWS" then do
       -- On Windows, the install package sets REXX_HOME.
       home = value("REXX_HOME", , 'ENVIRONMENT')
---    say 'home:' home
+--    --say 'home:' home
 
       -- Verify (to some degree) that this is the correct install directory.
       if home \== "" then do
@@ -211,6 +231,9 @@
     when currentOS == "LINUX" | currentOS == "AIX" then do
       dir = findInstallDirOnUnix()
     end
+    when currentOS == "DARWIN" then do
+      dir = findInstallDirOnDARWIN()
+    end
 
     otherwise nop
   end
@@ -222,7 +245,7 @@
 /** locateSamplePrg()
  * Locates a sample program normally shipped with the ooRexx distribution.
  *
- * The sample is searched for in the location(s) for samples programsin a normal
+ * The sample is searched for in the location(s) for samples programs in a normal
  * install.  If it is not found, an attempt to find it using the assumption that
  * the test is being executed from within a build directory.  This second search
  * allows the test suite to be run by a developer from his build directory
@@ -235,6 +258,10 @@
  *          .nil.
  */
 ::routine locateSamplePrg public
+
+--say 'In locateSamplePrg'
+trace o
+
   use strict arg name
 
   retObj = .nil
@@ -278,6 +305,9 @@
       retObj = locateSampleOnUnix(name, installDir)
     end
 
+    when currentOS == "DARWIN" then do
+      retObj = locateSampleOnDARWIN(name, installDir)
+    end
     otherwise do
       nop
     end
@@ -287,6 +317,10 @@
 -- End locateSamplePrg()
 
 ::routine locateSampleOnUnix
+
+--say 'In locateSampleOnUnix'
+trace o
+
   use strict arg name, installDir
 
   retObj = .nil
@@ -318,6 +352,42 @@
 return retObj
 -- End locateSampleOnUnix()
 
+::routine locateSampleOnDARWIN
+
+--say 'In locateSampleOnDARWIN'
+trace o
+
+  use strict arg name, installDir
+  retObj = .nil
+  if installDir \== .nil then do
+    j = SysFileTree(installDir'/share/ooRexx/'name, f., 'FOS')
+    if j == 0, f.0 == 1, SysIsFile(f.1) then do
+      retObj = f.1
+    end
+    else do	-- exception for BSF4ooRexx installer
+      j = SysFileTree(installDir'/shared/ooRexx/'name, f., 'FOS')
+      if j == 0, f.0 == 1, SysIsFile(f.1) then do
+        retObj = f.1
+      end
+    end
+  end
+  if retObj == .nil then do
+    -- Not found, see if we can get a build directory
+    buildRoot = findBuildDir()
+    if buildRoot \== .nil then do
+      sampleDir = buildRoot || "/samples/"
+      if SysIsFileDirectory(sampleDir) then do
+        -- Okay, we are good (in all probability.)
+        j = SysFileTree(sampleDir || name, f., 'FOS')
+        if j == 0, f.0 == 1, SysIsFile(f.1) then do
+          retObj = f.1
+        end
+      end
+    end
+  end
+return retObj
+-- End locateSampleOnDARWIN()
+
 /** findInstallDirOnUnix()
  * Tries to locate the install directory on a Unix-like system using what is
  * known about how ooRexx gets installed on those systems.
@@ -327,38 +397,45 @@
  */
 ::routine findInstallDirOnUnix
 
+--say 'In findInstallDirOnUnix'
+trace o
+
   dir = .nil
 
-  -- See if we can locate rexx.img using a package manager.
+  -- See if we can locate rexx executable using a package manager.
   select
     when haveRpm() then do
-      imageFile = checkRpmForInstalledFile("rexx.img")
+      execFile = checkRpmForInstalledFile("rexx")
     end
 
     when haveDpkg() then do
-      imageFile = checkDpkgForInstalledFile("rexx.img")
+      execFile = checkDpkgForInstalledFile("rexx")
     end
 
     when haveLpp() then do
-      imageFile = checkLppForInstalledFile("rexx.img")
+      execFile = checkLppForInstalledFile("rexx")
     end
 
-    otherwise imageFile = .nil
+    otherwise execFile = .nil
   end
   -- End select
 
   -- If no luck, try the default install location
-  if imageFile == .nil then do
-    imageFile = "/opt/ooRexx/bin/rexx.img"
+  if execFile == .nil then do
+    execFile = "/usr/local/bin/rexx"
   end
 
-  if SysIsFile(imageFile) then do
-    p = imageFile~pos("/bin/rexx.img")
+  if SysIsFile(execFile) then do
+    p = execFile~pos("/bin/rexx")
     if p <> 0 then do
-      return imageFile~left(p - 1)
+      return execFile~left(p - 1)
     end
   end
 
+  -- Still no luck? look if the executable for ooRexx is in the path
+  dir = SysSearchPath("PATH", "/bin/rexx")
+  if dir \== "" then return dir~left(dir~pos("/bin/rexx")-1)
+
   -- Still didn't find it.  Try one more thing.  The problem with this, is that
   -- if we find a rexx, we need to be sure it is ooRexx.  And, it is assuming
   -- the install set up a soft link.
@@ -392,7 +469,38 @@
 return dir
 -- End findInstallDirOnUnix()
 
+/** findInstallDirOnDARWIN()
+ * Tries to locate the install directory on macOS (DARWIN) using what is
+ * known about how ooRexx gets installed on that system.
+ *
+ * @return   The fully qualified directory path to an installed ooRexx on
+ *           success, otherwise .nil.
+ */
+::routine findInstallDirOnDARWIN
+
+--say 'findInstallDirOnDARWIN'
+trace o
+
+    -- assume that /bin for ooRexx is in the path
+    dir = SysSearchPath("PATH", "/bin/rexx")
+    if dir \== "" then return dir~left(dir~pos("/bin/rexx")-1)
+  -- If this is not the case, see if we can locate rexx in some known install locations.
+    -- BSF4ooRexx WARNING uses shared/ooRexx instead of share/ooRexx for samples !
+    dir = SysSearchPath("/Library/Frameworks/ooRexx.framework/Versions/A/Commands", "rexx")
+    if dir \== "" then return dir~left(dir~pos("/Commands/rexx")-1)
+   -- system wide installation in /opt
+    dir = SysSearchPath("/opt/ooRexx5/bin", "rexx")
+    if dir \== "" then return dir~left(dir~pos("/bin/rexx")-1)  
+   -- system wide installation in /usr/local
+    dir = SysSearchPath("/usr/local/ooRexx5/bin", "rexx")
+    if dir \== "" then return dir~left(dir~pos("/bin/rexx")-1)  
+return dir
+-- End findInstallDirOnDARWIN()
 ::routine haveRpm public
+
+--say 'In haveRpm'
+trace o
+
   cmdOut = .array~new
   ret = issueCmd('which rpm', cmdOut)
   if ret == 0 then return .true
@@ -399,6 +507,10 @@
   else return .false
 
 ::routine haveDpkg public
+
+--say 'In haveDpkg'
+trace o
+
   cmdOut = .array~new
   ret = issueCmd('which dpkg', cmdOut)
   if ret == 0 then return .true
@@ -405,6 +517,10 @@
   else return .false
 
 ::routine haveLpp public
+
+--say 'In haveLpp'
+trace o
+
   cmdOut = .array~new
   ret = issueCmd('which lslpp', cmdOut)
   if ret == 0 then return .true
@@ -421,6 +537,10 @@
  @          installed as part of the ooRexx package, otherwise .nil.
  */
 ::routine checkRpmForInstalledFile public
+
+--say 'In checkRpmForInstalledFile'
+trace o
+
   use strict arg name
 
   fileName = .nil
@@ -449,6 +569,10 @@
  @          installed as part of the ooRexx package, otherwise .nil.
  */
 ::routine checkDpkgForInstalledFile public
+
+--say 'In checkDpkgForInstalledFile'
+trace o
+
   use strict arg name
 
   fileName = .nil
@@ -476,6 +600,10 @@
  @          installed as part of the ooRexx package, otherwise .nil.
  */
 ::routine checkLppForInstalledFile public
+
+--say 'In checkLppForInstalledFile'
+trace o
+
   use strict arg name
 
   fileName = .nil
@@ -495,6 +623,10 @@
   return fileName
 
 ::routine escapeDots
+
+--say 'In escapeDots'
+trace o
+
   use strict arg name
 
   escName = ""
@@ -523,6 +655,10 @@
     on error.
 \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
 ::routine createFile public
+
+--say 'In createFile'
+trace o
+
   use strict arg src, name
 
   fileName = ""
@@ -539,6 +675,10 @@
 
 /* Convenience method.  Calls createFile() with .rex tacked onto basename. */
 ::routine createRexxPrgFile public
+
+--say 'In createRexxPrgFile'
+trace o
+
   use strict arg src, baseName
 return createFile(src, baseName || '.rex')
 
@@ -558,6 +698,10 @@
     on error.
 \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
 ::routine addToFile public
+
+--say 'In addToFile'
+trace o
+
   use strict arg src, name
 
   fileName = ""
@@ -588,6 +732,10 @@
     The operating system return code when the delete is done.
 \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
 ::routine deleteFile public
+
+--say 'In deleteFile'
+trace o
+
   use strict arg fileName
 
   -- On AIX (ksh), Linux (bash) and Windows the delete can be forced.  Not sure
@@ -610,6 +758,10 @@
       'rm -f' .TestUtil~enQuote(fileName) '>/dev/null 2>&1'
       ret = RC
     end
+    when .ooRexxUnit.OSName == "DARWIN" then do
+      'rm -f' .TestUtil~enQuote(fileName) '>/dev/null 2>&1'
+      ret = RC
+    end
     otherwise ret = SysFileDelete(fileName)
   end
 
@@ -640,6 +792,10 @@
     for an internal error.
 \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
 ::routine execRexxPrgWithArgs public
+
+--say 'In execRexxPrgWithArgs'
+trace o
+
   use strict arg prgName, params, output
 
   cmd = 'rexx' .TestUtil~enQuote(prgName) params
@@ -653,6 +809,10 @@
  * delegates to execRexxPrgWithArgs().
  */
 ::routine execRexxPrg public
+
+--say 'In execRexxPrg'
+trace o
+
   use strict arg prgName, output
 return execRexxPrgWithArgs(prgName, "", output)
 
@@ -682,6 +842,10 @@
     An instance of .OLEObject on success, .nil on failure.
 \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
 ::routine createOleObject public
+
+--say 'In createOleObject'
+trace o
+
   use strict arg id, withEvents = .false, beVerbose = .false
 
   if \ isBoolean(withEvents) then
@@ -700,8 +864,8 @@
 returnNil:
   if beVerbose then do
     cObj = condition("O")
-    say "Error" rc":    " errortext(rc)
-    say "Code " cObj~code":" cObj~message
+    --say "Error" rc":    " errortext(rc)
+    --say "Code " cObj~code":" cObj~message
   end
 
   return .nil
@@ -721,6 +885,10 @@
  *          code produced by the failure to create the OLE Automation object.
  */
 ::routine testForOleObject public
+
+--say 'In testForOleObject'
+trace o
+
   use strict arg id
 
   signal on syntax name returnCode
Index: setTestEnv.sh
===================================================================
--- setTestEnv.sh	(revision 11796)
+++ setTestEnv.sh	(working copy)
@@ -1,5 +1,68 @@
 #! /bin/sh
-echo "Setting env for Linux"
-frameworkPath=`pwd`:`pwd`/framework:
-export PATH=~/ORexxDev/Windows/full/sandbox/rick/tests/framework:$PATH
-export LD_LIBRARY_PATH=`pwd`/bin/LINUX:$LD_LIBRARY_PATH
+#/*----------------------------------------------------------------------------*/
+#/*                                                                            */
+#/* Copyright (c) 2007 Rexx Language Association. All rights reserved.    */
+#/*                                                                            */
+#/* This program and the accompanying materials are made available under       */
+#/* the terms of the Common Public License v1.0 which accompanies this         */
+#/* distribution. A copy is also available at the following address:           */
+#/* http://www.oorexx.org/license.html                                         */
+#/*                                                                            */
+#/* Redistribution and use in source and binary forms, with or                 */
+#/* without modification, are permitted provided that the following            */
+#/* conditions are met:                                                        */
+#/*                                                                            */
+#/* Redistributions of source code must retain the above copyright             */
+#/* notice, this list of conditions and the following disclaimer.              */
+#/* Redistributions in binary form must reproduce the above copyright          */
+#/* notice, this list of conditions and the following disclaimer in            */
+#/* the documentation and/or other materials provided with the distribution.   */
+#/*                                                                            */
+#/* Neither the name of Rexx Language Association nor the names                */
+#/* of its contributors may be used to endorse or promote products             */
+#/* derived from this software without specific prior written permission.      */
+#/*                                                                            */
+#/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS        */
+#/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT          */
+#/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS          */
+#/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT   */
+#/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,      */
+#/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED   */
+#/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,        */
+#/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY     */
+#/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING    */
+#/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS         */
+#/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.               */
+#/*                                                                            */
+#/*----------------------------------------------------------------------------*/
+
+
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+
+case "${UNAME_SYSTEM}" in
+    AIX)
+      echo "Setting env for AIX"
+      frameworkPath=`pwd`:`pwd`/framework:
+      export PATH=$frameworkPath$PATH
+      export LIBPATH=`pwd`/bin/AIX:$LIBPATH
+      exit ;;
+
+    Linux)
+      echo "Setting env for Linux"
+      frameworkPath=`pwd`:`pwd`/framework:
+      export PATH=$frameworkPath$PATH
+      export LD_LIBRARY_PATH=`pwd`/bin/LINUX:$LD_LIBRARY_PATH
+      ;;
+
+    Darwin)
+      echo "Setting env for MacOS"
+      frameworkPath=`pwd`:`pwd`/framework:
+      export PATH=$frameworkPath$PATH
+      export LD_LIBRARY_PATH=`pwd`/bin/DARWIN:$LD_LIBRARY_PATH
+      ;;
+
+    *)
+    echo "Unsupported OS"
+    ;;
+
+esac
