forked from lfranchi/liblastfm
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include(lastfm_add_test.cmake) | ||
|
||
lastfm_add_test(UrlBuilder) | ||
lastfm_add_test(Track) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
macro(lastfm_add_test test_class) | ||
include_directories(${QT_INCLUDES} "${PROJECT_SOURCE_DIR}/src" ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
set(LASTFM_TEST_CLASS ${test_class}) | ||
configure_file(main.cpp.in Test${LASTFM_TEST_CLASS}.cpp) | ||
configure_file(Test${LASTFM_TEST_CLASS}.h Test${LASTFM_TEST_CLASS}.h) | ||
add_executable(${LASTFM_TEST_CLASS}Test Test${LASTFM_TEST_CLASS}.cpp) | ||
|
||
target_link_libraries(${LASTFM_TEST_CLASS}Test | ||
lastfm | ||
${QT_QTTEST_LIBRARY} | ||
${QT_QTCORE_LIBRARY} | ||
) | ||
|
||
add_test(NAME ${LASTFM_TEST_CLASS}Test COMMAND ${LASTFM_TEST_CLASS}Test) | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
/* | ||
This software is in the public domain, furnished "as is", without technical | ||
support, and with no warranty, express or implied, as to its usefulness for | ||
This software is in the public domain, furnished "as is", without technical | ||
support, and with no warranty, express or implied, as to its usefulness for | ||
any purpose. | ||
*/ | ||
#include <QtCore> | ||
#include <QtTest> | ||
#include "TestTrack.h" | ||
#include "moc_TestTrack.cpp" | ||
|
||
#include "TestUrlBuilder.h" | ||
#include "moc_TestUrlBuilder.cpp" | ||
|
||
#include "Test@LASTFM_TEST_CLASS@.h" | ||
#include "moc_Test@LASTFM_TEST_CLASS@.cpp" | ||
|
||
int main( int argc, char** argv) | ||
{ | ||
QCoreApplication app( argc, argv ); | ||
|
||
#define TEST( Type ) { \ | ||
Type o; \ | ||
if (int r = QTest::qExec( &o, argc, argv ) != 0) return r; } | ||
|
||
TEST( TestTrack ); | ||
TEST( TestUrlBuilder ); | ||
TEST( Test@LASTFM_TEST_CLASS@ ); | ||
return 0; | ||
} |