Skip to content

Commit 7bb1920

Browse files
authored
Merge pull request #2118 from MRtrix3/run_tests_allow_alternative_bin_location
run_tests: allow different location for MRtrix executables
2 parents a8c2d1e + b24aea8 commit 7bb1920

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.gitmodules

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[submodule "testing/data"]
22
path = testing/binaries/data
33
url = https://github.com/MRtrix3/test_data
4+
ignore = dirty
45
[submodule "testing/script_data"]
56
path = testing/scripts/data
67
url = https://github.com/MRtrix3/script_test_data.git
8+
ignore = dirty

run_tests

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
#
1616
# For more details, see http://www.mrtrix.org/.
1717

18+
19+
20+
# when testing a binary release, you can use the MRTRIX_BINDIR environment
21+
# variable to point to the location of the executables you want to test. You'll
22+
# need to ensure the same commit/tag is checked out on this repo for the
23+
# results to be valid.
24+
25+
1826
if test "$#" -ne 1; then
1927
echo "Script must be provided with single input argument: \"binaries\", \"scripts\", \"units\", or the name of a specific test to be run."
2028
exit 1
@@ -151,6 +159,16 @@ cat >> $LOGFILE <<EOD
151159
PATH is set to $PATH
152160
EOD
153161

162+
if [[ -z "$MRTRIX_BINDIR" ]]; then
163+
MRTRIX_BINDIR="$(pwd)/bin"
164+
else
165+
MRTRIX_BINDIR="${MRTRIX_BINDIR}"
166+
fi
167+
cat >> $LOGFILE <<EOD
168+
169+
Testing executables in: $MRTRIX_BINDIR
170+
EOD
171+
154172

155173
for testitem in $testlist; do
156174

@@ -173,7 +191,7 @@ EOD
173191
[[ -n "$cmd" ]] || continue
174192
echo -n '# command: '$cmd >> $LOGFILE
175193
(
176-
export PATH="$(pwd)/testing/bin:$(pwd)/bin:$PATH";
194+
export PATH="$(pwd)/testing/bin:${MRTRIX_BINDIR}:$PATH";
177195
cd $datadir
178196
eval $cmd
179197
) > .__tmp.log 2>&1

0 commit comments

Comments
 (0)