Skip to content

Embedded Test Framework is a FREE and open-source embedded unit test framework for microcontrollers.

License

Notifications You must be signed in to change notification settings

mytechnotalent/ETF

Repository files navigation

image

FREE Reverse Engineering Self-Study Course HERE


ETF

Embedded Test Framework is a FREE and open-source embedded unit test framework for microcontrollers.


Usage

If the RUN_TESTS 1 configuration within main.c exists it will run the tests otherwise you can set to 0 in prod.

main.c

/**
 * MIT License
 * 
 * Copyright (c) 2023 My Techno Talent
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
*/

#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"

#include "test_addition.c"

#define RUN_TESTS 1

int main(void) {
    stdio_init_all();

    #if RUN_TESTS
        test_add_integers_valid();
        test_add_integers_invalid();
    #else
        while (true) {}
    #endif
}

Result

PASS: test_add_integers_valid
PASS: test_add_integers_invalid

UNDER DEVELOPMENT...


License

MIT