vapier / ncompress

a fast, simple LZW file compressor
https://vapier.github.io/ncompress/
The Unlicense
104 stars 18 forks source link

Test suite fails on macOS #19

Closed ryandesign closed 5 years ago

ryandesign commented 5 years ago

Hello, make check fails on macOS:

./tests/runtests.sh
readlink: illegal option -- f
usage: readlink [-n] [file ...]
using compress: ./compress
Setting up test env
cp: ./README.md: No such file or directory
make: *** [check] Error 1

Unfortunately, BSD readlink (which macOS uses) don't support the same options that GNU readlink does.

vapier commented 5 years ago

it's passing in travis under macOS: https://travis-ci.org/vapier/ncompress/jobs/475247443

$ clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
...
./tests/runtests.sh
using compress: /Users/travis/build/vapier/ncompress/compress
Setting up test env
+: '### Check basic CLI exit status'
...
ryandesign commented 5 years ago

Thanks. Perhaps the Travis macOS build machines have some nonstandard software installed which provides GNU realpath and/or readlink. Stock macOS does not have realpath and its BSD readlink doesn't support -f.

With 5dd9c10 I get this failure:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'realpathf'
make: *** [check] Error 1

Instead of os.path.realpathf, did you mean os.path.realpath? That seems to work.

ryandesign commented 5 years ago

This should work too and would be simpler; I use something similar in my scripts; see discussion on Stack Overflow:

TESTDIR="$(cd "$(dirname "$0")" && pwd)"
TOP_SRCDIR="$(dirname "${TESTDIR}")"
vapier commented 5 years ago

i added the typo during testing to check diff edge cases but forgot to remove it when i was done. should be fixed now, thanks.