test_app_main.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include "unity.h"
  7. #include "unity_test_utils.h"
  8. #include "esp_heap_caps.h"
  9. // Some resources are lazy allocated in LEDC driver, the threshold is left for that case
  10. #define TEST_MEMORY_LEAK_THRESHOLD (230)
  11. void setUp(void)
  12. {
  13. unity_utils_record_free_mem();
  14. }
  15. void tearDown(void)
  16. {
  17. esp_reent_cleanup(); //clean up some of the newlib's lazy allocations
  18. unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD);
  19. }
  20. void app_main(void)
  21. {
  22. // _____ _ _ _____ ____ ____
  23. // |_ _|__ ___| |_ | | | ____| _ \ / ___|
  24. // | |/ _ \/ __| __| | | | _| | | | | |
  25. // | | __/\__ \ |_ | |___| |___| |_| | |___
  26. // |_|\___||___/\__| |_____|_____|____/ \____|
  27. printf("\n");
  28. printf(" _____ _ _ _____ ____ ____ \n");
  29. printf(" |_ _|__ ___| |_ | | | ____| _ \\ / ___|\n");
  30. printf(" | |/ _ \\/ __| __| | | | _| | | | | | \n");
  31. printf(" | | __/\\__ \\ |_ | |___| |___| |_| | |___ \n");
  32. printf(" |_|\\___||___/\\__| |_____|_____|____/ \\____|\n");
  33. unity_run_menu();
  34. }