Skip to content
Snippets Groups Projects
Commit 7a23ebef authored by Gerui Wang's avatar Gerui Wang
Browse files

windows autograder

parent 181c7214
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ mod tests {
import re
import sys
import os.path as path
file_path = path.join(sys.argv[1], 'src/blockchain/mod.rs')
file_path = path.join(sys.argv[1], 'src','blockchain','mod.rs')
print(path.dirname(file_path), end=' ')
before_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. BEFORE TEST'
after_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. AFTER TEST'
......
@echo off
set /p netid="Please unzip your code manually in this directory, and put it in a directory named after your netid, (make sure that Cargo.toml and src/ is in your-netid/ece598pv-sp2022-main), and enter your netid:"
python3 add_test.py %netid%\ece598pv-sp2022-main
cd %netid%\ece598pv-sp2022-main
cargo test sp2022autograder02
pause
\ No newline at end of file
......@@ -24,7 +24,7 @@ mod test {
import re
import sys
import os.path as path
file_path = path.join(sys.argv[1], 'src/miner/mod.rs')
file_path = path.join(sys.argv[1], 'src','miner','mod.rs')
print(path.dirname(file_path), end=' ')
before_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. BEFORE TEST'
after_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. AFTER TEST'
......
@echo off
set /p netid="Please unzip your code manually in this directory, and put it in a directory named after your netid, (make sure that Cargo.toml and src/ is in your-netid/ece598pv-sp2022-main), and enter your netid:"
python3 add_test.py %netid%\ece598pv-sp2022-main
cd %netid%\ece598pv-sp2022-main
cargo test sp2022autograder03
pause
\ No newline at end of file
......@@ -55,7 +55,7 @@ mod test {
import re
import sys
import os.path as path
file_path = path.join(sys.argv[1], 'src/network/worker.rs')
file_path = path.join(sys.argv[1], 'src','network','worker.rs')
print(path.dirname(file_path), end=' ')
before_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. BEFORE TEST'
after_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. AFTER TEST'
......
@echo off
set /p netid="Please unzip your code manually in this directory, and put it in a directory named after your netid, (make sure that Cargo.toml and src/ is in your-netid/ece598pv-sp2022-main), and enter your netid:"
python3 add_test.py %netid%\ece598pv-sp2022-main
cd %netid%\ece598pv-sp2022-main
cargo test sp2022autograder04
pause
\ No newline at end of file
......@@ -79,7 +79,7 @@ test types::transaction::tests::sign_verify ... ok
```
- To test your code, you are free to write more tests.
## Double check
## Double check (Unix)
We provide (incomplete) auto-grader for you to test that your code format fits auto-grader. However, passing this auto-grader doesn't guarantee getting full grades. For this assignment, put your netid.zip file with [autograder.sh](autograder.sh) and [add_test.py](add_test.py) in a new directory, from where run
```
bash autograder.sh
......@@ -90,6 +90,10 @@ If you see "Code format wrong" on screen, your code may change the lines that sh
If in _log.txt_ you cannot see correct log, your zip file may have incorrect directories for auto-grader to compile.
## Double check (windows)
Similar to Unix double checking auto-grader, we provide `autograder_windows.bat`. First, you need to manually unzip your netid.zip file, and put the `ece598pv-sp2022-main` folder inside a folder named after your netid. Make sure that `Cargo.toml` and `src/` is in `your-netid/ece598pv-sp2022-main`. Then double click `autograder_windows.bat`, enter your netid as instructed, and the result will be shown in a cmd window.
You need to install `python3` to run it.
## Submission
Download the zip file of your repo on gitlab. Rename it to your netid as `netid.zip`. Upload the zip file on compass2g. Please check your file size and it should not be very large.
......
......@@ -43,7 +43,7 @@ mod tests {
import re
import sys
import os.path as path
file_path = path.join(sys.argv[1], 'src/types/address.rs')
file_path = path.join(sys.argv[1], 'src','types','address.rs')
print(path.dirname(file_path), end=' ')
before_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. BEFORE TEST'
after_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. AFTER TEST'
......@@ -66,7 +66,7 @@ if change_before and change_after:
else:
print("\033[91m {}\033[00m".format("Code format wrong"))
file_path = path.join(sys.argv[1], 'src/types/transaction.rs')
file_path = path.join(sys.argv[1], 'src','types','transaction.rs')
print(path.dirname(file_path), end=' ')
before_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. BEFORE TEST'
after_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. AFTER TEST'
......
@echo off
set /p netid="Please unzip your code manually in this directory, and put it in a directory named after your netid, (make sure that Cargo.toml and src/ is in your-netid/ece598pv-sp2022-main), and enter your netid:"
python3 add_test.py %netid%\ece598pv-sp2022-main
cd %netid%\ece598pv-sp2022-main
cargo test sp2022autograder00
pause
\ No newline at end of file
......@@ -47,3 +47,5 @@ We provide (incomplete) auto-grader for you to test that your code format fits a
bash autograder.sh
```
And you can open the output file _log.txt_, and see whether the auto-grader's tests are passed. You need to have `bash`, `unzip`, and `python3` to run this double check.
## Double check (windows)
Same as warmup 1.
\ No newline at end of file
......@@ -53,7 +53,7 @@ mod tests {
import re
import sys
import os.path as path
file_path = path.join(sys.argv[1], 'src/types/merkle.rs')
file_path = path.join(sys.argv[1], 'src','types','merkle.rs')
print(path.dirname(file_path), end=' ')
before_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. BEFORE TEST'
after_pat = r'// DO NOT CHANGE THIS COMMENT, IT IS FOR AUTOGRADER. AFTER TEST'
......
@echo off
set /p netid="Please unzip your code manually in this directory, and put it in a directory named after your netid, (make sure that Cargo.toml and src/ is in your-netid/ece598pv-sp2022-main), and enter your netid:"
python3 add_test.py %netid%\ece598pv-sp2022-main
cd %netid%\ece598pv-sp2022-main
cargo test sp2022autograder01
pause
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment