Skip to content

Commit

Permalink
Remove duplicate unit tests from libopeninv
Browse files Browse the repository at this point in the history
As libopeninv now has unit tests remove the
duplicates.

Update the Makefile and Code::Blocks project to
reference the new libopeninv tests and add missing
files.

Update the GitHub Action workflow to run both sets
of tests.
  • Loading branch information
davefiddes committed Oct 6, 2024
1 parent 1b43e4c commit 3eb291c
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 900 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/CI-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ jobs:

- name: Build unit tests on host
run: |
make -C test
make Test
- name: Run unit tests on host
- name: Run stm32-sine unit tests on host
run: |
test/test_sine
- name: Run libopeninv unit tests on host
run: |
libopeninv/test/test_libopeninv
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ get-deps:
$(Q)${MAKE} -C libopencm3

Test:
cd test && $(MAKE)
$(MAKE) -C test
$(MAKE) -C libopeninv/test
cleanTest:
cd test && $(MAKE) clean
$(MAKE) -C test clean
$(MAKE) -C libopeninv/test clean
55 changes: 55 additions & 0 deletions sinus.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
<Add directory="include" />
</Compiler>
</Target>
<Target title="Test libopeninv">
<Option output="libopeninv/test/test_libopeninv" prefix_auto="1" extension_auto="1" />
<Option working_dir="libopeninv/test" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add directory="include" />
</Compiler>
</Target>
</Build>
<Unit filename="Makefile">
<Option target="SlipControl" />
Expand All @@ -77,6 +86,7 @@
<Unit filename="libopeninv/include/anain.h" />
<Unit filename="libopeninv/include/canhardware.h" />
<Unit filename="libopeninv/include/canmap.h" />
<Unit filename="libopeninv/include/canobd2.h" />
<Unit filename="libopeninv/include/cansdo.h" />
<Unit filename="libopeninv/include/crc8.h" />
<Unit filename="libopeninv/include/delay.h" />
Expand All @@ -101,6 +111,7 @@
<Unit filename="libopeninv/src/anain.cpp" />
<Unit filename="libopeninv/src/canhardware.cpp" />
<Unit filename="libopeninv/src/canmap.cpp" />
<Unit filename="libopeninv/src/canobd2.cpp" />
<Unit filename="libopeninv/src/cansdo.cpp" />
<Unit filename="libopeninv/src/crc8.cpp" />
<Unit filename="libopeninv/src/digio.cpp" />
Expand All @@ -125,6 +136,40 @@
<Unit filename="libopeninv/src/stm32scheduler.cpp" />
<Unit filename="libopeninv/src/terminal.cpp" />
<Unit filename="libopeninv/src/terminalcommands.cpp" />
<Unit filename="libopeninv/test/Makefile">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/stub_canhardware.cpp">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/stub_canhardware.h">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/stub_libopencm3.c">
<Option compilerVar="CC" />
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/test-include/hwdefs.h">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/test-include/param_prj.h">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/test.h">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/test_canmap.cpp">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/test_fp.cpp">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/test_fu.cpp">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="libopeninv/test/test_main.cpp">
<Option target="Test libopeninv" />
</Unit>
<Unit filename="src/hwinit.cpp" />
<Unit filename="src/inc_encoder.cpp" />
<Unit filename="src/pwmgeneration-foc.cpp" />
Expand All @@ -142,6 +187,16 @@
<Unit filename="test/Makefile">
<Option target="Test" />
</Unit>
<Unit filename="test/stub_canhardware.cpp">
<Option target="Test" />
</Unit>
<Unit filename="test/stub_canhardware.h">
<Option target="Test" />
</Unit>
<Unit filename="test/stub_libopencm3.c">
<Option compilerVar="CC" />
<Option target="Test" />
</Unit>
<Unit filename="test/test.h">
<Option target="Test" />
</Unit>
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CPPFLAGS = -ggdb -DSTM32F1 -DCTRL_FOC=1 -DCTRL_SINE=0 -DCTRL=CTRL_FOC -I../in
LDFLAGS = -g
BINARY = test_sine
OBJS = test_main.o fu.o test_fu.o test_fp.o test_vcu.o my_fp.o my_string.o params.o vehiclecontrol.o \
test_throttle.o throttle.o sine_core.o temp_meas.o stub_canhardware.o test_canmap.o canmap.o \
test_throttle.o throttle.o sine_core.o temp_meas.o stub_canhardware.o \
stub_libopencm3.o
VPATH = ../src ../libopeninv/src

Expand Down
Loading

0 comments on commit 3eb291c

Please sign in to comment.