forked from AbleOS/ableos
USL: userland testing framework started. Final impl blocking on rlbuild being complete
This commit is contained in:
parent
5c6906b01f
commit
601d4aaf8b
1
sysdata/programs/test_framework/README.md
Normal file
1
sysdata/programs/test_framework/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
# test_framework
|
11
sysdata/programs/test_framework/meta.toml
Normal file
11
sysdata/programs/test_framework/meta.toml
Normal 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"
|
35
sysdata/programs/test_framework/src/main.hb
Normal file
35
sysdata/programs/test_framework/src/main.hb
Normal 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
|
||||
}
|
Loading…
Reference in a new issue