From 3809215d3eda5657d3b1a68830fe9ade5853d756 Mon Sep 17 00:00:00 2001 From: SunriseFox Date: Sat, 30 Mar 2019 15:29:48 +0800 Subject: [PATCH] test cases --- README.md | 10 +++++++--- test.bat | 6 ++++++ test.sh | 8 ++++---- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 test.bat diff --git a/README.md b/README.md index 149f51e..f881798 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,13 @@ ### Build -+ (Linux) 打开 build.sh,修改 `-v /var/www/onlinejudge:/mnt/data` 的 `/var/www/onlinejudge` 为本地一个已存在的目录 -+ (Windows) 打开 build.bat,修改 `-v "D:\0bysj\core":/mnt/core` 的 `D:\0bysj\core` 为 *当前目录*,`-v "D:\0bysj\volume":/mnt/data` 的 `D:\0bysj\volume` 为一个已存在的目录 -+ 运行对应的 build.sh 或 build.bat ++ (Linux) 打开 build.sh,修改 `MOUNTFOLDER` 为本地一个已存在的目录 ++ (Windows) 打开 build.bat,修改 `MOUNTFOLDER` 为本地一个已存在的目录 ++ 运行对应的 `build.sh` 或 `build.bat` + +### 测试 + ++ 项目在 testcase 中提供了测试样例,只需要运行当前目录的 `./test.sh` 或 `test.bat` 即可。 ### Usage diff --git a/test.bat b/test.bat new file mode 100644 index 0000000..8f03c66 --- /dev/null +++ b/test.bat @@ -0,0 +1,6 @@ +@docker cp "testcase/." judgecore:/mnt/data; +@docker exec judgecore ./judgecore /mnt/data/config/9001-a.json /mnt/data/config/9001-b.json /mnt/data/config/9001-c.json; +@docker exec judgecore ./compiler /mnt/data/config/spj-9002.json; +@docker exec judgecore ./judgecore /mnt/data/config/9002-a.json /mnt/data/config/9002-b.json /mnt/data/config/9002-c.json; +@docker exec judgecore ./compiler /mnt/data/config/spj-9003.json; +@docker exec judgecore ./judgecore /mnt/data/config/9003-a.json /mnt/data/config/9003-b.json /mnt/data/config/9003-c.json; diff --git a/test.sh b/test.sh index ce8a065..3c5395a 100644 --- a/test.sh +++ b/test.sh @@ -1,7 +1,7 @@ set -ex; \ docker cp "testcase/." judgecore:/mnt/data; \ - docker exec judgecore ./judgecore /mnt/data/config/9001-a.json /mnt/data/config/9001-b.json /mnt/data/config/9001-c.json; - docker exec judgecore ./compiler /mnt/data/config/spj-9002.json; - docker exec judgecore ./judgecore /mnt/data/config/9002-a.json /mnt/data/config/9002-b.json /mnt/data/config/9002-c.json; - docker exec judgecore ./compiler /mnt/data/config/spj-9003.json; + docker exec judgecore ./judgecore /mnt/data/config/9001-a.json /mnt/data/config/9001-b.json /mnt/data/config/9001-c.json; \ + docker exec judgecore ./compiler /mnt/data/config/spj-9002.json; \ + docker exec judgecore ./judgecore /mnt/data/config/9002-a.json /mnt/data/config/9002-b.json /mnt/data/config/9002-c.json; \ + docker exec judgecore ./compiler /mnt/data/config/spj-9003.json; \ docker exec judgecore ./judgecore /mnt/data/config/9003-a.json /mnt/data/config/9003-b.json /mnt/data/config/9003-c.json;