experimental clang-format ctest

pull/3/head
drowe67 2023-07-14 13:49:19 +09:30 committed by David Rowe
parent fb4547abe6
commit 597e9eb965
3 changed files with 6 additions and 2 deletions

View File

@ -21,7 +21,7 @@ jobs:
shell: bash shell: bash
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install octave octave-common octave-signal liboctave-dev gnuplot sox p7zip-full python3-numpy valgrind sudo apt-get install octave octave-common octave-signal liboctave-dev gnuplot sox p7zip-full python3-numpy valgrind clang-format
- name: Create Build Directory - name: Create Build Directory
shell: bash shell: bash

View File

@ -308,6 +308,10 @@ if(UNITTEST)
include(CTest) include(CTest)
enable_testing() enable_testing()
add_test(NAME test_clang_format
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR};
clang-format --dry-run --Werror src/*.c src/*.h unittest/*.c demo/*.c")
add_test(NAME test_freedv_get_hash add_test(NAME test_freedv_get_hash
COMMAND sh -c "${CMAKE_CURRENT_BINARY_DIR}/unittest/thash") COMMAND sh -c "${CMAKE_CURRENT_BINARY_DIR}/unittest/thash")

View File

@ -113,7 +113,7 @@ CTest is used as a test framework, with support from [GNU Octave](https://www.gn
1. Install GNU Octave and libraries on Ubuntu with: 1. Install GNU Octave and libraries on Ubuntu with:
``` ```
sudo apt install octave octave-common octave-signal liboctave-dev gnuplot python3-numpy sox valgrind sudo apt install octave octave-common octave-signal liboctave-dev gnuplot python3-numpy sox valgrind clang-format
``` ```
1. To build and run the tests: 1. To build and run the tests:
``` ```