| Crates.io | ccode_runner |
| lib.rs | ccode_runner |
| version | 0.3.6 |
| created_at | 2025-02-22 00:02:13.969081+00 |
| updated_at | 2025-09-23 21:00:28.249951+00 |
| description | Run/compiles files and executes them efficiently |
| homepage | https://rootcircle.github.io/blog/project/cpast.html |
| repository | https://github.com/rootCircle/cpast_mono |
| max_upload_size | |
| id | 1564899 |
| size | 102,390 |
ccode_runner is a component designed to run arbitrary program code on local devices. It compiles or interprets code and sends the output, making it an essential part of the cpast ecosystem.
Ensure you have the necessary compilers and interpreters installed for the languages you intend to use.
Clone the repository and navigate to the ccode_runner directory:
git clone https://github.com/rootCircle/cpast_mono.git
cd cpast_mono/ccode_runner
To use ccode_runner, you need to integrate it within your cpast testing workflow. Below is an example of how to use it:
use ccode_runner::lang_runner::program_store::ProgramStore;
use std::path::Path;
fn main() {
let correct_file = Path::new("path/to/correct_file.rs");
let test_file = Path::new("path/to/test_file.rs");
let do_force_compile = true;
let program_store = ProgramStore::new(correct_file, test_file, do_force_compile).unwrap();
let stdin_content = "input data";
let (is_different, correct_output, test_output) = program_store
.run_codes_and_compare_output(stdin_content)
.unwrap();
println!("Outputs are different: {}", is_different);
println!("Correct Output: {}", correct_output);
println!("Test Output: {}", test_output);
}
.rs.py.c.cpp, .cxx, .c++, .cc, .C.java.js.rbccode_runner uses different strategies for different languages:
ccode_runner is well suited when repeated compilation might be required for one code like in case for cpast, it intelligently skips those cases for you, making it lot faster!
We welcome contributions! Please read our Contributing Guidelines for more details.