From 9b03b9f661a557ef16ccbc00ee5527fdb685a8a7 Mon Sep 17 00:00:00 2001 From: Niall Cooling Date: Wed, 14 May 2025 13:46:15 +0100 Subject: [PATCH] patched file to support test in solutions and gtest build if present --- CMakePresets.json | 8 ++++---- build-one.sh | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index db45ffe..69b9b68 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -64,10 +64,10 @@ { "name": "test", "inherits": "debug", - "targets": [ "test" ], - "nativeToolOptions": [ - "ARGS=--output-on-failure" - ] + "targets": [ "test" ] + // "nativeToolOptions": [ + // "ARGS=--output-on-failure" + // ] } ] } diff --git a/build-one.sh b/build-one.sh index e8fe9a5..26ed15b 100755 --- a/build-one.sh +++ b/build-one.sh @@ -205,6 +205,19 @@ for EX in $EXERCISES; do cp -f "$SOLDIR/$EXDIR"/* src 2>/dev/null || true fi + # Check and copy test files if 'tests' directory exists + if [[ -d "$SOLDIR/$EXDIR/tests" ]]; then + trace "Copying test files from $SOLDIR/$EXDIR/tests" + rm -rf tests + mkdir tests + cp -f "$SOLDIR/$EXDIR/tests"/* tests 2>/dev/null || true + else + if [[ -d tests ]]; then + trace "Removing test files from tests" + rm -rf tests + fi + fi + if [[ -z $COPY ]]; then # run build RTOS=