-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·54 lines (45 loc) · 1.29 KB
/
run.sh
File metadata and controls
executable file
·54 lines (45 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
## NOTE:
## This file was initially generated with the assistance of AI.
## The code has been reviewed and may have been modified by the developer
## to ensure correctness, readability, and compliance with project requirements.
set -e # Exit immediately if a command fails
PROJECT_EXEC="./build/bin/cpp_lab_project"
BUILD_DIR="./build"
clear
echo "=============================="
echo " Starting build pipeline... "
echo "=============================="
# Check required tools
for tool in cmake cppcheck; do
if ! command -v "$tool" &> /dev/null; then
echo "[ERR]: $tool is not installed."
exit 1
fi
done
echo ""
echo "===========>> Building project..."
cmake -G "Unix Makefiles" -B "$BUILD_DIR"
cmake --build "$BUILD_DIR"
echo ""
echo "===========>> Running cppcheck..."
cppcheck \
--enable=warning,style,performance,portability \
--inconclusive \
--inline-suppr \
--quiet \
--error-exitcode=1 \
./src ./include
echo "[OK] Static analysis passed"
echo ""
echo "===========>> Running program..."
if [ -f "$PROJECT_EXEC" ]; then
"$PROJECT_EXEC"
else
echo "[ERR] Executable not found: $PROJECT_EXEC"
exit 1
fi
echo ""
echo "=============================="
echo "Pipeline finished successfully!"
echo "=============================="