Skip to content

Commit

Permalink
Merge pull request #44 from melexis/tools-update
Browse files Browse the repository at this point in the history
Tools update
  • Loading branch information
Letme authored Aug 5, 2024
2 parents 0b1be08 + 9ca2dd8 commit 7d5d3ba
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 71 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/c-cpp-coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ jobs:
- name: Install gcc-${{ matrix.gcc_version }} and other dependencies
run: |
sudo apt update
sudo apt-get install -y gcc-${{ matrix.gcc_version }} ruby rake gcc-multilib lcov
sudo apt-get install -y gcc-${{ matrix.gcc_version }} ruby rake gcc-multilib lcov wget
pip install gcovr==5.0
wget https://github.com/ThrowTheSwitch/Ceedling/releases/download/0.32.0-772f5f4/ceedling-0.32.0-772f5f4.gem -O ceedling.gem
sudo gem install ceedling.gem
sudo gem install coveralls-lcov
sudo ln -fs /usr/bin/gcov-${{ matrix.gcc_version }} /usr/bin/gcov
- name: Install branch v1.15 of lcov
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
gcc_version: ['7','8','9','10']
gcc_version: ['10','11','12']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install gcc-${{ matrix.gcc_version }}
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
Expand All @@ -31,10 +31,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
clang_version: ['7','8','9','10']
clang_version: ['11','12','13','14','15']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install clang-${{ matrix.clang_version }}
run: |
sudo apt-get install -y clang-${{ matrix.clang_version }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Doxygen and other dependencies
run: |
sudo apt update
sudo apt-get install -y doxygen doxygen-doc doxygen-latex doxygen-gui graphviz
pip3 install mlx.warnings
- name: Execute and build documentation
run: |
mlx-warnings --doxygen --exact-warnings 9 --command make doxy
mlx-warnings --doxygen --exact-warnings 3 --command make doxy
- name: Upload HTML documentation
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: html-doc
path: ./build/html/doxygen/html
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download HTML documentation from job 'test'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: html-doc
path: ./build/html/doxygen/html
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stylechecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
- uses: actions/checkout@v2
- name: Install recent uncrustify
run: |
git clone https://github.com/uncrustify/uncrustify.git
# we need this because of a bug introduced in https://github.com/uncrustify/uncrustify/pull/3655
git clone https://github.com/uncrustify/uncrustify.git --branch uncrustify-0.75.1
cd uncrustify && mkdir build && cd build
cmake .. && sudo make install && cd ../..
- name: Run uncrustify
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,41 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
gcc_version: ['7','8','9','10']
gcc_version: ['10','11','12']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install gcc-${{ matrix.gcc_version }} and other dependencies
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt-get install -y gcc-${{ matrix.gcc_version }} ruby rake gcc-multilib lcov
sudo apt-get install -y gcc-${{ matrix.gcc_version }} ruby rake gcc-multilib lcov wget
pip install --user gcovr==3.3
wget https://github.com/ThrowTheSwitch/Ceedling/releases/download/0.32.0-772f5f4/ceedling-0.32.0-772f5f4.gem -O ceedling.gem
sudo gem install ceedling.gem
- name: Unit tests
run: make utest
run: make utest CC=gcc
env:
CC: gcc-${{ matrix.gcc_version }}
test-clang:
name: With clang ${{ matrix.clang_version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
clang_version: ['7','8','9','10']
clang_version: ['11','12','13','14','15']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install clang-${{ matrix.clang_version }}
run: |
sudo apt-get install -y clang-${{ matrix.clang_version }} ruby rake gcc-multilib lcov
sudo apt-get install -y clang-${{ matrix.clang_version }} ruby rake gcc-multilib lcov wget
pip install --user gcovr==3.3
wget https://github.com/ThrowTheSwitch/Ceedling/releases/download/0.32.0-772f5f4/ceedling-0.32.0-772f5f4.gem -O ceedling.gem
sudo gem install ceedling.gem
sudo ln -fs /usr/bin/clang-${{ matrix.clang_version }} /usr/bin/clang
sudo ln -fs /usr/bin/llvm-cov-${{ matrix.clang_version }} /usr/bin/llvm-cov
- name: Unit tests
Expand Down
8 changes: 4 additions & 4 deletions inc/mlx90632.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ typedef enum mlx90632_meas_e {
#define MLX90632_EE_REFRESH_RATE_START 10 /**< Refresh Rate Start bit */
#define MLX90632_EE_REFRESH_RATE_SHIFT 8 /**< Refresh Rate shift */
#define MLX90632_EE_REFRESH_RATE_MASK GENMASK(MLX90632_EE_REFRESH_RATE_START, MLX90632_EE_REFRESH_RATE_SHIFT) /**< Refresh Rate Mask */
#define MLX90632_EE_REFRESH_RATE(ee_val) (ee_val & MLX90632_EE_REFRESH_RATE_MASK) /**< Extract the Refresh Rate bits*/
#define MLX90632_EE_REFRESH_RATE(ee_val) (ee_val & MLX90632_EE_REFRESH_RATE_MASK) /**< Extract the Refresh Rate bits*/
#define MLX90632_REFRESH_RATE(ee_val) (MLX90632_EE_REFRESH_RATE(ee_val) >> MLX90632_EE_REFRESH_RATE_SHIFT) /**< Extract Refresh Rate from ee register */
#define MLX90632_REFRESH_RATE_STATUS(mlx90632_meas) (mlx90632_meas << MLX90632_EE_REFRESH_RATE_SHIFT) /**< Extract the Refresh Rate bits */

Expand All @@ -141,10 +141,10 @@ typedef enum mlx90632_meas_e {
#define MLX90632_CFG_SOC_SHIFT 3 /**< Start measurement in step mode */
#define MLX90632_CFG_SOC_MASK BIT(MLX90632_CFG_SOC_SHIFT)
#define MLX90632_CFG_PWR_MASK GENMASK(2, 1) /**< PowerMode Mask */
#define MLX90632_CFG_PWR(ctrl_val) (ctrl_val & MLX90632_CFG_PWR_MASK) /**< Extract the PowerMode bits*/
#define MLX90632_CFG_PWR(ctrl_val) (ctrl_val & MLX90632_CFG_PWR_MASK) /**< Extract the PowerMode bits*/
#define MLX90632_CFG_MTYP_SHIFT 4 /**< Meas select start shift */
#define MLX90632_CFG_MTYP_MASK GENMASK(8, MLX90632_CFG_MTYP_SHIFT) /**< Meas select Mask */
#define MLX90632_CFG_MTYP(ctrl_val) (ctrl_val & MLX90632_CFG_MTYP_MASK) /**< Extract the MeasType bits*/
#define MLX90632_CFG_MTYP(ctrl_val) (ctrl_val & MLX90632_CFG_MTYP_MASK) /**< Extract the MeasType bits*/
#define MLX90632_CFG_SOB_SHIFT 11 /**< Start burst measurement in step mode */
#define MLX90632_CFG_SOB_MASK BIT(MLX90632_CFG_SOB_SHIFT)
#define MLX90632_CFG_SOB(ctrl_val) (ctrl_val << MLX90632_CFG_SOB_SHIFT)
Expand Down Expand Up @@ -363,7 +363,7 @@ double mlx90632_calc_temp_object_reflected(int32_t object, int32_t ambient, doub
* Please confirm that i2c read (16bit) is functioning as expected.
*
* @retval 0 Successfully initialized MLX90632 driver, extended range measurement not supported
* @retval @link ERANGE @endlink Successfully initialized MLX90632 driver, extended range measurement is supported
* @retval ERANGE Successfully initialized MLX90632 driver, extended range measurement is supported
* @retval <0 Something went wrong. Consult errno.h for more details.
*/
int32_t mlx90632_init(void);
Expand Down
6 changes: 2 additions & 4 deletions inc/mlx90632_extended_meas.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
* to retrieve values in milliCelsius
*
* @param[out] ambient_new_raw Pointer to where new raw ambient temperature is written
* @param[out] object_new_raw Pointer to where new raw object temperature is written
* @param[out] ambient_old_raw Pointer to where old raw ambient temperature is written
* @param[out] object_old_raw Pointer to where old raw object temperature is written
* @param[out] object_new_raw Pointer to where new raw object temperature is written
*
* @retval 0 Successfully read both temperatures
* @retval <0 Something went wrong. Check errno.h for more details
Expand All @@ -51,9 +50,8 @@ int32_t mlx90632_read_temp_raw_extended(int16_t *ambient_new_raw, int16_t *ambie
* to retrieve values in milliCelsius
*
* @param[out] ambient_new_raw Pointer to where new raw ambient temperature is written
* @param[out] object_new_raw Pointer to where new raw object temperature is written
* @param[out] ambient_old_raw Pointer to where old raw ambient temperature is written
* @param[out] object_old_raw Pointer to where old raw object temperature is written
* @param[out] object_new_raw Pointer to where new raw object temperature is written
*
* @retval 0 Successfully read both temperatures
* @retval <0 Something went wrong. Check errno.h for more details
Expand Down
4 changes: 4 additions & 0 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:build_root: 'build/'
# :release_build: TRUE
:test_file_prefix: Test
:use_backtrace_gdb_reporter: FALSE
:options_paths:
- 'targets/'
#:release_build:
Expand Down Expand Up @@ -69,6 +70,9 @@
# Ceedling defaults to using gcc for compiling, linking, etc.
# As [:tools] is blank, gcc will be used (so long as it's in your system path)
# See documentation to configure a given toolchain for use
:backtrace_settings:
:executable: donotusethis
:optional: TRUE

:plugins:
:load_paths:
Expand Down
5 changes: 3 additions & 2 deletions rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#HERE = File.expand_path(File.dirname(__FILE__)) + '/'
#UNITY_ROOT = File.expand_path(File.dirname(__FILE__)) + '/unity/'

PROJECT_CEEDLING_ROOT = "tools/ceedling"
load "#{PROJECT_CEEDLING_ROOT}/lib/ceedling/rakefile.rb"
PROJECT_CEEDLING_ROOT = "./tools/ceedling"
load "#{PROJECT_CEEDLING_ROOT}/lib/ceedling.rb"
Ceedling.load_project

#TEMP_DIRS = [
# 'build/test/'
Expand Down
2 changes: 1 addition & 1 deletion src/mlx90632_extended_meas.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @Extended range measurements implementation for MLX90632 driver with virtual i2c communication
* @brief Extended range measurements implementation for MLX90632 driver with virtual i2c communication
* @internal
*
* @copyright (C) 2017 Melexis N.V.
Expand Down
33 changes: 17 additions & 16 deletions targets/clang.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
:flags:
:test:
:compile:
- -Wall
- -Wno-address
- -Wno-attributes
- -Wno-unused-function
- -std=c99
- -fshort-enums
- -pedantic
- -fprofile-arcs
- -ftest-coverage
:*:
- -Wall
- -Wno-address
- -Wno-attributes
- -Wno-unused-function
- -std=c99
- -fshort-enums
- -pedantic
- -fprofile-arcs
- -ftest-coverage
:link:
- -lm
- -lgcov
- --coverage
:*:
- -lm
- -lgcov
- --coverage

:tools:
:compiler:
Expand Down Expand Up @@ -81,18 +83,14 @@
- -ftest-coverage
- -D$: COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -c ${1} #source code input file (Ruby method call param list sub)
- -o ${2} #object file output (Ruby method call param list sub)
:gcov_linker:
:executable: clang
:arguments:
- ${1}
- -lm
- -D$: COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -lgcov
- --coverage
- -o ${2} #executable file output (Ruby method call param list sub)
:gcov_fixture:
:executable: ${1}
:gcov_report:
Expand All @@ -114,3 +112,6 @@
- --capture
- --config-file .lcovrc
- --output-file build/artifacts/gcov/lcov.info
:backtrace_settings:
:executable: donotusethis
:optional: TRUE
58 changes: 32 additions & 26 deletions targets/gcc.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
:flags:
:test:
:compile:
- -m64
- -Wall
- -Wno-address
- -std=c99
- -pedantic
- -g
- -fprofile-arcs
- -ftest-coverage
:*:
- -m64
- -Wall
- -Wno-address
- -std=c99
- -pedantic
- -g
- -fprofile-arcs
- -ftest-coverage
:link:
- -lm
- -m64
- -lgcov
- --coverage
:*:
- -lm
- -m64
- -lgcov
- --coverage
:gcov:
:compile:
:*:
- -m64
- -Wall
- -Wno-address
- -Wno-attributes
- -Wno-unused-function
- -std=c99
- -pedantic
- -g
- -fprofile-arcs
- -ftest-coverage


:tools:
:test_compiler:
Expand All @@ -39,31 +55,17 @@
:gcov_compiler:
:executable: gcc
:arguments:
- -m64
- -Wall
- -Wno-address
- -Wno-attributes
- -Wno-unused-function
- -std=c99
- -pedantic
- -g
- -fprofile-arcs
- -ftest-coverage
- -D$: COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -c ${1} #source code input file (Ruby method call param list sub)
- -o ${2} #object file output (Ruby method call param list sub)
:gcov_linker:
:executable: gcc
:arguments:
- ${1}
- -lm
- -m64
- -lgcov
- --coverage
- -D$: COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -o ${2} #executable file output (Ruby method call param list sub)
:gcov_fixture:
:executable: ${1}
:gcov_report:
Expand All @@ -85,3 +87,7 @@
- --html-details
- -r .
- -o build/artifacts/gcov/index.html
:backtrace_settings:
:executable: donotusethis
:optional: TRUE

2 changes: 1 addition & 1 deletion tools/ceedling
Submodule ceedling updated 217 files

0 comments on commit 7d5d3ba

Please sign in to comment.