forked from Artisan-Lab/RAPx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Artisan-Lab#85 from os-checker/ci/check-tests
feat: check supported testcases in CI
- Loading branch information
Showing
25 changed files
with
37 additions
and
195 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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.vscode/ | ||
target/ | ||
Cargo.lock | ||
rap.txt |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,35 +1,40 @@ | ||
#!/bin/bash | ||
#该脚本在目录下为每个Cargo项目执行相同的命令直到报错 | ||
|
||
if [ $# -eq 0 ]; then | ||
# All arguments passed to this script are forwarded to cargo rap | ||
|
||
cur=$(pwd) | ||
|
||
# 查找并编译当前目录下的所有 Rust 项目 | ||
find support -type f -name "Cargo.toml" | while read -r cargo_file; do | ||
# 获取 Cargo.toml 文件所在的目录 | ||
project_dir=$(dirname "$cargo_file") | ||
|
||
echo "Processing project in: $project_dir" | ||
|
||
# 切换到项目目录 | ||
pushd "$project_dir" >/dev/null | ||
|
||
if [ $# -eq 0 ]; then | ||
#脚本无参数时执行cargo clean | ||
#Example: batch.sh | ||
cmd="cargo clean" | ||
else | ||
$cmd | ||
else | ||
#脚本有参数时按照给定参数执行cargo命令 | ||
#Example: batch.sh rap -uaf | ||
cmd="cargo $@" | ||
fi | ||
cmd="cargo rap $@" | ||
$cmd 2>&1 | tee $cur/rap.txt | ansi2txt | grep 'RAP|WARN|' && echo -e "\033[32m$project_dir pass\033[0m" | ||
fi | ||
|
||
# 查找并编译当前目录下的所有 Rust 项目 | ||
find . -type f -name "Cargo.toml" | while read -r cargo_file; do | ||
# 获取 Cargo.toml 文件所在的目录 | ||
project_dir=$(dirname "$cargo_file") | ||
|
||
echo "Processing project in: $project_dir" | ||
|
||
# 切换到项目目录 | ||
pushd "$project_dir" > /dev/null | ||
|
||
$cmd | ||
if [ $? -ne 0 ]; then | ||
# 如果命令失败,打印错误信息并退出循环 | ||
echo "Error: '$cmd' failed in $project_dir" | ||
popd > /dev/null | ||
exit 1 | ||
fi | ||
|
||
# 返回原始目录 | ||
popd > /dev/null | ||
done | ||
if [ $? -ne 0 ]; then | ||
# 如果命令失败,打印错误信息并退出循环 | ||
echo -e "Error: '$cmd' failed in $project_dir \nRAP output:" | ||
cat $cur/rap.txt | ||
popd >/dev/null | ||
exit 1 | ||
fi | ||
|
||
# 返回原始目录 | ||
popd >/dev/null | ||
done |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.