43 lines
923 B
Bash
Executable File
43 lines
923 B
Bash
Executable File
#!/bin/bash
|
|
# Test script for CeresWrapper
|
|
|
|
set -e # Exit on error
|
|
|
|
# Colors for output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
echo -e "${GREEN}Running CeresWrapper tests...${NC}"
|
|
|
|
# Get script directory
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
BUILD_DIR="${SCRIPT_DIR}/build"
|
|
TEST_EXE="${BUILD_DIR}/ceres_wrapper_test"
|
|
|
|
# Check if test executable exists
|
|
if [ ! -f "${TEST_EXE}" ]; then
|
|
echo -e "${RED}Test executable not found!${NC}"
|
|
echo "Please build the project first: ./build.sh"
|
|
exit 1
|
|
fi
|
|
|
|
# Set library path
|
|
export LD_LIBRARY_PATH="${SCRIPT_DIR}/install/lib:${LD_LIBRARY_PATH}"
|
|
|
|
# Run tests
|
|
echo ""
|
|
"${TEST_EXE}"
|
|
|
|
TEST_RESULT=$?
|
|
|
|
echo ""
|
|
if [ $TEST_RESULT -eq 0 ]; then
|
|
echo -e "${GREEN}✓ All tests passed!${NC}"
|
|
exit 0
|
|
else
|
|
echo -e "${RED}✗ Some tests failed!${NC}"
|
|
exit 1
|
|
fi
|