Skip to content

Commit

Permalink
Remove ifdef guards around unit and HIL tests.
Browse files Browse the repository at this point in the history
These guards were our way of getting around the contents of these files being
included in note-arduino builds. With this commit, we're getting rid of them.
Instead, in note-arduino when we include note-c, we'll remove the test
subdirectory all together. Then these files aren't even there to begin with,
so they can't mess up the note-arduino build.
  • Loading branch information
haydenroche5 committed Jan 8, 2024
1 parent 04fb1fa commit 697eb2f
Show file tree
Hide file tree
Showing 118 changed files with 216 additions and 238 deletions.
4 changes: 1 addition & 3 deletions test/hitl/card.binary/lib/notecard_binary/NotecardBinary.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#ifdef PLATFORMIO

#include "NotecardBinary.h"

Notecard notecard;
Expand All @@ -14,4 +12,4 @@ BufferBinaryGenerator small_image(small_binary);
// ensure the virtual destructor is defined.
BinaryGenerator::~BinaryGenerator() {}

#endif // PLATFORMIO

3 changes: 1 addition & 2 deletions test/hitl/card.binary/lib/notecard_binary/NotecardBinary.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#ifdef PLATFORMIO

#pragma once

Expand Down Expand Up @@ -1185,4 +1184,4 @@ class NoteAddHandler : public FileHandler
extern BinaryImage small_binary;
extern BufferBinaryGenerator small_image;

#endif // PLATFORMIO

3 changes: 1 addition & 2 deletions test/hitl/card.binary/lib/notecard_binary/NotecardComms.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#ifdef PLATFORMIO

#include "NotecardComms.h"
#include <Arduino.h>
Expand Down Expand Up @@ -144,4 +143,4 @@ 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

#endif // PLATFORMIO

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

#pragma once

Expand Down Expand Up @@ -48,4 +47,4 @@ bool set_aux_serial_baudrate(size_t baudrate=NOTECARD_IF_AUX_SERIAL_BAUDRATE, No

extern Notecard notecard;

#endif // PLATFORMIO

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

#include "small_img.h"

Expand Down Expand Up @@ -4919,4 +4918,4 @@ const uint8_t small_img_map[] = {
};
size_t small_img_len = 73687;

#endif // PLATFORMIO

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

#pragma once

Expand All @@ -8,4 +7,4 @@
extern const uint8_t small_img_map[];
extern size_t small_img_len;

#endif // PLATFORMIO

3 changes: 1 addition & 2 deletions test/hitl/card.binary/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#ifdef PLATFORMIO

#include "NotecardBinary.h"

Expand All @@ -17,4 +16,4 @@ void loop()

}

#endif // PLATFORMIO

3 changes: 1 addition & 2 deletions test/hitl/card.binary/test/test_binary_generators.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#ifdef PLATFORMIO

#include "NotecardBinary.h"
#include <Arduino.h>
Expand Down Expand Up @@ -89,4 +88,4 @@ void testsuite_binary_generators()
RUN_TEST(test_random_generator);
}

#endif // PLATFORMIO

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

#pragma once
#include "NotecardBinary.h"
Expand Down Expand Up @@ -60,4 +59,4 @@ struct BuildRandom {
}
};

#endif // PLATFORMIO

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

#include "NotecardBinary.h"
#include "NotecardComms.h"
Expand Down Expand Up @@ -473,4 +472,4 @@ void testsuite_card_binary()
RUN_FILTER(test_max_length_serial);
}

#endif // PLATFORMIO

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

void testsuite_card_binary();

#endif // PLATFORMIO

3 changes: 1 addition & 2 deletions test/hitl/card.binary/test/test_main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#ifdef PLATFORMIO

#include "test_card_binary.h"
#include "test_binary_generators.h"
Expand Down Expand Up @@ -37,4 +36,4 @@ void loop()
// #error serial buffer is too small
// #endif

#endif // PLATFORMIO

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

#include "test_unity_util.h"
#include <string.h>
Expand Down Expand Up @@ -35,4 +34,4 @@ bool filterTest(const char* name)
return true;
}

#endif // PLATFORMIO

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

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

#endif // PLATFORMIO

4 changes: 2 additions & 2 deletions test/src/JAddBinaryToObject_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>
#include "fff.h"
Expand Down Expand Up @@ -83,4 +83,4 @@ SCENARIO("JAddBinaryToObject")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JAllocString_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>
#include "fff.h"
Expand Down Expand Up @@ -59,4 +59,4 @@ SCENARIO("JAllocString")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JAtoI_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -58,4 +58,4 @@ SCENARIO("JAtoI")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JBoolValue_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -50,4 +50,4 @@ SCENARIO("JBoolValue")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JContainsString_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -68,4 +68,4 @@ SCENARIO("JContainsString")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetArray_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -53,4 +53,4 @@ SCENARIO("JGetArray")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetBinaryFromObject_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>
#include "fff.h"
Expand Down Expand Up @@ -80,4 +80,4 @@ SCENARIO("JGetBinaryFromObject")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetBool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -53,4 +53,4 @@ SCENARIO("JGetBool")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetInt_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -53,4 +53,4 @@ SCENARIO("JGetInt")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetItemName_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -47,4 +47,4 @@ SCENARIO("JGetItemName")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetNumber_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -53,4 +53,4 @@ SCENARIO("JGetNumber")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetObject_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -53,4 +53,4 @@ SCENARIO("JGetObject")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetString_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -66,4 +66,4 @@ SCENARIO("JGetString")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JGetType_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -158,4 +158,4 @@ SCENARIO("JGetType")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JIntValue_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -46,4 +46,4 @@ SCENARIO("JIntValue")

}

#endif // NOTE_C_TEST

4 changes: 2 additions & 2 deletions test/src/JIsExactString_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

#ifdef NOTE_C_TEST


#include <catch2/catch_test_macros.hpp>

Expand Down Expand Up @@ -71,4 +71,4 @@ SCENARIO("JIsExactString")

}

#endif // NOTE_C_TEST

Loading

0 comments on commit 697eb2f

Please sign in to comment.