diff --git a/buildtestpublish_all.sh b/buildtestpublish_all.sh index 5f24b63..abec964 100755 --- a/buildtestpublish_all.sh +++ b/buildtestpublish_all.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -euo pipefail +set -uo pipefail # Remove -e to handle errors manually SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" # Arrays to track results @@ -7,6 +7,7 @@ declare -A BUILD_RESULTS declare -A TEST_RESULTS declare -A PUBLISH_RESULTS declare -a PROJECTS +OVERALL_SUCCESS=true function dothis() { local thisthing="$1" @@ -41,6 +42,7 @@ function dothis() { test) TEST_RESULTS["$project"]="✗" ;; publish) PUBLISH_RESULTS["$project"]="✗" ;; esac + OVERALL_SUCCESS=false return 1 fi fi @@ -101,16 +103,16 @@ function buildtestpublish() { # Add to projects list PROJECTS+=("$TOOLNAME") - cd "$dir" + cd "$dir" || echo "Failed to cd to $dir" subtitle "🔨 BUILDING $TOOLNAME_UPPER 🔨" - dothis build "$dir" "$TOOLNAME" || true + dothis build "$dir" "$TOOLNAME" subtitle "🔍 TESTING $TOOLNAME_UPPER 🔍" - dothis test "$dir" "$TOOLNAME" || true + dothis test "$dir" "$TOOLNAME" subtitle "📦 PUBLISHING $TOOLNAME_UPPER 📦" - dothis publish "$dir" "$TOOLNAME" || true + dothis publish "$dir" "$TOOLNAME" echo "Done" } @@ -125,30 +127,19 @@ function buildtestpublish_all() { -print0 | while IFS= read -r -d '' dir; \ do - buildtestpublish "${dir}" + buildtestpublish "${dir}" || true # Continue even if one project fails done - cd "$PREVIOUS_DIR" + cd "$PREVIOUS_DIR" || echo "Failed to cd to $PREVIOUS_DIR" } -title "🔨 BUILDING ALL TOOLS 🔨" - -getpkg/build.sh -export GETPKG="${SCRIPT_DIR}/getpkg/output/getpkg" -if [ ! -f "$GETPKG" ]; then - echo "Build failed." - exit 1 -fi - -buildtestpublish_all - function print_summary() { title "📊 BUILD SUMMARY 📊" # Calculate column widths local max_project_width=7 # "PROJECT" header for project in "${PROJECTS[@]}"; do - if [ ${#project} -gt $max_project_width ]; then + if [ "${#project}" -gt "$max_project_width" ]; then max_project_width=${#project} fi done @@ -157,6 +148,9 @@ function print_summary() { max_project_width=$((max_project_width + 2)) # Print header + printf "┌" + printf "─%.0s" $(seq 1 $((max_project_width + 2))) + printf "┬─────────┬─────────┬─────────┐\n" printf "│ %-*s │ %-7s │ %-7s │ %-7s │\n" $max_project_width "PROJECT" "BUILD" "TEST" "PUBLISH" printf "├" printf "─%.0s" $(seq 1 $((max_project_width + 2))) @@ -173,9 +167,31 @@ function print_summary() { "$build_status" "$test_status" "$publish_status" done + # Print bottom border + printf "└" + printf "─%.0s" $(seq 1 $((max_project_width + 2))) + printf "┴─────────┴─────────┴─────────┘\n" + echo } +title "🔨 BUILDING ALL TOOLS 🔨" + +getpkg/build.sh +export GETPKG="${SCRIPT_DIR}/getpkg/output/getpkg" +if [ ! -f "$GETPKG" ]; then + echo "Build failed." + exit 1 +fi + +buildtestpublish_all + print_summary -title "🚀 Deployment Complete! 🚀" +if [ "$OVERALL_SUCCESS" = true ]; then + title "🚀 Deployment Complete! 🚀" + exit 0 +else + title "❌ Deployment Failed! ❌" + exit 1 +fi diff --git a/dehydrate/test.sh b/dehydrate/test.sh index 26b7077..e4d2bdf 100755 --- a/dehydrate/test.sh +++ b/dehydrate/test.sh @@ -34,6 +34,7 @@ print_test_result() { cleanup() { echo -e "\n${YELLOW}Cleaning up test artifacts...${NC}" rm -rf "$TEST_DIR" + echo -e "\nDone.\n" } # Set up trap to ensure cleanup runs diff --git a/dehydrate/test/dehydrate_test b/dehydrate/test/dehydrate_test index 4a60708..d43ba08 100755 Binary files a/dehydrate/test/dehydrate_test and b/dehydrate/test/dehydrate_test differ diff --git a/dehydrate/test/dehydrate_test.cpp b/dehydrate/test/dehydrate_test.cpp index 3f02948..2ec3958 100644 --- a/dehydrate/test/dehydrate_test.cpp +++ b/dehydrate/test/dehydrate_test.cpp @@ -378,6 +378,7 @@ int main() { } std::cout << "\n=== Test Complete ===" << std::endl; + std::cout << "✓ All dehydrate tests passed successfully!" << std::endl; return 0; } \ No newline at end of file diff --git a/dehydrate/test/test.sh b/dehydrate/test/test.sh index b84fb01..5afcec9 100755 --- a/dehydrate/test/test.sh +++ b/dehydrate/test/test.sh @@ -1,9 +1,14 @@ #!/bin/bash +set -euo pipefail + # Simple script to run the dehydrate tests SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR" echo "Running dehydrate tests..." -./build_dehydrate_test.sh \ No newline at end of file +./build_dehydrate_test.sh + + +echo "Dehydrate tests complete." \ No newline at end of file