Coder Social home page Coder Social logo

(Generated?) Unit tests about cbexigen HOT 4 CLOSED

SiebrenW avatar SiebrenW commented on September 3, 2024
(Generated?) Unit tests

from cbexigen.

Comments (4)

SebaLukas avatar SebaLukas commented on September 3, 2024 2

I think I understand your point now. My focus is more on a heavy testing of the generated exi c code. In other words, a kind of fuzzing testing. That I can be sure that the exi parser can en- or decode something strange.

If it's about testing this cbexigen generator and its output, then that should definitely be here in this repo.

So I'm generally in favor of having those tests you mentioned above here.
From my side, you are welcome to write such tests and open pull request(s) for them.

from cbexigen.

SebaLukas avatar SebaLukas commented on September 3, 2024 1

There were also no objections from the EVerest Car<->Charger Communication WG. I'm looking forward to your PR(s) 😃

from cbexigen.

SebaLukas avatar SebaLukas commented on September 3, 2024

Since I also had the idea, I think it's generally a good idea.

But I don't know if the cbexigen repo is the right repo for it. Because the c code has to be generated every time.

My plan was to open another repo in EVerest with the generated cbexigen code. And to create a library "libexi" from it, which can then use e.g. the libiso15118 lib or the EvseV2G module. That's where I would see the unit tests.

In Everest we have not decided on a single unit testing framework. Some use Gtest, I use catch2 for the unit tests in libiso15118. So use the test framework that makes the most sense for you.

from cbexigen.

SiebrenW avatar SiebrenW commented on September 3, 2024

I don't really see the issue with re-generating the code every time. We can consider it another build step.
Keeping the code "as is" to me is like keeping a binary in the repo, the C code is supposed to be the product of the build step, in my opinion, like a binary executable is.
The code in the other repo would go out of date with every commit, adding a step of updating that repo every time this repo is updated. I think that's not ideal.

What these tests should be testing is:

  • Is the code still generating without errors?
  • Can this code build?
  • Did the API change? (may be fine, but we should know and a build error will tell us that)
  • Does the generated code do what we expect?
  • This test script can be used as reference to how to use this repo (config, generate, use)

If we put the generated code in another repo we can't test the first test automatically, it all involves manual effort.

So I do see a lot of advantages to at least link the tests directly to this repo. This can be as a submodule of the test repo and still have those tests generate the schemas, but again, that's extra effort to update the submodule every time.

Or am I missing something? Or outright wrong 😐

from cbexigen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.