Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #2

Open
mrdimfox opened this issue Nov 23, 2018 · 2 comments
Open

Documentation #2

mrdimfox opened this issue Nov 23, 2018 · 2 comments

Comments

@mrdimfox
Copy link

mrdimfox commented Nov 23, 2018

I love your test util. It looks very great. But I have no idea how to use it! Can you write some docs, not only about a compiling but using the library for a testing?

For example, I want to redirect an output from stdout to ITM (it is much faster than a semihosting). How can I do it? Can I implement my own "TestWriter" or something? How can I pass it as an argument to TestRunner?

@mmwebster
Copy link

Not sure if you're still interested but you can implement something like this for a custom writer. My full source is here.

class UartWriter final : public utest::TestWriter {
  public:
    UartWriter(cal::Uart* uart) noexcept;

  private:
    virtual void write(const utest::TestString& str) noexcept override;

    virtual void color(utest::TestColor c) noexcept override;

    cal::Uart* m_uart;
};

I'm running into an issue though where my tests are run twice.

@mrdimfox
Copy link
Author

mrdimfox commented Apr 1, 2019

@mmwebster Hmm. Yes, thank you! That looks like exactly I want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants