-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5109037
commit ff2c7f6
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"distro":"debian","os_version":"Linux version 6.10.6-riscv64 ([email protected]) (riscv64-linux-gnu-gcc-13 (Debian 13.3.0-5) 13.3.0, GNU ld (GNU Binutils for Debian) 2.43.1) #1 SMP Debian 6.10.6-1 (2024-08-19)\n","kernel_version":"6.10.6-riscv64\n","package_name":"clang","package_type":"package","package_version":"16.0.6 (27+b1)","test_results":[{"test_name":"test.sh","passed":true}],"all_tests_passed":true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
# 检查并安装clang | ||
check_and_install_clang() { | ||
if ! command -v clang &> /dev/null; then | ||
echo "clang not found. Attempting to install..." | ||
if command -v apt-get &> /dev/null; then | ||
export DEBIAN_FRONTEND=noninteractive # 防止apt-get交互式安装 | ||
apt-get install -y clang | ||
elif command -v yum &> /dev/null; then | ||
yum install -y clang | ||
elif command -v dnf &> /dev/null; then | ||
dnf install -y clang | ||
elif command -v zypper &> /dev/null; then | ||
zypper install -y clang | ||
elif command -v pacman &> /dev/null; then | ||
pacman -S --noconfirm clang | ||
else | ||
echo "Unable to install clang. Please install it manually." | ||
return 1 | ||
fi | ||
fi | ||
} | ||
|
||
# 执行检查和安装 | ||
check_and_install_clang | ||
|
||
# 创建一个简单的C程序 | ||
cat << EOF > test.c | ||
#include <stdio.h> | ||
int main() { | ||
printf("Hello, World!\n"); | ||
return 0; | ||
} | ||
EOF | ||
|
||
# 使用clang编译程序 | ||
clang test.c -o test_program | ||
|
||
# 检查编译是否成功 | ||
if [ $? -eq 0 ]; then | ||
exit_status=0 | ||
else | ||
exit_status=1 | ||
fi | ||
|
||
# 运行编译后的程序 | ||
./test_program | ||
|
||
# 清理临时文件 | ||
rm test.c test_program | ||
|
||
PACKAGE_VERSION=$(clang --version | grep -oP "version\W?\K.*") | ||
|
||
return $exit_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
testing_type = "remote" | ||
skip_packages = [] | ||
|
||
[connection] | ||
method = "ssh" | ||
ip = "<某个神秘的 zerotier 内网 ip>" | ||
port = 22 | ||
username = "root" | ||
password = "bianbu" |