Skip to content
Snippets Groups Projects
Commit cca81aee authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'rf/createwrapper-macos' into 'master'

Rf/createwrapper macos

See merge request !12
parents c5e0ebae 37d3614b
No related branches found
No related tags found
1 merge request!12Rf/createwrapper macos
Pipeline #9467 passed
include: include:
- file: .gitlab-ci.yml - file: .gitlab-ci.yml
project: fsl/fsl-ci-rules project: fsl/fsl-ci-rules
stages: stages:
- test - test
- fsl-ci-pre - fsl-ci-pre
- fsl-ci-build - fsl-ci-build
- fsl-ci-test - fsl-ci-test
- fsl-ci-deploy - fsl-ci-deploy
test:
test:linux:
image: python:3.7 image: python:3.7
script: script:
- pip install pytest - pip install pytest
- pytest -v .ci - pytest -v tests
stage: test stage: test
tags: tags:
- docker - docker
test:macos:
image: python:3.7
script:
- pip install pytest
- pytest -v tests
stage: test
tags:
- macOS
- shell
\ No newline at end of file
# FSL base project changelog # FSL base project changelog
## 2106.2 (Tuesday 22nd June 2021)
- Fixed an issue with `createFSLWrapper` on macOS.
## 2106.1 (Friday 6th June 2021) ## 2106.1 (Friday 6th June 2021)
- Updated the `supportedGencodes.sh` script to add JIT targets for CUDA - Updated the `supportedGencodes.sh` script to add JIT targets for CUDA
......
...@@ -109,5 +109,10 @@ for script in $targets; do ...@@ -109,5 +109,10 @@ for script in $targets; do
fi fi
# Preserve file permissions # Preserve file permissions
chmod --reference="$sourceScript" "$targetScript" if [[ "$OSTYPE" == "darwin"* ]]; then
perms=$(stat -f "%A" "$sourceScript")
chmod ${perms} "$targetScript"
else
chmod --reference="$sourceScript" "$targetScript"
fi
done done
#!/usr/bin/env bash
fslpython ./test_create_remove_wrapper.py ${FSLDIR}
\ No newline at end of file
#!/usr/bin/env python #!/usr/bin/env python
# #
# test_create_remove_wrapper.py - Test the createFSLWrapper.sh and # test_create_remove_wrapper.py - Test the createFSLWrapper.sh and
# removeFSLWrapper.sh scripts. Requires Python 3.7. # removeFSLWrapper.sh scripts. Requires Python>=3.7.
# #
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Paul McCarthy <pauldmccarthy@gmail.com>
# #
import sys
import os.path as op import os.path as op
import subprocess as sp import subprocess as sp
import textwrap as tw import textwrap as tw
...@@ -18,6 +19,11 @@ import contextlib ...@@ -18,6 +19,11 @@ import contextlib
from unittest import mock from unittest import mock
# Paths to create/remove wrapper scripts, when
# running from an in-source version. These may
# be overwritten within the __main__ clause at
# the bottom, where BASE_DIR may be provided
# as a command-line argument.
BASE_DIR = op.abspath(op.join(op.dirname(__file__), '..')) BASE_DIR = op.abspath(op.join(op.dirname(__file__), '..'))
CREATE_WRAPPER = op.join(BASE_DIR, 'share', 'fsl', 'sbin', 'createFSLWrapper') CREATE_WRAPPER = op.join(BASE_DIR, 'share', 'fsl', 'sbin', 'createFSLWrapper')
REMOVE_WRAPPER = op.join(BASE_DIR, 'share', 'fsl', 'sbin', 'removeFSLWrapper') REMOVE_WRAPPER = op.join(BASE_DIR, 'share', 'fsl', 'sbin', 'removeFSLWrapper')
...@@ -176,3 +182,19 @@ def test_create_remove_wrappers(): ...@@ -176,3 +182,19 @@ def test_create_remove_wrappers():
assert not op.exists(op.join(wrapperdir, 'test_script1')) assert not op.exists(op.join(wrapperdir, 'test_script1'))
assert not op.exists(op.join(wrapperdir, 'test_script2')) assert not op.exists(op.join(wrapperdir, 'test_script2'))
if __name__ == '__main__':
# base dir can be speecified on command line
if len(sys.argv) > 1:
BASE_DIR = sys.argv[1]
SBIN_DIR = op.join(BASE_DIR, 'share', 'fsl', 'sbin')
CREATE_WRAPPER = op.join(SBIN_DIR, 'createFSLWrapper')
REMOVE_WRAPPER = op.join(SBIN_DIR, 'removeFSLWrapper')
thismod = sys.modules[__name__]
for test in dir(thismod):
if test.startswith('test_'):
test = getattr(thismod, test)
if callable(test):
test()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment