Skip to content
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

Utilize CMake and separate the build process from unit testing #2

Open
jakub-zarembinski opened this issue Jul 16, 2018 · 0 comments
Open

Comments

@jakub-zarembinski
Copy link

Hi,
First of all, thank you for the useful feedback offered in your review. One of the lessons we've learned from the experience of working with your School Lottery project is that in the next release we should make the folder structure imposed by EOSFactory more flexible and configurable.

Apart from the Pull Request, we've created another branch called eosfactory-fix2 in our repository. The goal is to showcase how we imagine EOSFactory to be used with your project.

Firstly, we've moved the Lottery.cpp file to the src folder, as it allows for CMake compatibility.

We recommend having a separate build folder, and execute the build process with CMake:

cd build
cmake ..
make

And then you can run unit tests with CMake:

ctest

Or to make it more verbose:

ctest -V

We find CMake to be extremely convenient and useful.
However, you can still run the tests in the standard way:

python3 test/lottery.spec.py

Please note that we've removed the build process from your unit test. We believe it's better to do the build prior to running unit tests and treat is as a separate activity. That's why we like CMake so much, as it streamlines the whole process and reduces it to just two commands: makeand ctest (you need to run the cmake .. command only once, as all it does is configure the build files).

Also, please note that this branch adds Visual Studio Code compatibility (note the .vscode folder). The benefits of using VSC are desribed here.

And finally, some screenshots showcasing the above recommendations in VSC:

pick_definition

cmake_make

ctest

manual_test

task_build

task_test_lottery spec

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

No branches or pull requests

1 participant