-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This is the project CMakeLists.txt file for the test subproject | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
# Add newly added components to one of these lines: | ||
# 1. Add here if the component is compatible with IDF >= v4.3 | ||
set(EXTRA_COMPONENT_DIRS "../../") | ||
|
||
set(TEST_COMPONENTS "epdiy") | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(epdiy_testrunner) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
idf_component_register(SRCS "main.c" INCLUDE_DIRS ".") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stdio.h> | ||
#include <unity.h> | ||
|
||
static void print_banner(const char* text) | ||
{ | ||
printf("\n#### %s #####\n\n", text); | ||
} | ||
|
||
|
||
void app_main(void) | ||
{ | ||
print_banner("Running all the registered tests"); | ||
UNITY_BEGIN(); | ||
unity_run_all_tests(); | ||
UNITY_END(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
idf_component_register(SRC_DIRS "." | ||
INCLUDE_DIRS "." | ||
REQUIRES unity epdiy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include <unity.h> | ||
#include "freertos/FreeRTOS.h" | ||
#include "freertos/task.h" | ||
|
||
#include "epd_board.h" | ||
#include "epdiy.h" | ||
#include "epd_display.h" | ||
|
||
TEST_CASE("Mean of an empty array is zero", "[mean]") | ||
{ | ||
const int values[] = { 0 }; | ||
TEST_ASSERT_EQUAL(1, 1); | ||
} | ||
|
||
TEST_CASE("V7 initialization and deinitialization works", "[epdiy]") | ||
{ | ||
epd_init(&epd_board_v7, &ED097TC2, EPD_OPTIONS_DEFAULT); | ||
|
||
epd_poweron(); | ||
vTaskDelay(2); | ||
epd_poweroff(); | ||
|
||
epd_deinit(); | ||
} | ||
|
||
TEST_CASE("V7 re-initialization works", "[epdiy]") | ||
{ | ||
epd_init(&epd_board_v7, &ED097TC2, EPD_OPTIONS_DEFAULT); | ||
|
||
epd_poweron(); | ||
vTaskDelay(2); | ||
epd_poweroff(); | ||
|
||
epd_deinit(); | ||
|
||
epd_init(&epd_board_v7, &ED097TC2, EPD_OPTIONS_DEFAULT); | ||
|
||
epd_poweron(); | ||
vTaskDelay(2); | ||
epd_poweroff(); | ||
|
||
epd_deinit(); | ||
} |