Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)
22 changes: 12 additions & 10 deletions tests/config/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@

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

TEMP_DIR="$(mktemp -d)"
pushd "${TEMP_DIR}"
# Assign the base path from the argument
binary_path="$(realpath $1)"
config_files_path=$2

# Make temporary directory
TEMP_DIR="$(mktemp -d)"
function clean() {
rm -r "${TEMP_DIR}"
}
trap clean EXIT

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

cp "${binary_path}/clvk.conf" "${TEMP_DIR}"
# Copy assets to temporary directory
cp "${config_files_path}/conf_test.conf" "${TEMP_DIR}"
cp "${config_files_path}/clvk.conf" "${TEMP_DIR}"

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

popd