Files
ricycleplanner/tests/test_forced_stop.sh
2025-05-01 23:12:35 +02:00

36 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
cd "$(dirname "$0")/.."
# Create a test GPX file with a simple route
cat > test_route.gpx << EOF
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="Test">
<trk>
<name>Test Route</name>
<trkseg>
<trkpt lat="59.0" lon="18.0"><ele>10</ele></trkpt>
<trkpt lat="59.1" lon="18.1"><ele>20</ele></trkpt>
<trkpt lat="59.2" lon="18.2"><ele>30</ele></trkpt>
<trkpt lat="59.3" lon="18.3"><ele>40</ele></trkpt>
<trkpt lat="59.4" lon="18.4"><ele>50</ele></trkpt>
<trkpt lat="59.5" lon="18.5"><ele>60</ele></trkpt>
<trkpt lat="59.6" lon="18.6"><ele>70</ele></trkpt>
<trkpt lat="59.7" lon="18.7"><ele>80</ele></trkpt>
<trkpt lat="59.8" lon="18.8"><ele>90</ele></trkpt>
<trkpt lat="59.9" lon="18.9"><ele>100</ele></trkpt>
</trkseg>
</trk>
</gpx>
EOF
# Run the bicycle planner with a 1-night forced stop
echo "Testing with 1-night forced stop at 59.5,18.5"
go run main.go --input="test_route.gpx" --days=5 --elevFactor=4 --forestRadius=5 --resupplyRadius=5000 --multiStop="59.5,18.5:1"
# The number of segments is now shown in the output
echo "Check the output above for the number of segments created"
# Clean up
rm test_route.gpx