[go: nahoru, domu]

Skip to content

Commit

Permalink
[rsync] Allow passing additional flags to the remote execution client
Browse files Browse the repository at this point in the history
`TEST_SUITE_REMOTE_CLIENT` can be used to pass additional flags to the
remote execution client, such as specifying an alternative SSH
configuration file.
For example: `TEST_SUITE_REMOTE_CLIENT="ssh -F path/to/config/file"`.
  • Loading branch information
azharudd committed Jun 24, 2024
1 parent 6a38b29 commit 14af6cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ mark_as_advanced(TEST_SUITE_REMOTE_CLIENT)
if(TEST_SUITE_REMOTE_HOST)
add_custom_target(rsync
COMMAND ${PROJECT_SOURCE_DIR}/utils/rsync.sh
${TEST_SUITE_REMOTE_HOST} ${PROJECT_BINARY_DIR}
${TEST_SUITE_REMOTE_CLIENT}
${TEST_SUITE_REMOTE_HOST}
${PROJECT_BINARY_DIR}
USES_TERMINAL
)
endif()
Expand Down
8 changes: 5 additions & 3 deletions utils/rsync.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
# Sync a build directory to remote device for running.
set -eu
DEVICE="$1"
BUILDDIR="$2"
CLIENT="$1"
DEVICE="$2"
BUILDDIR="$3"

case $BUILDDIR in
/*) ;;
Expand All @@ -15,6 +16,7 @@ esac
RSYNC_FLAGS=""
RSYNC_FLAGS+=" -a"
RSYNC_FLAGS+=" --delete --delete-excluded"
RSYNC_FLAGS+=" -e \"$CLIENT\""
# We cannot easily differentiate between intermediate build results and
# files necessary to run the benchmark, so for now we just exclude based on
# some file extensions...
Expand All @@ -30,5 +32,5 @@ RSYNC_FLAGS+=" --exclude=rules.ninja"
RSYNC_FLAGS+=" --exclude=CMakeFiles/"

set -x
ssh $DEVICE mkdir -p "$BUILDDIR"
$CLIENT $DEVICE mkdir -p "$BUILDDIR"
eval rsync $RSYNC_FLAGS $BUILDDIR/ $DEVICE:$BUILDDIR/

0 comments on commit 14af6cc

Please sign in to comment.