Jakub Konka
3d428b828f
Add some (incomplete set) basic sanity end-to-end tests ( #2 )
...
* Add some (incomplete set) basic sanity end-to-end tests
This commit adds some (an incomplete set of) basic sanity end-to-end
tests. It uses `test.witx` to autogenerate types and module interface
functions (aka the syscalls), and tests their implementation. For
the host memory, it uses simplistic `&mut [u8]` where we have full
control of the addressing and contents.
* Add sanity test for baz interface func
This commit adds a sanity test for the `Foo::baz` interface func.
* Upcast start/len for Region to avoid overflow
* Reenable alignment checking for memory
* use an array to implement hostmemory
Co-authored-by: Pat Hickey <pat@moreproductive.org >
2020-02-03 07:38:48 +01:00
Pat Hickey
f321f05a98
use lifetimes on types that require it
2020-01-31 15:18:49 -08:00
Pat Hickey
29c3ef9d09
we now parse witx paths and the ctx type name in the macro invocation
2020-01-30 16:38:16 -08:00
Pat Hickey
0ba8e73184
change proc macro argument parsing to use syn
2020-01-30 14:29:53 -08:00
Pat Hickey
e2079c085d
report which field a struct validation error occured in
2020-01-29 13:18:57 -08:00
Pat Hickey
814dd19488
structs that contain pointers work!
2020-01-28 18:17:48 -08:00
Pat Hickey
35d9373976
we now validate Copy structs
2020-01-28 16:34:34 -08:00
Pat Hickey
62e00434b0
structs implementing Copy are scaffolded out.
...
todo: need an unsafe method for casting pointers in order to validate
contents via recursive descent
2020-01-28 15:45:52 -08:00
Pat Hickey
373560b88a
and now funcs work again
2020-01-27 20:28:27 -08:00
Pat Hickey
c780421c28
i think the memory model is fixed now? at least until arrays....
2020-01-27 20:21:53 -08:00
Pat Hickey
ec456e9e50
new memory model. not quite complete
2020-01-27 18:20:47 -08:00
Pat Hickey
e6a4ae205c
return values written to pointers!
2020-01-27 12:40:54 -08:00
Pat Hickey
a20ef36a49
multiple layers of pointers work!
2020-01-24 19:57:18 -08:00
Pat Hickey
020778b7da
we can handle one layer of pointers!
2020-01-24 18:08:37 -08:00
Pat Hickey
e789033651
bugfix
2020-01-24 15:16:09 -08:00
Pat Hickey
42eca19b50
types: make the tryfrom/to impl for the abi type, not the signed variant
2020-01-24 15:12:51 -08:00
Pat Hickey
b6d342ccb5
some progress on marshalling args
2020-01-23 17:55:59 -08:00
Pat Hickey
b4f21752b0
generate a module trait and call it
2020-01-23 12:53:10 -08:00
Pat Hickey
cb24fd97c0
better error trait design
2020-01-23 11:21:04 -08:00
Pat Hickey
7cc0073a3e
hmm my first idea was bad but not too bad
2020-01-22 21:03:24 -08:00
Pat Hickey
c05475b806
generate: now we have a way to do errors, i guess
2020-01-22 20:47:40 -08:00
Pat Hickey
97077954f8
enum generation: fill in GuestTypeCopy impl
2020-01-22 17:23:29 -08:00
Pat Hickey
aa5c5f7018
flesh out the guest type traits a bit further
2020-01-22 16:38:25 -08:00
Pat Hickey
b8feffe6e1
funcs get abi type definitions
2020-01-20 15:10:11 -08:00
Pat Hickey
9291495e57
put names all in one place. some stub code for funcs!
2020-01-19 19:33:41 -08:00
Pat Hickey
cd686915aa
clear out a bunch of old code, reorganize
2020-01-19 18:46:16 -08:00
Pat Hickey
4c7b3e8685
import some other helpers from pat's crate
...
* parse the proc macro argument into a file path
* use a much simpler witx spec by default
2020-01-17 15:48:51 -08:00
Pat Hickey
0d47556cf7
import memory sub-crate
2020-01-17 15:41:19 -08:00
Jakub Konka
f24b0240ae
Start tweaking original wig with Pat's suggestion
2020-01-17 19:30:37 +01:00
Jakub Konka
64f0793388
Fix incorrect hardcoded path to witx spec
2020-01-17 14:59:51 +01:00
Jakub Konka
6f6c6499c6
Set up machinery
2020-01-17 14:54:05 +01:00