1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2025-02-17 11:18:31 +01:00

Add code formatting and testing to build pipeline. #3

This adds a few new make targets for formatting, testing and
release building.
This commit is contained in:
icex2 2019-10-19 23:10:52 +02:00
parent ce61a246a6
commit 6741a1f2fd
2 changed files with 46 additions and 8 deletions

View File

@ -29,17 +29,35 @@ ldflags := -Wl,--gc-sections -static-libgcc
# Define our ultimate target (`all') here, and also some helpers
#
all:
all: print-building
.PHONY: clean release code-format print-building
print-building:
@echo "Building gitrev "$(gitrev)"..."
print-release:
@echo "Release build started"
release: print-release clean code-format run-tests
clean:
@echo "Cleaning up..."
$(V)rm -rf $(BUILDDIR)
code-format:
@echo "Applying clang-format..."
# -style=file enables reading .clang-format
@find src/ -iname *.h -o -iname *.c | xargs clang-format -i -style=file
run-tests:
@echo "Running tests..."
@./run-tests-wine.sh
# Generate a version file to identify the build
version:
@echo "$(gitrev)" > version
.PHONY: clean
clean:
$(V)rm -rf $(BUILDDIR)
#
# Pull in module definitions
#

View File

@ -44,10 +44,30 @@ make
All output is located in the *build* folder including the final *bemanitools.zip* package.
### Release building
A release build is a clean build including code formatting and testing. This can be executed by running the following
command:
```
make release
```
## Code formatting
To apply our code style using clang-format, simply run the following command:
```
make code-format
```
Please also refer to the [section about](###Additional-code-style-guidelines) which cannot be covered using
clang-format.
## Testing
This still needs to be improved/implemented properly to run the unit-tests easily. Currently, you have to be on either
a Linux/MacOSX system to run *run-test-wine.sh* from the root folder. This executes all currently available unit-tests
and reports to the terminal any errors. This requires wine to be installed.
a Linux/MacOSX system and run
```
make run-tests
```
This executes all currently available unit-tests and reports to the terminal any errors. This requires wine to be
installed.
## Project structure
Now that your setup is ready to go, here is brief big picture of what you find in this project.