test: use tests/convert as root
All checks were successful
build / build (pull_request) Successful in 2m29s
build / build (push) Successful in 2m30s

This commit is contained in:
张泊明518370910136 2025-03-04 15:23:46 -05:00
parent 56ecd35e46
commit 3b40bee13c
GPG Key ID: D47306D7062CDA9D
3 changed files with 18 additions and 14 deletions

View File

@ -706,7 +706,7 @@
"cases": [ "cases": [
{ {
"stdin": { "stdin": {
"src": "/home/tt/.config/joj/case0.in" "src": "/home/tt/.config/joj/basic/case0.in"
}, },
"cpuLimit": 500000000, "cpuLimit": 500000000,
"clockLimit": 1000000000, "clockLimit": 1000000000,
@ -715,7 +715,7 @@
}, },
{ {
"stdin": { "stdin": {
"src": "/home/tt/.config/joj/case1.in" "src": "/home/tt/.config/joj/basic/case1.in"
}, },
"cpuLimit": 1234567890, "cpuLimit": 1234567890,
"clockLimit": 2469135780, "clockLimit": 2469135780,
@ -736,7 +736,7 @@
{ {
"score": 5, "score": 5,
"fileName": "stdout", "fileName": "stdout",
"answerPath": "/home/tt/.config/joj/case0.out", "answerPath": "/home/tt/.config/joj/basic/case0.out",
"forceQuitOnDiff": false, "forceQuitOnDiff": false,
"alwaysHide": false, "alwaysHide": false,
"compareSpace": false "compareSpace": false
@ -748,7 +748,7 @@
{ {
"score": 5, "score": 5,
"fileName": "stdout", "fileName": "stdout",
"answerPath": "/home/tt/.config/joj/case1.out", "answerPath": "/home/tt/.config/joj/basic/case1.out",
"forceQuitOnDiff": false, "forceQuitOnDiff": false,
"alwaysHide": false, "alwaysHide": false,
"compareSpace": false "compareSpace": false

View File

@ -64,7 +64,7 @@
"cases": [ "cases": [
{ {
"stdin": { "stdin": {
"src": "/home/tt/.config/joj/case0.in" "src": "/home/tt/.config/joj/diff/case0.in"
}, },
"cpuLimit": 1000000000, "cpuLimit": 1000000000,
"clockLimit": 2000000000, "clockLimit": 2000000000,
@ -73,7 +73,7 @@
}, },
{ {
"stdin": { "stdin": {
"src": "/home/tt/.config/joj/case1.in" "src": "/home/tt/.config/joj/diff/case1.in"
}, },
"cpuLimit": 2000000000, "cpuLimit": 2000000000,
"clockLimit": 4000000000, "clockLimit": 4000000000,
@ -94,7 +94,7 @@
{ {
"score": 5, "score": 5,
"fileName": "stdout", "fileName": "stdout",
"answerPath": "/home/tt/.config/joj/case0.out", "answerPath": "/home/tt/.config/joj/diff/case0.out",
"forceQuitOnDiff": false, "forceQuitOnDiff": false,
"alwaysHide": false, "alwaysHide": false,
"compareSpace": false "compareSpace": false
@ -106,7 +106,7 @@
{ {
"score": 5, "score": 5,
"fileName": "stdout", "fileName": "stdout",
"answerPath": "/home/tt/.config/joj/case1.out", "answerPath": "/home/tt/.config/joj/diff/case1.out",
"forceQuitOnDiff": false, "forceQuitOnDiff": false,
"alwaysHide": false, "alwaysHide": false,
"compareSpace": false "compareSpace": false

View File

@ -11,15 +11,19 @@ from joj3_config_generator.models import repo, task
def read_convert_files( def read_convert_files(
case_name: str, case_name: str,
) -> Tuple[repo.Config, task.Config, Dict[str, Any]]: ) -> Tuple[repo.Config, task.Config, Dict[str, Any]]:
root = Path(__file__).resolve().parent / case_name root = Path(__file__).resolve().parent
repo_toml_path = root / "repo.toml" repo_toml_path = root / case_name / "repo.toml"
repo_toml = repo_toml_path.read_text() if repo_toml_path.exists() else "" repo_toml = repo_toml_path.read_text() if repo_toml_path.exists() else ""
task_toml_path = root / "task.toml" task_toml_path = root / case_name / "task.toml"
task_toml = task_toml_path.read_text() if task_toml_path.exists() else "" task_toml = task_toml_path.read_text() if task_toml_path.exists() else ""
result = json.loads((root / "task.json").read_text()) result = json.loads((root / case_name / "task.json").read_text())
return ( return (
repo.Config(root=root, **rtoml.loads(repo_toml)), repo.Config(
task.Config(root=root, **rtoml.loads(task_toml)), root=root, path=repo_toml_path.relative_to(root), **rtoml.loads(repo_toml)
),
task.Config(
root=root, path=task_toml_path.relative_to(root), **rtoml.loads(task_toml)
),
result, result,
) )