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
51
tests/device/libraries/BSTest/test/test.cpp
Normal file
51
tests/device/libraries/BSTest/test/test.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
#include "BSTest.h"
|
||||
#include <stdio.h>
|
||||
|
||||
BS_ENV_DECLARE();
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
while(true) {
|
||||
try{
|
||||
BS_RUN();
|
||||
return 0;
|
||||
}catch(...) {
|
||||
printf("Exception\n\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("this test runs successfully", "[bluesmoke]")
|
||||
{
|
||||
CHECK(1 + 1 == 2);
|
||||
REQUIRE(2 * 2 == 4);
|
||||
}
|
||||
|
||||
TEST_CASE("another test which fails", "[bluesmoke][fail]")
|
||||
{
|
||||
CHECK(true);
|
||||
CHECK(false);
|
||||
CHECK(true);
|
||||
CHECK(false);
|
||||
}
|
||||
|
||||
TEST_CASE("another test which fails and crashes", "[bluesmoke][fail]")
|
||||
{
|
||||
CHECK(true);
|
||||
REQUIRE(false);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("third test which should be skipped", "[.]")
|
||||
{
|
||||
FAIL();
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("this test also runs successfully", "[bluesmoke]")
|
||||
{
|
||||
|
||||
}
|
Reference in New Issue
Block a user