Browse Source

MagnumFont{,Converter}: these tests also need GL, set GLTest suffix.

pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
ce470aede7
  1. 2
      src/Plugins/MagnumFont/Test/CMakeLists.txt
  2. 20
      src/Plugins/MagnumFont/Test/MagnumFontGLTest.cpp
  3. 2
      src/Plugins/MagnumFontConverter/Test/CMakeLists.txt
  4. 12
      src/Plugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp

2
src/Plugins/MagnumFont/Test/CMakeLists.txt

@ -27,4 +27,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumFontTestConfigure.h.cmake
include_directories(${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(MagnumFontTest MagnumFontTest.cpp LIBRARIES MagnumFontTestLib ${GL_TEST_LIBRARIES})
corrade_add_test(MagnumFontGLTest MagnumFontGLTest.cpp LIBRARIES MagnumFontTestLib ${GL_TEST_LIBRARIES})

20
src/Plugins/MagnumFont/Test/MagnumFontTest.cpp → src/Plugins/MagnumFont/Test/MagnumFontGLTest.cpp

@ -32,22 +32,22 @@
namespace Magnum { namespace Text { namespace Test {
class MagnumFontTest: public Magnum::Test::AbstractOpenGLTester {
class MagnumFontGLTest: public Magnum::Test::AbstractOpenGLTester {
public:
explicit MagnumFontTest();
explicit MagnumFontGLTest();
void properties();
void layout();
void createGlyphCache();
};
MagnumFontTest::MagnumFontTest() {
addTests({&MagnumFontTest::properties,
&MagnumFontTest::layout,
&MagnumFontTest::createGlyphCache});
MagnumFontGLTest::MagnumFontGLTest() {
addTests({&MagnumFontGLTest::properties,
&MagnumFontGLTest::layout,
&MagnumFontGLTest::createGlyphCache});
}
void MagnumFontTest::properties() {
void MagnumFontGLTest::properties() {
MagnumFont font;
CORRADE_VERIFY(font.openFile(Utility::Directory::join(MAGNUMFONT_TEST_DIR, "font.conf"), 0.0f));
CORRADE_COMPARE(font.size(), 16.0f);
@ -55,7 +55,7 @@ void MagnumFontTest::properties() {
CORRADE_COMPARE(font.glyphAdvance(font.glyphId(U'W')), Vector2(23.0f, 0.0f));
}
void MagnumFontTest::layout() {
void MagnumFontGLTest::layout() {
MagnumFont font;
CORRADE_VERIFY(font.openFile(Utility::Directory::join(MAGNUMFONT_TEST_DIR, "font.conf"), 0.0f));
@ -98,11 +98,11 @@ void MagnumFontTest::layout() {
CORRADE_COMPARE(cursorPosition, Vector2(0.375f, 0.0f));
}
void MagnumFontTest::createGlyphCache() {
void MagnumFontGLTest::createGlyphCache() {
/** @todo */
CORRADE_SKIP("Not yet implemented");
}
}}}
CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontTest)
CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontGLTest)

2
src/Plugins/MagnumFontConverter/Test/CMakeLists.txt

@ -28,7 +28,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumFontConverterTestConfigure.h.cm
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../../MagnumFont/Test/
${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(MagnumFontConverterTest MagnumFontConverterTest.cpp LIBRARIES
corrade_add_test(MagnumFontConverterGLTest MagnumFontConverterGLTest.cpp LIBRARIES
MagnumFontConverterTestLib
TgaImporterTestLib
${GL_TEST_LIBRARIES})

12
src/Plugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp → src/Plugins/MagnumFontConverter/Test/MagnumFontConverterGLTest.cpp

@ -41,18 +41,18 @@
namespace Magnum { namespace Text { namespace Test {
class MagnumFontConverterTest: public Magnum::Test::AbstractOpenGLTester {
class MagnumFontConverterGLTest: public Magnum::Test::AbstractOpenGLTester {
public:
explicit MagnumFontConverterTest();
explicit MagnumFontConverterGLTest();
void exportFont();
};
MagnumFontConverterTest::MagnumFontConverterTest() {
addTests({&MagnumFontConverterTest::exportFont});
MagnumFontConverterGLTest::MagnumFontConverterGLTest() {
addTests({&MagnumFontConverterGLTest::exportFont});
}
void MagnumFontConverterTest::exportFont() {
void MagnumFontConverterGLTest::exportFont() {
/* Remove previously created files */
Utility::Directory::rm(Utility::Directory::join(MAGNUMFONTCONVERTER_TEST_WRITE_DIR, "font.conf"));
Utility::Directory::rm(Utility::Directory::join(MAGNUMFONTCONVERTER_TEST_WRITE_DIR, "font.tga"));
@ -123,4 +123,4 @@ void MagnumFontConverterTest::exportFont() {
}}}
CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontConverterTest)
CORRADE_TEST_MAIN(Magnum::Text::Test::MagnumFontConverterGLTest)
Loading…
Cancel
Save