Skip to content

Commit

Permalink
test: bianbu (神秘)
Browse files Browse the repository at this point in the history
  • Loading branch information
255doesnotexist committed Aug 30, 2024
1 parent 5109037 commit ff2c7f6
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions bianbu/clang/report.json
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}
56 changes: 56 additions & 0 deletions bianbu/clang/test.sh
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
9 changes: 9 additions & 0 deletions bianbu/config.toml
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"

0 comments on commit ff2c7f6

Please sign in to comment.