Skip to content

Daniele-Tentoni/c89-continuous-integration

Repository files navigation

c89-continuous-integration

Table of contents

Introduction

This template project want to be a starting point for an academic exercise with c89 language. You can easy clone this template and start code your program without any overhead from create from zero any continuous integration environment and testing script. You can add your tests in both script form (for "endpoint" testing) and cmocka c library (for "unit" testing). For each test type, check their sections in this file.

Continuous Integration

This project use Github Actions to accomplish this task. By design, push and pull_request to Github trigger the default workflow (named Test), that run only test.sh script. This to keep the ci rules as simpler as possible. Feel free to contribute opening issues or pull requests to enhance this feature.

Testing

In this project, for academic purpouse, I use those two types of testing to check each aspect of an exercise. You can check with fine granulation code functions and program outputs. Following guides will help you (and remember me) how to configure those features.

Unit Testing

This section missing at the moment.

E2E Testing

Add to test.sh, after the compilation code, the argument number check and after that, all your endpoints tests. Use the $? special shell variable to store the last command used return value and output in main.error or main.log files to check some other outputs from your program.

Compile

Linux

Run

gcc math.c main.c -o main.exe

command to compile without any other option and sugar. In makefile, I use also

-Wall -Wextra -std=c89 -pedantic

to force all warnings, extras too, and use the c89 language dialect. You can use the makefile utility with:

make

You can finally clean your project with the clean target:

make clean

Test

Run

./test.sh

and wait for the results. Even in this case, you can use the makefile utility with:

make run-tests

Made by Daniele Tentoni.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages