-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_test.sh
More file actions
66 lines (57 loc) · 1.63 KB
/
build_test.sh
File metadata and controls
66 lines (57 loc) · 1.63 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
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# 构建测试脚本 - 验证所有平台的编译
echo "=== DuckShell Multi-Platform Build Test ==="
# 测试目录
TEST_DIR="/tmp/duckshell_build_test"
mkdir -p "$TEST_DIR"
cd "$TEST_DIR"
# 克隆仓库(假设在当前目录有源码)
echo "Copying source files..."
cp -r /path/to/duckshell/source/* .
# 测试各个平台配置
echo -e "\n1. Testing Linux x86_64 build..."
mkdir -p build_linux_x86
cd build_linux_x86
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86_64
if make -j$(nproc) 2>&1 | grep -q "error"; then
echo "❌ Linux x86_64 build FAILED"
exit 1
else
echo "✅ Linux x86_64 build SUCCESS"
fi
cd ..
echo -e "\n2. Testing Linux ARM64 build..."
mkdir -p build_linux_arm
cd build_linux_arm
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64
if make -j$(nproc) 2>&1 | grep -q "error"; then
echo "❌ Linux ARM64 build FAILED"
exit 1
else
echo "✅ Linux ARM64 build SUCCESS"
fi
cd ..
echo -e "\n3. Testing macOS build..."
mkdir -p build_macos
cd build_macos
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Darwin
if make -j$(nproc) 2>&1 | grep -q "error"; then
echo "❌ macOS build FAILED"
exit 1
else
echo "✅ macOS build SUCCESS"
fi
cd ..
echo -e "\n4. Testing Windows build..."
mkdir -p build_windows
cd build_windows
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows
if make -j$(nproc) 2>&1 | grep -q "error"; then
echo "❌ Windows build FAILED"
exit 1
else
echo "✅ Windows build SUCCESS"
fi
cd ..
echo -e "\n=== All builds completed successfully! ==="
rm -rf "$TEST_DIR"