Exemplo n.º 1
0
Array<UnitTest*> UnitTest::getTestsInCategory (const String& category)
{
    if (category.isEmpty())
        return getAllTests();

    Array<UnitTest*> unitTests;

    for (auto* test : getAllTests())
        if (test->getCategory() == category)
            unitTests.add (test);

    return unitTests;
}
Exemplo n.º 2
0
UnitTest::UnitTest (String const& className,
                    String const& packageName,
                    When when)
    : m_className (className.removeCharacters (" "))
    , m_packageName (packageName.removeCharacters (" "))
    , m_when (when)
    , m_runner (nullptr)
{
    getAllTests().add (this);
}
Exemplo n.º 3
0
StringArray UnitTest::getAllCategories()
{
    StringArray categories;

    for (auto* test : getAllTests())
        if (test->getCategory().isNotEmpty())
            categories.addIfNotAlreadyThere (test->getCategory());

    return categories;
}
Exemplo n.º 4
0
BEGIN_JUCE_NAMESPACE

#include "juce_UnitTest.h"
#include "../threads/juce_ScopedLock.h"


//==============================================================================
UnitTest::UnitTest (const String& name_)
    : name (name_), runner (0)
{
    getAllTests().add (this);
}
Exemplo n.º 5
0
UnitTest::~UnitTest()
{
    getAllTests().removeFirstMatchingValue (this);
}
Exemplo n.º 6
0
UnitTest::UnitTest (const String& nm)
    : name (nm), runner (nullptr)
{
    getAllTests().add (this);
}
UnitTest::~UnitTest()
{
    getAllTests().removeValue (this);
}
Exemplo n.º 8
0
UnitTest::UnitTest (const String& nm, const String& ctg)
    : name (nm), category (ctg)
{
    getAllTests().add (this);
}