emjudge-judgecore 0.1.12

Emjudge-Judgecore is a comprehensive library designed for the evaluation and testing of executing programs against specific specifications. Offering a robust judging system, it provides the framework for running and assessing programs within defined criteria, making it an essential tool for comprehensive program evaluation and testing.
Documentation
use emjudge_judgecore::{program::RawCode, settings::CompileAndExeSettings};
use tokio::io::AsyncReadExt;

#[tokio::main(flavor = "current_thread")]
async fn main() {
    let compile_and_exe_settings = CompileAndExeSettings::load_from_file(
        "examples/compile_and_exe_settings.toml",
        config::FileFormat::Toml,
    )
    .unwrap();
    let mut code = vec![];
    tokio::fs::File::open("examples/programs/compile_error.cpp")
        .await
        .unwrap()
        .read_to_end(&mut code)
        .await
        .unwrap();
    println!("Compiling examples/programs/compile_error.cpp in language C++...");
    println!(
        "Result: {}",
        RawCode::new(&code, compile_and_exe_settings.get_language("C++").unwrap())
            .compile()
            .await
    );

    let mut code = vec![];
    tokio::fs::File::open("examples/programs/helloworld.cpp")
        .await
        .unwrap()
        .read_to_end(&mut code)
        .await
        .unwrap();
    println!("Compiling examples/programs/helloworld.cpp in language C++...");
    println!(
        "Result: {}",
        RawCode::new(&code, compile_and_exe_settings.get_language("C++").unwrap())
            .compile()
            .await
    );
}