Giter Site home page Giter Site logo

Comments (4)

kreisl avatar kreisl commented on June 17, 2024

What I suggested is to put unit test together with the classes. Such as Axis.cpp and Axis.test.cpp in the same folder so it is kind of mandatory to write them at the same time and when we make changes the same pull request should also include the tests. That would be ideal. I have an additional tests folder, which might contain more complicated tests, which might need some manual intervention. For example a MC simulation, which is maybe difficult to formulate as an automatic test. It could create a root file or pdf file which needs inspection. Those tests in /tests would be a higher level and are not strictly needed to verify the mathematics of QnTools. However they might be nicer to look at for physicists. What do you think of this proposal?

from qntools.

eugene274 avatar eugene274 commented on June 17, 2024

Well, I've never seen that way of organization, anyway it sounds reasonable for me. But I get used to have following structure:

src/
|-- targetA/
|    `-- ClassA.cpp
`-- targetB/
     `-- ClassB.cpp
tests/
|-- targetA/
|    `-- TestClassA.cpp
`-- targetB/
     `-- TestClassB.cpp

It allows keeping all testing infrastructure (e.g. googletest) inside tests/ and switching on/off all testing by adding or not-adding tests folder to CMake.

MC test is not actually a unit test. I would put it to examples/.

from qntools.

kreisl avatar kreisl commented on June 17, 2024

In the implementation I have largely followed this project structure presented here:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1204r0.html
In particular I have implemented this approach:
https://api.csswg.org/bikeshed/?force=1&url=https://raw.githubusercontent.com/vector-of-bool/pitchfork/develop/data/spec.bs

I know some things are a bit controversial.
I quite like the split of unit tests which should test a single class / file. and larger tests which go into tests.
I could not keep all of the source files in the same directory because ROOT caused me some problems during the dictionary generation.

from qntools.

kreisl avatar kreisl commented on June 17, 2024

I would argue that we keep a "MC closure test" for physicists to easily digest and appreciate the features of the framework from a physics perspective and that it would belong to the test category. I like your idea of having an examples folder, but I would see this as an additional thing.

from qntools.

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.