Pat Hickey
67d2ce6d85
Refactor tests to use proptest ( #6 )
...
* generator: take an &mut GuestMemory
rather than pass the owned GuestMemory in, just give exclusive access
to it. Makes testing easier.
* tests: start transforming tests to check abi-level generated code as well
* finish lowering of test funcs
* tests: rename variables to more sensible names
* proptesting: reliably finds that we dont allow stuff to be right against end of memory!
* memory: fix off-by-one calc in GuestMemory::contains(&self, Region)
ty proptest!
also, refactored the Region::overlaps to be the same code but easier to
read.
* generator: better location information in GuestError
* testing: proptest generates memory areas, tests everything
2020-02-04 22:35:38 +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
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