Skip to content

Commit

Permalink
move code style and tests logic into scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA committed Jan 19, 2025
1 parent 28048bd commit 7fdb6d6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,10 @@ checks:
@python scripts/prebuild_check.py || (echo "Requirements verification failed. Stopping build." && exit 1)

code_style:
cpplint Src/modules/*/*pp Src/peripheral/*/*pp Src/platform/*/*pp
${ROOT_DIR}/scripts/code_style.sh

tests:
mkdir -p ${BUILD_DIR}/tests/as5600
mkdir -p ${BUILD_DIR}/tests/sht3x
cd ${BUILD_DIR}/tests/as5600 && cmake ../../../Src/drivers/as5600/tests && make && ./test_as5600
cd ${BUILD_DIR}/tests/sht3x && cmake ../../../Src/drivers/sht3x/tests && make && ./test_sht3x
${ROOT_DIR}/scripts/tests.sh

upload:
LATEST_TARGET=$$(ls -td ${BUILD_DIR}/release/*.bin | head -1) && ./scripts/tools/stm32/flash.sh $$LATEST_TARGET
Expand Down
8 changes: 8 additions & 0 deletions scripts/code_style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
REPOSITORY_PATH="$(dirname "$SCRIPT_DIR")"

set -e

cpplint ${REPOSITORY_PATH}/Src/modules/*/*pp \
${REPOSITORY_PATH}/Src/peripheral/*/*pp Src/platform/*/*pp
11 changes: 11 additions & 0 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
REPOSITORY_PATH="$(dirname "$SCRIPT_DIR")"
BUILD_DIR=${REPOSITORY_PATH}/build

set -e

mkdir -p ${BUILD_DIR}/tests/as5600
mkdir -p ${BUILD_DIR}/tests/sht3x
cd ${BUILD_DIR}/tests/as5600 && cmake ${REPOSITORY_PATH}/Src/drivers/as5600/tests && make && ./test_as5600
cd ${BUILD_DIR}/tests/sht3x && cmake ${REPOSITORY_PATH}/Src/drivers/sht3x/tests && make && ./test_sht3x

0 comments on commit 7fdb6d6

Please sign in to comment.