Skip to content

fix: minor fix on grader and docs #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Pages/Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

### 使用Dev-Container (推荐)

如果你使用的是带有支持Microsoft规范下Dev-Container插件的代码编辑器或者集成开发环境,亦或者你使用的是非Linux平台的开发环境,我们强烈建议你使用Dev-container直接进行开发,我们已经在其中已经预先安装好了你可能需要使用的所有工具链。并且针对vscode我们在每个Lab的分支目录下都已经配置好了合适的插件配置,简单安装即可以一键启用。
如果你使用的是带有支持Microsoft规范下[Dev-Container](https://vscode.github.net.cn/docs/devcontainers/tutorial)插件的代码编辑器或者集成开发环境,亦或者你使用的是非Linux平台的开发环境,我们**强烈建议**你使用Dev-container直接进行开发,我们已经在其中已经预先安装好了你可能需要使用的所有工具链。并且针对vscode我们在每个Lab的分支目录下都已经配置好了合适的插件配置,简单安装即可以一键启用。安装完之后进入本实验的**根目录**,此时dev-container会识别到容器开发环境,重新进入后就可以直接使用了

### 本地手动安装(推荐)
### 本地手动安装

如果你并不想要使用Dev-container,且你使用的是原生Linux平台或者自行创建的Linux虚拟机,我们在下方准备了所有流行发行版的工具链安装命令。同时我们也推荐安装`clangd`,其可以根据`CMake`生成的`compile_commands.json`即编译信息数据库提供增强的LSP的提示功能,用于支撑区分相同函数签名但是不同编译单元参与编译的重名跳转以及根据宏定义用于高显源文件。

Expand Down
2 changes: 1 addition & 1 deletion Scripts/capturer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
print(
"This script requires Python version 3.7 and later. Please upgrade your Python version to grade this lab."
)
sys.exit(0)
sys.exit(255)

try:
import psutil
Expand Down
16 changes: 16 additions & 0 deletions Scripts/extras/lab5/grader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,37 @@ cp "${CMAKE_EXTRA_DIR}/cmake-fsm-full.txt" "${FSM_DIR}/CMakeLists.txt"
cp "${CMAKE_EXTRA_DIR}/cmake-fs_base-part1.txt" "${FS_BASE_DIR}/CMakeLists.txt"
${SCRIPTS}/capturer.py -f ${LABDIR}/scores-part1.json -t 30 make qemu-grade 2> /dev/null
score=$(($score+$?))
if [[ $score -eq 255 ]]; then
error "Something went wrong. Please check the output of your program"
exit 0
fi
# Part2 VNode
cp "${CMAKE_EXTRA_DIR}/cmake-fsm-part2.txt" "${FSM_DIR}/CMakeLists.txt"
cp "${CMAKE_EXTRA_DIR}/cmake-fs_base-part2-vnode.txt" "${FS_BASE_DIR}/CMakeLists.txt"
${SCRIPTS}/capturer.py -f ${LABDIR}/scores-part2.json -t 30 make qemu-grade 2> /dev/null
score=$(($score+$?))
if [[ $score -eq 255 ]]; then
error "Something went wrong. Please check the output of your program"
exit 0
fi
# Part3 Server Entry
cp "${CMAKE_EXTRA_DIR}/cmake-fsm-part2.txt" "${FSM_DIR}/CMakeLists.txt"
cp "${CMAKE_EXTRA_DIR}/cmake-fs_base-part2-server_entry.txt" "${FS_BASE_DIR}/CMakeLists.txt"
${SCRIPTS}/capturer.py -f ${LABDIR}/scores-part3.json -t 30 make qemu-grade 2> /dev/null
score=$(($score+$?))
if [[ $score -eq 255 ]]; then
error "Something went wrong. Please check the output of your program"
exit 0
fi
# Part4 Ops
mv "${FSM_DIR}/CMakeLists.txt.bak" "${FSM_DIR}/CMakeLists.txt"
mv "${FS_BASE_DIR}/CMakeLists.txt.bak" "${FS_BASE_DIR}/CMakeLists.txt"
${SCRIPTS}/capturer.py -f ${LABDIR}/scores-part4.json -t 30 make qemu-grade 2> /dev/null
score=$(($score+$?))
if [[ $score -eq 255 ]]; then
error "Something went wrong. Please check the output of your program"
exit 0
fi

info "Score: $score/100"
bold "==========================================="
Expand Down
6 changes: 6 additions & 0 deletions Scripts/grader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ info "Grading lab ${LAB} ...(may take ${TIMEOUT} seconds)"
bold "==========================================="
${LABROOT}/Scripts/capturer.py $@ 2> /dev/null
score=$?

if [[ $score -eq 255 ]]; then
error "Something went wrong. Please check the output of your program"
exit 0
fi

info "Score: $score/100"
bold "==========================================="

Expand Down