<div class="gmail_quote">2012/2/8 Milian Wolff <span dir="ltr"><<a href="mailto:mail@milianw.de">mail@milianw.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Aleix Pol, <a href="tel:08.02.2012" value="+3868022012">08.02.2012</a>:<br>
<div class="im">> On Wed, Feb 8, 2012 at 5:23 PM, Miha Čančula <<a href="mailto:miha@noughmad.eu">miha@noughmad.eu</a>> wrote:<br>
> > 2012/2/8 Aleix Pol <<a href="mailto:aleixpol@kde.org">aleixpol@kde.org</a>><br>
<br>
</div><snip><br>
<div class="im"><br>
> >> To extract the information, the view plugin will load all the plugins<br>
> >> that implement the UnitTestProvider interface and ask for the provided<br>
> >> information. Here's some rough idea of what I think this interface<br>
> >> might have looked like.<br>
> >><br>
> >> class Test {<br>
> >>   QString executable(); //maybe a launcher?<br>
> >>   QMap<QString, QStringList> cases(); //test name with the arguments<br>
> >> to pass to the execution<br>
> >> };<br>
> >><br>
> >> class IUnitTestProvider {<br>
> >>    virtual QMap<KUrl, Test> retrieveTests() = 0;<br>
> >> };<br>
> ><br>
> > This is basically what I had in mind, except for the tree structure (and<br>
> > asynchronous operation, and checking whether this particular provider is<br>
> > the right one for a project). My question is where to put the Test<br>
> > class. It's possible to avoid it altogether by replacing it with a<br>
> > QPair<QString, QStringList> or something even more convoluted, but that<br>
> > looks ugly. On the other hand, an ugly typedef is still better than a<br>
> > whole separate library.<br>
><br>
> It has to be together with the interface, because the interface<br>
> depends on it. I think it's fine if it's inside interfaces.<br>
<br>
</div>Just make it a pure abstract interface as well.<br>
<br>
namespace KDevelop {<br>
class ITestSuite<br>
{<br>
  ILaunchConfiguration* launcherForAllCases() const  = 0;<br>
  ILaunchConfiguration* launcherForCase(const QString& case) const  = 0;<br>
  ILaunchConfiguration* launcherForCases(const QStringList& cases) const  = 0;<br>
<br>
  QStringList cases() const = 0;<br>
<br>
  KUrl url() const = 0;<br>
};<br>
}<br>
Q_DECLARE_INTERFACE(KDevelop::ITest)<br></blockquote><div>This looks clean, but I think at least the data members (list of cases, url, name) don't have to be virtual.  <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
And personally, I would rather create a test controller where unit test suites<br>
can be added/removed. I.e.:<br>
<br>
class ITestController<br>
{<br>
  void addTestSuite(ITestSuite* suite);<br>
  void removeTestSuite(ITestSuite* suite);<br>
};<br>
<br>
This way plugins can easily add test suites by just implementing a ITestSuite<br>
class and registering it at the controller.<br></blockquote><div>So you want global testproviders to be global plugins with no interface that float around, look for tests and report them? Sounds simple enough on the plugin side, but isn't that a slight waste of resources? And the controller would have to be globally accessible, in shell perhaps?<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
something like that.<br></blockquote><div>Well, I started writing code with something like that.  <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
cheers<br>
<div class="HOEnZb"><div class="h5">--<br>
Milian Wolff<br>
<a href="mailto:mail@milianw.de">mail@milianw.de</a><br>
<a href="http://milianw.de" target="_blank">http://milianw.de</a><br>
</div></div><br>--<br>
KDevelop-devel mailing list<br>
<a href="mailto:KDevelop-devel@kdevelop.org">KDevelop-devel@kdevelop.org</a><br>
<a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel" target="_blank">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel</a><br>
<br></blockquote></div><br>