Skip to content

Commit

Permalink
[test] Add more targets and fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Apr 27, 2019
1 parent b3bb930 commit 1742c55
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ jobs:
command: |
(cd test && make compile-nucleo-f411)
(cd test && make compile-nucleo-f103)
(cd test && make compile-nucleo-l432)
- run:
name: Compile AVR Unittests
command: |
(cd test && make compile-al-avreb-can)
(cd test && make compile-arduino-uno)
(cd test && make compile-arduino-nano)
- run:
name: Linux Examples
command: |
Expand Down
20 changes: 19 additions & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ run-nucleo-f411:
$(call run-test,nucleo-f411,size)


compile-nucleo-l432:
$(call compile-test,nucleo-l432,size)
run-nucleo-l432:
$(call run-test,nucleo-l432,size)


compile-nucleo-f103:
$(call compile-test,nucleo-f103,size)
run-nucleo-f103:
Expand All @@ -49,4 +55,16 @@ run-nucleo-f103:
compile-al-avreb-can:
$(call compile-test,al-avreb-can)
run-al-avreb-can:
$(call run-test,al-avreb-can)
$(call run-test,al-avreb-can)


compile-arduino-uno:
$(call compile-test,arduino-uno)
run-arduino-uno:
$(call run-test,arduino-uno)


compile-arduino-nano:
$(call compile-test,arduino-nano)
run-arduino-nano:
$(call run-test,arduino-nano)
24 changes: 24 additions & 0 deletions test/config/arduino-nano.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version='1.0' encoding='UTF-8'?>
<library>
<extends>modm:arduino-nano</extends>
<options>
<option name="modm:build:scons:info.git">Disabled</option>
<option name="modm:build:avrdude.port">/dev/tty.usbserial-1410</option>
</options>

<modules>
<!-- ATmega328p only has 32kB of Flash -->
<!-- <module>modm-test:test:architecture</module>
<module>modm-test:test:communication</module>
<module>modm-test:test:container</module>
<module>modm-test:test:driver</module>
<module>modm-test:test:stdc++</module> -->

<module>modm-test:test:io</module>
<module>modm-test:test:platform:**</module>
<!-- <module>modm-test:test:processing</module> -->
<module>modm-test:test:ui</module>

<!-- <module>modm-test:test:math</module> -->
</modules>
</library>
27 changes: 27 additions & 0 deletions test/config/arduino-uno.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version='1.0' encoding='UTF-8'?>
<library>
<extends>modm:arduino-uno</extends>
<options>
<option name="modm:build:scons:info.git">Disabled</option>
<option name="modm:build:avrdude.port">/dev/tty.usbserial-1410</option>
<option name="modm:io:with_float">True</option>
<option name="modm:io:with_long_long">True</option>
<option name="modm:io:with_printf">True</option>
</options>

<modules>
<!-- ATmega328p only has 32kB of Flash -->
<!-- <module>modm-test:test:architecture</module>
<module>modm-test:test:communication</module>
<module>modm-test:test:container</module>
<module>modm-test:test:driver</module>
<module>modm-test:test:stdc++</module> -->

<!-- <module>modm-test:test:io</module>
<module>modm-test:test:platform:**</module> -->
<module>modm-test:test:processing</module>
<!-- <module>modm-test:test:ui</module> -->

<!-- <module>modm-test:test:math</module> -->
</modules>
</library>
7 changes: 7 additions & 0 deletions test/config/nucleo-l432.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<library>
<extends>modm:nucleo-l432kc</extends>
<modules>
<module>modm-test:test:**</module>
</modules>
</library>
6 changes: 3 additions & 3 deletions test/modm/math/matrix_vector_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
void
MatrixVectorTest::testMatrixVectorMultiplication()
{
const float_t m[] = {
const float m[] = {
5.,
8.,
-4.,
Expand All @@ -33,13 +33,13 @@ MatrixVectorTest::testMatrixVectorMultiplication()
-2.
};

const float_t v[] = {
const float v[] = {
2.,
-3.,
1.
};

const modm::Matrix<float_t, 3, 3> a(m);
const modm::Matrix<float, 3, 3> a(m);
const modm::Vector3f b(v);

modm::Vector3f c = a * b;
Expand Down
2 changes: 1 addition & 1 deletion test/modm/platform/gpio/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def prepare(module, options):
return True

def build(env):
if not (env.has_module(":board:nucleo-*") or env.has_module(":board:al-avr*")):
if not (env.has_module(":board:nucleo-f*") or env.has_module(":board:al-avr*")):
env.log.warn("GPIO test has been hardcoded to a Nucleo-64 board. "
"When porting make sure this test does not damage your board!")
return
Expand Down
4 changes: 4 additions & 0 deletions test/modm/processing/resumable/resumable_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ MODM_ASSERTION_HANDLER(resumable_test_nesting_handler);
void
ResumableTest::testNesting()
{
#ifdef MODM_CPU_AVR
// this test blows the stack of any AVR :_(
return;
#endif
TestingNestedThread thread;
// sanity checks
TEST_ASSERT_FALSE(thread.isResumableRunning());
Expand Down

0 comments on commit 1742c55

Please sign in to comment.