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

Not all EUnit states are managed in ltest listener #49

Open
1 of 4 tasks
oubiwann opened this issue Aug 26, 2016 · 5 comments
Open
1 of 4 tasks

Not all EUnit states are managed in ltest listener #49

oubiwann opened this issue Aug 26, 2016 · 5 comments
Labels

Comments

@oubiwann
Copy link
Member

oubiwann commented Aug 26, 2016

Sadly, EUnit states are undocumented. The source code has to be examined when attempting to create a 100% EUnit compatible test listener.

The following files need to be compared carefully:

With the latter getting updates for the missing (or commented-out) bits. Note that this set of missing functionality dates from the earlier days of ltest (formerly lunit, formerly lfeunit).

Tasks:

  • Handle cancelled tests
  • Add start/2 (not really state management, but we can hit this while we're bringing the rest of ltest_listener into accord with eunit_listener)
  • In handle_begin add another clause like for the undefined description, but for an empty string
  • In handle_end add another clause like for the undefined description, but for an empty string
@oubiwann oubiwann added the bug label Aug 26, 2016
@yurrriq
Copy link
Member

yurrriq commented Aug 26, 2016

Note that there are some breaking changes between 17.x and 18.x.

@rvirding
Copy link
Contributor

rvirding commented Aug 26, 2016

Could you rewrite it so that ltest-listener calls eunit_listener? If that works then you might become more future safe. I managed to do that for the QLC handling.

@oubiwann
Copy link
Member Author

@rvirding Do you have some code I can look at? (I didn't see anything like this in lfe_qlc.erl). It's not immediately obvious to me how to do that, since it's eunit_listener.erls callbacks I need to override ... (eunit_listener is a behaviour that I'm implementing against). When I first wrote this (a few years ago), the start function was the only one I could call back to cleanly :-/

Maybe there's a different way to do this?

@erlanger
Copy link

@oubiwann do you mean to compare with eunit_tty.erl ? That is the file that implements the behaviour. eunit_listener is the module that defines the behaviour.

Maybe this is what made rvirding think you could just reuse eunit_listener.

@rvirding
Copy link
Contributor

rvirding commented Aug 27, 2016

@oubiwann the new lfe_qlc.erl in the develop branch now does some cunning calls into the standard qlc modules instead of copying the module so it could add some new interfaces.

After a quick peek at ltest_listener and eunit_listener they looked similar so I just wondered if it was possible to do the same thing. I have not inspected them enough to really check if this is possible. Could they do the same thing? Should they do the same thing?

Do they implement the behaviour or are they the call back modules?

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

No branches or pull requests

4 participants