test_app_main.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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_runner.h"
  8. #include "unity_test_utils.h"
  9. #include "esp_heap_caps.h"
  10. // Some resources are lazy allocated in pulse_cnt driver, the threshold is left for that case
  11. #define TEST_MEMORY_LEAK_THRESHOLD (400)
  12. void setUp(void)
  13. {
  14. unity_utils_record_free_mem();
  15. }
  16. void tearDown(void)
  17. {
  18. esp_reent_cleanup(); //clean up some of the newlib's lazy allocations
  19. unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD);
  20. }
  21. void app_main(void)
  22. {
  23. // ____ _ _ _ ___ ___ _____ _
  24. // | _ \ __ _ _ __ __ _| | | ___| | |_ _/ _ \ |_ _|__ ___| |_
  25. // | |_) / _` | '__/ _` | | |/ _ \ | | | | | | | |/ _ \/ __| __|
  26. // | __/ (_| | | | (_| | | | __/ | | | |_| | | | __/\__ \ |_
  27. // |_| \__,_|_| \__,_|_|_|\___|_| |___\___/ |_|\___||___/\__|
  28. printf(" ____ _ _ _ ___ ___ _____ _\r\n");
  29. printf("| _ \\ __ _ _ __ __ _| | | ___| | |_ _/ _ \\ |_ _|__ ___| |_\r\n");
  30. printf("| |_) / _` | '__/ _` | | |/ _ \\ | | | | | | | |/ _ \\/ __| __|\r\n");
  31. printf("| __/ (_| | | | (_| | | | __/ | | | |_| | | | __/\\__ \\ |_\r\n");
  32. printf("|_| \\__,_|_| \\__,_|_|_|\\___|_| |___\\___/ |_|\\___||___/\\__|\r\n");
  33. unity_run_menu();
  34. }