; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

;[platformio]
;default_envs = esp8266

[common]
build_flags =
  -D DEBUG_ESP_MQTT_CLIENT=1
  -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
  -Wall
  -Wextra
  -std=c++11
  -pthread
  -ggdb3

[env:native]
platform = native
test_build_src = yes
build_flags =
  ${common.build_flags}
  -lgcov
  --coverage
  -D EMC_RX_BUFFER_SIZE=100
  -D EMC_TX_BUFFER_SIZE=10
  -D EMC_MULTIPLE_CALLBACKS=1
  -D EMC_USE_MEMPOOL=1
;extra_scripts = test-coverage.py
build_type = debug
test_testing_command =
  valgrind
  --leak-check=full
  --show-leak-kinds=all
  --track-origins=yes
  --error-exitcode=1
  ${platformio.build_dir}/${this.__env__}/program
