From a1d1c153f462918a910efe7dc5f55cc1c2e40e38 Mon Sep 17 00:00:00 2001 From: KanadeSiina Date: Sat, 30 Dec 2023 07:02:32 +0000 Subject: [PATCH] Fix test case path --- judge-core/src/compiler.rs | 4 ++-- judge-core/tests/judge_test.rs | 18 +++++++++--------- .../src/package_manager/discription.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/judge-core/src/compiler.rs b/judge-core/src/compiler.rs index f05d5d5..4f667bc 100644 --- a/judge-core/src/compiler.rs +++ b/judge-core/src/compiler.rs @@ -89,8 +89,8 @@ impl FromStr for Language { /// /// let compiler = Compiler::new(Language::Cpp, vec!["-std=c++17".to_string()]); /// match compiler.compile( -/// &PathBuf::from("../test-collection/src/programs/infinite_loop.cpp"), -/// &PathBuf::from("../tmp/infinite_loop_test"), +/// &PathBuf::from("tests/data/built-in-programs/src/programs/infinite_loop.cpp"), +/// &PathBuf::from("tests/temp/infinite_loop_test"), /// ) { /// Ok(out) => { /// log::info!("compiled with output: {}", out); diff --git a/judge-core/tests/judge_test.rs b/judge-core/tests/judge_test.rs index 8f569a9..738d905 100644 --- a/judge-core/tests/judge_test.rs +++ b/judge-core/tests/judge_test.rs @@ -35,9 +35,9 @@ fn build_test_config(program_executor: Executor) -> JudgeConfig { }, test_data: TestdataConfig { input_file_path: PathBuf::from(TEST_DATA_PATH) - .join("problem-packages/icpc/hello_world/data/secret/0.in"), + .join("packages/icpc/hello_world/data/secret/0.in"), answer_file_path: PathBuf::from(TEST_DATA_PATH) - .join("problem-packages/icpc/hello_world/data/secret/0.ans"), + .join("packages/icpc/hello_world/data/secret/0.ans"), }, checker: CheckerConfig { executor: None, @@ -56,7 +56,7 @@ fn test_run_judge() { log::debug!("current dir: {:?}", std::env::current_dir().unwrap()); let program_path = - PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/programs/read_and_write"); + PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/src/programs/read_and_write"); let program_executor = Executor::new(Language::Cpp, program_path).unwrap(); let runner_config = build_test_config(program_executor); @@ -74,7 +74,7 @@ fn test_run_judge() { fn test_run_tle() { init(); let program_path = - PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/programs/infinite_loop"); + PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/src/programs/infinite_loop"); let program_executor = Executor::new(Language::Cpp, program_path).unwrap(); let runner_config = build_test_config(program_executor); @@ -90,7 +90,7 @@ fn test_run_tle() { fn test_run_mle() { init(); let program_path = - PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/programs/memory_limit"); + PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/src/programs/memory_limit"); let program_executor = Executor::new(Language::Cpp, program_path).unwrap(); let runner_config = build_test_config(program_executor); @@ -107,12 +107,12 @@ fn test_run_interact() { init(); let interactor_executor = Executor::new( Language::Cpp, - PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/checkers/interactor-echo"), + PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/src/checkers/interactor-echo"), ) .unwrap(); let program_executor = Executor::new( Language::Cpp, - PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/programs/read_and_write"), + PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/src/programs/read_and_write"), ) .unwrap(); let runner_config = JudgeConfig { @@ -120,7 +120,7 @@ fn test_run_interact() { executor: Some( Executor::new( Language::Cpp, - PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/checkers/lcmp"), + PathBuf::from(TEST_DATA_PATH).join("built-in-programs/build/src/checkers/lcmp"), ) .unwrap(), ), @@ -153,7 +153,7 @@ fn test_build_icpc() { init(); let builder = JudgeBuilder::new(JudgeBuilderInput { package_type: PackageType::ICPC, - package_path: PathBuf::from(TEST_DATA_PATH).join("problem-packages/icpc/hello_world"), + package_path: PathBuf::from(TEST_DATA_PATH).join("packages/icpc/hello_world"), runtime_path: PathBuf::from(TEST_TEMP_PATH).join("hello_world"), src_language: Language::Cpp, src_path: PathBuf::from(TEST_DATA_PATH).join("built-in-programs/src/programs/read_and_write.cpp"), diff --git a/judge-service/src/package_manager/discription.rs b/judge-service/src/package_manager/discription.rs index 663fa9d..04a33a2 100644 --- a/judge-service/src/package_manager/discription.rs +++ b/judge-service/src/package_manager/discription.rs @@ -108,7 +108,7 @@ pub mod package_discription_test { use super::StoragedPackageDiscriptionMap; use std::path::PathBuf; - let folder = PathBuf::from("../tmp"); + let folder = PathBuf::from("../judge-core/tests/temp"); let mut package_discription_map = StoragedPackageDiscriptionMap::init(folder.clone()).unwrap();