Skip to content

Commit

Permalink
Play nice with note-arduino CI (#128)
Browse files Browse the repository at this point in the history
* Play nice with `note-arduino` CI

* switch to PLATFORMIO
  • Loading branch information
zfields authored Dec 21, 2023
1 parent fe9aa95 commit 434b50d
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 8 deletions.
4 changes: 4 additions & 0 deletions test/hitl/card.binary/lib/notecard_binary/NotecardBinary.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#include "NotecardBinary.h"

Notecard notecard;
Expand All @@ -11,3 +13,5 @@ BufferBinaryGenerator small_image(small_binary);

// ensure the virtual destructor is defined.
BinaryGenerator::~BinaryGenerator() {}

#endif // PLATFORMIO
6 changes: 5 additions & 1 deletion test/hitl/card.binary/lib/notecard_binary/NotecardBinary.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#pragma once

#include <Arduino.h>
Expand Down Expand Up @@ -1181,4 +1183,6 @@ class NoteAddHandler : public FileHandler
};

extern BinaryImage small_binary;
extern BufferBinaryGenerator small_image;
extern BufferBinaryGenerator small_image;

#endif // PLATFORMIO
6 changes: 5 additions & 1 deletion test/hitl/card.binary/lib/notecard_binary/NotecardComms.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#include "NotecardComms.h"
#include <Arduino.h>

Expand Down Expand Up @@ -140,4 +142,6 @@ size_t readDataUntilTimeout(Stream& serial, size_t timeout, uint8_t* buf, size_t


HardwareSerial Serial2(A0,A3);
HardwareSerial Serial3(A5,A4); // A5 is RX, A4 is TX
HardwareSerial Serial3(A5,A4); // A5 is RX, A4 is TX

#endif // PLATFORMIO
3 changes: 3 additions & 0 deletions test/hitl/card.binary/lib/notecard_binary/NotecardComms.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#pragma once

#include <Notecard.h>
Expand Down Expand Up @@ -46,3 +48,4 @@ bool set_aux_serial_baudrate(size_t baudrate=NOTECARD_IF_AUX_SERIAL_BAUDRATE, No

extern Notecard notecard;

#endif // PLATFORMIO
4 changes: 4 additions & 0 deletions test/hitl/card.binary/lib/notecard_binary/small_img.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#include "small_img.h"

const uint8_t small_img_map[] = {
Expand Down Expand Up @@ -4916,3 +4918,5 @@ const uint8_t small_img_map[] = {
0x00, 0x28, 0xa2, 0x8a, 0x00, 0xff, 0xd9
};
size_t small_img_len = 73687;

#endif // PLATFORMIO
3 changes: 3 additions & 0 deletions test/hitl/card.binary/lib/notecard_binary/small_img.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#pragma once

#include <cstddef>
Expand All @@ -6,3 +8,4 @@
extern const uint8_t small_img_map[];
extern size_t small_img_len;

#endif // PLATFORMIO
7 changes: 5 additions & 2 deletions test/hitl/card.binary/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "NotecardBinary.h"
#ifdef PLATFORMIO

#include "NotecardBinary.h"

void setup()
{
Expand All @@ -14,4 +15,6 @@ void showHelp()
void loop()
{

}
}

#endif // PLATFORMIO
6 changes: 5 additions & 1 deletion test/hitl/card.binary/test/test_binary_generators.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#include "NotecardBinary.h"
#include <Arduino.h>
#include "test_binary_generators.h"
Expand Down Expand Up @@ -85,4 +87,6 @@ void testsuite_binary_generators()
TEST_SUITE(binary_generators);
RUN_TEST(test_fixed_value_generator);
RUN_TEST(test_random_generator);
}
}

#endif // PLATFORMIO
3 changes: 3 additions & 0 deletions test/hitl/card.binary/test/test_binary_generators.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#pragma once
#include "NotecardBinary.h"

Expand Down Expand Up @@ -58,3 +60,4 @@ struct BuildRandom {
}
};

#endif // PLATFORMIO
3 changes: 3 additions & 0 deletions test/hitl/card.binary/test/test_card_binary.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#ifdef PLATFORMIO

#include "NotecardBinary.h"
#include "NotecardComms.h"
Expand Down Expand Up @@ -471,3 +472,5 @@ void testsuite_card_binary()
RUN_FILTER(test_max_length_aux_serial);
RUN_FILTER(test_max_length_serial);
}

#endif // PLATFORMIO
5 changes: 4 additions & 1 deletion test/hitl/card.binary/test/test_card_binary.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#ifdef PLATFORMIO

void testsuite_card_binary();
void testsuite_card_binary();

#endif // PLATFORMIO
6 changes: 5 additions & 1 deletion test/hitl/card.binary/test/test_main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#include "test_card_binary.h"
#include "test_binary_generators.h"
#include "test_unity_util.h"
Expand Down Expand Up @@ -33,4 +35,6 @@ void loop()

// #if SERIAL_RX_BUFFER_SIZE!=16384
// #error serial buffer is too small
// #endif
// #endif

#endif // PLATFORMIO
6 changes: 5 additions & 1 deletion test/hitl/card.binary/test/test_unity_util.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef PLATFORMIO

#include "test_unity_util.h"
#include <string.h>

Expand Down Expand Up @@ -31,4 +33,6 @@ bool filterTest(const char* name)
return test_suite_filter(name);
}
return true;
}
}

#endif // PLATFORMIO
2 changes: 2 additions & 0 deletions test/hitl/card.binary/test/test_unity_util.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#ifdef PLATFORMIO

// This also needs to be added to build_flags in platformio.ini
#ifndef UNITY_INCLUDE_PRINT_FORMATTED
Expand Down Expand Up @@ -31,3 +32,4 @@ extern bool filterTest(const char* name);
RUN_TEST(func); \
}

#endif // PLATFORMIO

0 comments on commit 434b50d

Please sign in to comment.