Skip to content

remove unproven flag #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
burrbull opened this issue Apr 25, 2020 · 1 comment · Fixed by #131
Closed

remove unproven flag #116

burrbull opened this issue Apr 25, 2020 · 1 comment · Fixed by #131

Comments

@burrbull
Copy link
Member

burrbull commented Apr 25, 2020

Encoding works fine as for me.

I think we should prove it and remove unproven option.

Alternative:
Split this crate on several like svd-base, svd-parser, svd-encoder, svd-utils, tests.

@marcoieni
Copy link
Contributor

I think we should prove it and remove unproven option.

This means writing some tests, right? :)

In my project I added a test in which I test this library.
In the test I decode an xml, I encode it and then I decode it again.
The test asserts that the two decoded xml are equal.
Here is the test:
https://github.com/MarcoIeni/svdtools/blob/riir/tests/svd_parser.rs

Maybe we could start by writing a (integration?) test like this.

bors bot added a commit that referenced this issue Dec 26, 2020
131: Remove unproven r=burrbull a=brainstorm

Fixes #116

@marcoieni @burrbull Let's do what you suggest on #116, shall we? See the integration [test mostly borrowed from @marcoieni's `svd_parser`](https://github.com/rust-embedded/svd/pull/131/files#diff-eb771f54a1fdc1c330a82981d7d27d1202a5cbe3a59581ff67af5e3361f5f90e)

Getting the following error for now, ~seems like getting the same capitalization (and perhaps ordering?) might be challenging for integration testing purposes~... nope, it's just `<fields />` being empty,  I guess the SVD parser should tolerate that?:

```xml
    <peripheral>
           <name>RNG</name>
           <description>RNG register</description>
           <baseAddress>0x3FF20E44</baseAddress>
           <addressBlock>
                       <offset>0</offset>
                       <size>32</size>
                       <usage>RNG register</usage>
           </addressBlock>
           <registers>
                  <register>
                       <name>rng</name>
                       <fields />
                       <description>RNG register</description>
                       <addressOffset>0</addressOffset>
                       <size>32</size>
                       <access>read-only</access>
                      <resetValue>0</resetValue>
                   </register>
        </registers>
     </peripheral>
```

```rust
---- read_and_write stdout ----
thread 'read_and_write' panicked at 'Failed to parse the SVD file into Rust structs: In device `esp8266`

Caused by:
    0: In peripheral `RNG`
    1: In register `rng`
    2: Register have `fields` tag, but it is empty', tests/integration.rs:14:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Co-authored-by: Roman Valls Guimera <[email protected]>
@bors bors bot closed this as completed in 8a8b7a7 Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants