2.2 KiB
What does this project contain?
This directory holds an (almost) empty C project. It can be used as a template for your own project.
It contains of:
- a main which is the starting point for you program
- an example of a c and corresponding header file
- you have to complete the swap code.
- an example of a unittest
Directory structure
| Directory | Purpose |
|---|---|
| product | Holds the main.c file and c-source files that are only needed to build the main executable. |
| test | Holds all the unit tests that are used are build the main_test executable. |
| shared | Holds the files that are used by both the main as main_test executable. In general these are the c-source files that you wish to unit test. |
| build | Holds the build [artifacts](https://en.wikipedia.org/wiki/Artifact_(software_development): main and main_test |
System Preconditions
Preconditions before this project can be used:
- up and running linux (virtual) machine
- GIT client up and running
- working copy of this git repository available
Project use
To prepare your own working environment it is advised to follow the following steps:
- open your virtual machine
- start linux image
- COPY this project directory to your own GIT archive. Think about the directory where you want put it and how you are going to name it.
- start visual studio code and load the project
- start a terminal in visual studio code
Building the code
You build the code by using a terminal:
| Action | Terminal command to type |
|---|---|
| Build main code: | make main |
| Build test code: | make main_test |
| Build all code: | make all |
| Run main code: | make run |
| Run test code: | make test |
If you type make run and you get this message:
failed, the implementation is empty.
Then you have succesfully installed and ran the code.
If not, you have the fix whatever there needs to be fixed.
Debugging
This project is configure to debug the test code. Please refer to [https://code.visualstudio.com/docs/editor/debugging] on how to debug this code.
Personal projects
If you have succesfully altered this project, commit & push it to your git archive.
Once this is done you have completed one complete development cycle and you can apply this knowledge in challenges to come.