GithubHelp home page GithubHelp logo

yaochenger / anv_testsuit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wuhanstudio/anv_testsuit

0.0 0.0 0.0 3 KB

RT-Thread 测试套件软件包

Home Page: https://github.com/anvouk/anv

Python 7.00% C 93.00%

anv_testsuit's Introduction

anv_testsuit

RT-Thread 单元测试框架

#include <rtthread.h>
#include "anv_testsuite.h"

ANV_TESTSUITE_FIXTURE(test_group_1_fixture_1)
{
    int a = 10;
    expect(a == 10);

    int b = 13;
    expect(a == b);
}

ANV_TESTSUITE_FIXTURE(test_group_1_fixture_2)
{

}

ANV_TESTSUITE_FIXTURE(test_group_1_fixture_3)
{
    expect_msg(0, "rip");
}

ANV_TESTSUITE(test_group_1,
    ANV_TESTSUITE_ADD(test_group_1_fixture_1),
    ANV_TESTSUITE_ADD(test_group_1_fixture_2),
    ANV_TESTSUITE_ADD(test_group_1_fixture_3),
);

ANV_TESTSUITE_FIXTURE(test_group_2_fixture_1)
{

}

ANV_TESTSUITE(test_group_2,
    ANV_TESTSUITE_ADD(test_group_2_fixture_1),
);

int anv_testsuit_example(int argc, char const *argv[])
{
    ANV_TESTSUITE_BEGIN(stdout);    // optional
    ANV_TESTSUITE_RUN(test_group_1, stdout);
    ANV_TESTSUITE_RUN(test_group_2, stdout);
    ANV_TESTSUITE_END(stdout);      // optional
  return 0;
}

可以对测试进行分组,查看每个分组的测试结果:

 \ | /
- RT -     Thread Operating System
 / | \     4.0.3 build Feb 11 2021
 2006 - 2021 Copyright by rt-thread team
msh />anv
anv_testsuit_example
msh />anv_testsuit_example
==== BEGIN RUNNING TESTS ====
---- BEGIN TEST SUITE: test_group_1 ----

[0] test_group_1_fixture_1         => FAILURE(10): 'a == b'
[1] test_group_1_fixture_2         => SUCCESS
[2] test_group_1_fixture_3         => FAILURE(20): '0' (rip)

SUCCESS: 1/3

---- END TEST SUITE: test_group_1 ----
---- BEGIN TEST SUITE: test_group_2 ----

[0] test_group_2_fixture_1         => SUCCESS

SUCCESS: 1/1

---- END TEST SUITE: test_group_2 ----
==== END RUNNING TESTS ====

anv_testsuit's People

Contributors

wuhanstudio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.