-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95c55bf
commit 9e1b6ed
Showing
27 changed files
with
238 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.PHONY: clean test coverage asan format format-check ci lf-test lib proto | ||
|
||
test: unit-test lf-test | ||
|
||
# Generate protobuf code | ||
proto: | ||
python3 external/nanopb/generator/nanopb_generator.py -Iexternal/nanopb/generator/proto/ -Iexternal/proto -L'#include "nanopb/%s"' -Dexternal/proto message.proto | ||
|
||
# Build reactor-uc as a static library | ||
lib: | ||
cmake -Bbuild | ||
cmake --build build | ||
make -C build | ||
|
||
# Build and run the unit tests | ||
unit-test: | ||
cmake -Bbuild -DBUILD_TESTS=ON | ||
cmake --build build | ||
make test -C build | ||
|
||
# Build and run lf tests | ||
lf-test: | ||
make -C test/lf | ||
|
||
# Get coverage data on unit tests | ||
coverage: | ||
cmake -Bbuild -DBUILD_TESTS=ON -DTEST_COVERAGE=ON | ||
cmake --build build | ||
make coverage -C build | ||
|
||
# Compile tests with AddressSanitizer and run them | ||
asan: | ||
cmake -Bbuild -DASAN=ON -DBUILD_TESTS=ON | ||
cmake --build build | ||
make test -C build | ||
|
||
# Format the code base | ||
SRC_FILES := $(shell find ./lib -name '*.cc' -print) | ||
HDR_FILES := $(shell find ./include -name '*.hh' -print) | ||
|
||
format: | ||
clang-format -i -style=file $(SRC_FILES) $(HDR_FILES) | ||
|
||
# Check that the code base is formatted | ||
format-check: | ||
clang-format --dry-run --Werror -style=file $(SRC_FILES) $(HDR_FILES) | ||
|
||
# Run the entire CI flow | ||
ci: clean test coverage format-check | ||
|
||
clean: | ||
rm -rf build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.