c test program

This commit is contained in:
nora 2023-09-30 10:54:59 +02:00
parent 54e0e7604e
commit 1baf8df4a8
18 changed files with 150 additions and 68 deletions

View file

@ -2,13 +2,6 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "c"
version = "0.1.0"
dependencies = [
"libuwuc",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
@ -19,8 +12,8 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
name = "example-user"
version = "0.1.0"
dependencies = [
"c",
"libuwuc",
"rawc",
]
[[package]]
@ -29,3 +22,10 @@ version = "0.1.0"
dependencies = [
"cfg-if",
]
[[package]]
name = "rawc"
version = "0.1.0"
dependencies = [
"libuwuc",
]

View file

@ -14,5 +14,5 @@ panic = "abort"
panic = "abort"
[dependencies]
c = { path = "../c" }
rawc = { path = "../rawc" }
libuwuc = { path = "../libuwuc" }

View file

@ -6,19 +6,7 @@ use core::ffi::c_char;
use libuwuc::{println, utils::SharedThinCstr};
extern crate c;
#[panic_handler]
#[cfg(not(test))]
fn handler(arg: &core::panic::PanicInfo) -> ! {
let args = format_args!("<no message>");
let payload = arg.message().unwrap_or(&args);
libuwuc::io::println!("panicked: {payload}");
if let Some(loc) = arg.location() {
libuwuc::io::println!(" at {}:{}:{}", loc.file(), loc.line(), loc.column());
}
libuwuc::start::exit(1);
}
extern crate rawc;
#[no_mangle]
extern "C" fn main(_argc: i32, _argv: *const *const c_char) -> i32 {