Skip to content

Commit

Permalink
do not copy config files to build directory
Browse files Browse the repository at this point in the history
Add the path to the config files in the sources instead.

Ref kpet#743
  • Loading branch information
rjodinchr committed Nov 26, 2024
1 parent adba303 commit 1921bb0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ jobs:
- name: Config tests
shell: bash
if: ${{ matrix.unit }}
run: ./tests/config/run_test.sh ${{ env.testbindir }}
run: ./tests/config/run_test.sh ${{ env.testbindir }} ${{ github.workspace }}/tests/config
- name: SHA-1 tests
if: ${{ matrix.android-abi == '' }}
run: ${{ env.testbindir }}/sha1_tests${{ env.exe-ext }}
Expand Down
13 changes: 0 additions & 13 deletions tests/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,3 @@
add_gtest_executable(config_test
main.cpp
)

# Use the configure_file command to copy during configuration stage
configure_file(
clvk.conf
${CMAKE_BINARY_DIR}/clvk.conf # Destination, including subfolder
COPYONLY # Just copy, don't process as a template
)

configure_file(
conf_test.conf
${CMAKE_BINARY_DIR}/conf_test.conf
COPYONLY
)
15 changes: 8 additions & 7 deletions tests/config/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

set -xe

if [ $# -eq 0 ]; then
echo "Error: Please append path to the test binary path as a command-line argument."
if [ $# -ne 2 ]; then
echo "ERROR: USAGE: ${0} <config_test-path> <config_files-path>"
exit 1
fi

# Assign the base path from the argument
binary_path="$(realpath $1)"
config_files_path="$(realpath $2)"

TEMP_DIR="$(mktemp -d)"
pushd "${TEMP_DIR}"

Expand All @@ -15,13 +19,10 @@ function clean() {
}
trap clean EXIT

# Assign the base path from the argument
binary_path="$1"

cp "${binary_path}/clvk.conf" "${TEMP_DIR}"
cp "${config_files_path}/clvk.conf" "${TEMP_DIR}"

# Run test
CLVK_CONFIG_FILE="${binary_path}/conf_test.conf" \
CLVK_CONFIG_FILE="${config_files_path}/conf_test.conf" \
CLVK_LOG_COLOUR=1 \
"${binary_path}/config_test"

Expand Down

0 comments on commit 1921bb0

Please sign in to comment.