SmartCane/r_app/experiments/run_tests.R
Timon 6efcc8cfec Fix CI report pipeline: update tmap v4 syntax, add continuous color scales, fix formatting
- Updated all CI maps to use tm_scale_continuous() for proper tmap v4 compatibility
- Added fixed color scale limits (1-8 for CI, -3 to +3 for differences) for consistent field comparison
- Fixed YAML header formatting issues in CI_report_dashboard_planet.Rmd
- Positioned RGB map before CI overview map as requested
- Removed all obsolete use_breaks parameter references
- Enhanced error handling and logging throughout the pipeline
- Added new experimental analysis scripts and improvements to mosaic creation
2025-06-19 20:37:20 +02:00

38 lines
982 B
R

# run_tests.R
#
# TEST RUNNER FOR SMARTCANE
# =======================
# This script runs all tests for the SmartCane project.
# Usage: Rscript run_tests.R [test_pattern]
# - test_pattern: Optional regex pattern to match test files (default: all test_*.R files)
#
# Process command line arguments
args <- commandArgs(trailingOnly = TRUE)
test_pattern <- if (length(args) > 0) args[1] else "^test_.+\\.R$"
# Set working directory to script location
script_dir <- dirname(normalizePath(sys.frame(1)$ofile))
setwd(script_dir)
# Source test framework
source("tests/test_framework.R")
# Set up test environment
env <- setup_test_env()
# Run tests
cat("Running tests with pattern:", test_pattern, "\n\n")
success <- run_tests(test_pattern)
# Clean up
teardown_test_env()
# Exit with appropriate status code
if (success) {
cat("\n✓ All tests passed successfully!\n")
quit(save = "no", status = 0)
} else {
cat("\n✗ Some tests failed.\n")
quit(save = "no", status = 1)
}