1
0
Fork 0
forked from AbleOS/ableos

USL: userland testing framework started. Final impl blocking on rlbuild being complete

This commit is contained in:
Able 2025-02-22 13:11:56 -06:00
parent 5c6906b01f
commit 601d4aaf8b
3 changed files with 47 additions and 0 deletions
sysdata/programs/test_framework

View file

@ -0,0 +1 @@
# test_framework

View file

@ -0,0 +1,11 @@
[package]
name = "test_framework"
authors = [""]
[dependants.libraries]
[dependants.binaries]
hblang.version = "1.0.0"
[build]
command = "hblang src/main.hb"

View file

@ -0,0 +1,35 @@
stn := @use("stn")
main := fn(): int {
exe := u8.[
0x15, 145, 210,
0, 0, 0, 0,
2, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
85, 0
]
test(@bitcast(&exe), 49)
loop{}
return 0
}
assert_eq := fn(lhs: bool, rhs: bool): bool {
lhs == rhs
}
assert_neq := fn(lhs: bool, rhs: bool): bool {
lhs != rhs
}
test := fn(exe_data: ^u8, exe_size: uint): uint {
// TODO: Spawn new process
pid := @inline(stn.process.spawn, exe_data, exe_size)
stn.log.info("PID")
return 0
}