Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Support #3

Open
ELLIOTTCABLE opened this issue May 8, 2017 · 7 comments
Open

macOS Support #3

ELLIOTTCABLE opened this issue May 8, 2017 · 7 comments

Comments

@ELLIOTTCABLE
Copy link

So, this appears to not work at all on OS X (due to BSDs' differences w.r.t. several command-line APIs):

After first installing and adding to my setup(), I got errors like this:

> jxa-async@0.0.1 test /Users/ec/Dropbox/Code/jxa-async
> bats ./test/*.bats

 ✗ Browserify successfully bundles jxa-async
   (from function `setup' in file test/common.bash, line 24,
    from function `bats_test_begin' in file node_modules/bats/libexec/bats-exec-test, line 87,
    in test file test/browserify.bats, line 3)
     `@test "Browserify successfully bundles jxa-async" {' failed
   
   -- ERROR: temp_make --
   mktemp: illegal option -- -
   usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
          mktemp [-d] [-q] [-u] -t prefix 
   --
   
   
   -- ERROR: temp_del --
   rm: No such file or directory
   --

After subsequently cloning bats-file and running its own tests with bats test, I'm seeing a failure on every single test.

(I believe Travis has macOS systems you can add to your build-matrix to ensure this continues to function on Macs!)

@ELLIOTTCABLE
Copy link
Author

Mind you, I have no idea why the tests for assert_file_exist etc are failing as well — let me know if you want me to change anything and re-execute.

@mlopes
Copy link

mlopes commented Jun 14, 2017

I can confirm I'm having the same error, I'm running my tests on travis, so the output can be seen here:

https://travis-ci.org/mlopes/git-.f/jobs/242817125

this is caused only by tmp_make, the assert_file_exists and assesrt_file_no_exists work.

It looks like the OSX version of mktemp doesn't support -- I wonder if there's an alternative way to do it, or if we could just specify a different command when running on OSX

EDIT:

I now have access to an OSX, and could confirm that --directory only works as -d on OSX/BSD, this one should be easy to fix as it also works on Linux. But also --tmpdir doesn't exist on OSX/BSD, there's a -t, but I can't figure out if it does the same thing, as the description for either of them is quite ambiguous.

Also the - in the template doesn't seem to work, I get the message mktemp: illegal option -- X

@mlopes
Copy link

mlopes commented Jun 15, 2017

I could try to fix it and make a PR, but not sure if it's worth it as I see PRs pending from a few months ago. Is this project still maintained?

@ztombol
Copy link
Owner

ztombol commented Jun 15, 2017

@mlopes I apologise for the hiatus. I've been moving and starting a new job. As soon as things quiet down a little bit, I'm planning to get back to working on bats and the bats-* libraries. Unfortunately, I can't provide an ETA, but I promise I'll be back as soon as my schedule allows. 🙂

@ELLIOTTCABLE
Copy link
Author

@ztombol, if you feel like giving someone commuter status, I’d be happy to try and maintain a ‘develop’ branch, merging some work on things like this, until you return

@mlopes
Copy link

mlopes commented Jun 15, 2017

A deeper look into this seems to indicate that one of the problems is that this:

local template="$prefix"
  template+="${BATS_TEST_FILENAME##*/}"
  template+="-${BATS_TEST_NUMBER}"
  template+='-XXXXXXXXXX'

ends up as '-XXXXXXXXXX' on OSX somehow, and then it gives me the -- X error even if I do an [ if uname -s = 'Darwin' ] and pass the correct parameters for OSX, if I try using that string as template on Linux, I get the exact same error.

@mlopes
Copy link

mlopes commented Jun 15, 2017

Made a pull request fixing this (#4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants