1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-29 05:21:37 +03:00

Device side test library and test runner

This commit is contained in:
Ivan Grokhotkov
2016-03-10 09:12:11 +03:00
committed by Ivan Grokhotkov
parent 33723a9b52
commit ab7af89002
26 changed files with 1118 additions and 206 deletions

View File

@ -0,0 +1,38 @@
#include <BSTest.h>
BS_ENV_DECLARE();
ADC_MODE(ADC_VCC);
RF_MODE(RF_CAL);
static int rf_pre_init_flag = 0;
RF_PRE_INIT()
{
rf_pre_init_flag = 42;
}
static unsigned setup_micros;
void setup()
{
setup_micros = micros();
Serial.begin(115200);
BS_RUN(Serial);
}
TEST_CASE("ADC_MODE override works", "[core]")
{
auto vcc = ESP.getVcc();
Serial.printf("VCC: %d\r\n", vcc);
Serial.printf("A0: %d\r\n", analogRead(A0));
CHECK(vcc > 3000 && vcc < 3600);
}
TEST_CASE("RF_PRE_INIT override works", "[core]")
{
CHECK(rf_pre_init_flag == 42);
}
void loop()
{
}