Skip to content

Commit

Permalink
Fix test case path
Browse files Browse the repository at this point in the history
  • Loading branch information
akamya997 committed Dec 30, 2023
1 parent 9119651 commit a1d1c15
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions judge-core/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 9 additions & 9 deletions judge-core/tests/judge_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -107,20 +107,20 @@ 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 {
checker: CheckerConfig {
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(),
),
Expand Down Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion judge-service/src/package_manager/discription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit a1d1c15

Please sign in to comment.