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:
committed by
Ivan Grokhotkov
parent
33723a9b52
commit
ab7af89002
38
tests/device/test_overrides/test_overrides.ino
Normal file
38
tests/device/test_overrides/test_overrides.ino
Normal 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()
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user