-
Notifications
You must be signed in to change notification settings - Fork 223
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
Add Contiguous integration to the repo for better standards #11
Comments
Great idea. It is definitely on my to-do list (currently doing a manual rebuild and deploy). Thanks for the links. |
👍 |
I would like to do continuous deployment as well as integration. This project involves two repos though (CppSamples-Web and CppSamples-Samples) - anybody know if you can have Travis-CI trigger a build when either repo is updated? Edit: Looks like maybe this would work if I used git submodules. Then I just need to push updates the submodule. |
Glad you found the right way. I am not a expert 😅 , so can't help much . |
I've implemented continuous integration/deployment for the website itself, which basically pulls in the samples, builds the site, and then pushes it to the GitHub Pages repository where it is hosted. I'll soon do some CI for this samples repository, but I need to think of a better way to test the samples (not just seeing if they compile). (sorry, just putting my thoughts here to keep note) |
Just a suggestion off the top of my head: Given the simplicity of the tests, incorporating a proper test and mock framework is probably insane overkill. You could probably get by with simple hand-cranked tests in each sample file. Also it would probably be better if each sample was entirely self-contained - and thus self-testing. Trying to shadow the sample tree with a test tree just seems like an unnecessary pain. The sample format already looks like this:
If you specify that the "sample code" has to be a function, and the "hidden code" has to be a legal main function that calls the sample code function, you could then further specify that the main function has to do tests on the sample code. For example (borrowing from the
Now you can test by building the sample cpp file, and running it. The non-zero exit status will alert your CI tool - whatever you use - that there was an error, and you get some info on stdout about what went wrong. And because everything after the sample text comment block is invisible on the site, you could add as many tests as you like, or make the tests as complex as you please. |
Add CI to monitor correct building of the project, also helps in detecting compile time errors for pull requests and helps catching trivial errors, almost every cool project on Github is using one. I suggest Travis CI
Some resources that might help
Travis CI + Clang + CPP 11
Travis CI + GCC + CPP 11
Another resource
The text was updated successfully, but these errors were encountered: