Made unit tests work again
This commit is contained in:
parent
fcfe1cf30e
commit
4476a11c79
@ -14,10 +14,14 @@ SET(MOO_PACKAGE_VENDOR ${MOO_EMAIL})
|
||||
|
||||
MOO_OPTION(MOO_BUILD_CTAGS ${MOO_OS_UNIX} "Build Ctags plugin" HIDDEN ${MOO_OS_WIN32} HEADER TRUE)
|
||||
MOO_OPTION(MOO_ENABLE_PROJECT FALSE "Build project plugin" HIDDEN TRUE)
|
||||
MOO_OPTION(MOO_ENABLE_UNIT_TESTS FALSE "Build unit tests" DEFINE TRUE)
|
||||
MOO_OPTION(MOO_ENABLE_GENERATED_FILES ${MOO_OS_UNIX} "Run gtk-update-icon-cache on install")
|
||||
MOO_OPTION(MOO_BROKEN_GTK_THEME FALSE "Work around bugs in gtk theme" HEADER TRUE)
|
||||
|
||||
MOO_OPTION(MOO_ENABLE_UNIT_TESTS FALSE "Build unit tests" DEFINE TRUE)
|
||||
IF(MOO_ENABLE_UNIT_TESTS)
|
||||
ADD_DEFINITIONS(-DMOO_ENABLE_UNIT_TESTS)
|
||||
ENDIF(MOO_ENABLE_UNIT_TESTS)
|
||||
|
||||
INCLUDE(cmake/gtk.cmake)
|
||||
INCLUDE(cmake/moo.cmake)
|
||||
INCLUDE(cmake/dist.cmake)
|
||||
@ -56,6 +60,10 @@ IF(WIN32)
|
||||
CONFIGURE_FILE(plat/win32/run-medit.in run-medit.bat)
|
||||
SET(_MOO_RUN_HOW "gdb --args ")
|
||||
CONFIGURE_FILE(plat/win32/run-medit.in run-medit-in-gdb.bat)
|
||||
IF(MOO_ENABLE_UNIT_TESTS)
|
||||
SET(_MOO_RUN_HOW "@")
|
||||
CONFIGURE_FILE(plat/win32/run-tests.in run-tests.bat)
|
||||
ENDIF(MOO_ENABLE_UNIT_TESTS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(NOT WIN32)
|
||||
|
@ -2,9 +2,9 @@ IF(MOO_ENABLE_PROJECT)
|
||||
ADD_DEFINITIONS(-DMOO_ENABLE_PROJECT)
|
||||
ENDIF(MOO_ENABLE_PROJECT)
|
||||
|
||||
IF(MOO_ENABLE_UNIT_TESTS AND NOT WIN32)
|
||||
IF(MOO_ENABLE_UNIT_TESTS)
|
||||
ADD_DEFINITIONS(-DSRCDIR="${CMAKE_SOURCE_DIR}/medit")
|
||||
ENDIF(MOO_ENABLE_UNIT_TESTS AND NOT WIN32)
|
||||
ENDIF(MOO_ENABLE_UNIT_TESTS)
|
||||
|
||||
IF(MOO_ENABLE_PYTHON)
|
||||
SET(moopythonlib moopython)
|
||||
@ -34,7 +34,11 @@ IF(MOO_OS_LINUX)
|
||||
LIST(APPEND MOO_DEP_LIBS m dl)
|
||||
ENDIF(MOO_OS_LINUX)
|
||||
|
||||
ADD_EXECUTABLE(medit WIN32 ${MEDIT_SOURCES})
|
||||
IF(NOT MOO_ENABLE_UNIT_TESTS)
|
||||
SET(MEDIT_WIN32 WIN32)
|
||||
ENDIF(NOT MOO_ENABLE_UNIT_TESTS)
|
||||
|
||||
ADD_EXECUTABLE(medit ${MEDIT_WIN32} ${MEDIT_SOURCES})
|
||||
TARGET_LINK_LIBRARIES(medit ${medit_libs} ${MOO_DEP_LIBS})
|
||||
INSTALL(TARGETS medit DESTINATION ${BINDIR})
|
||||
|
||||
@ -45,8 +49,10 @@ ENDIF(MOO_ENABLE_PYTHON)
|
||||
FIND_PACKAGE(MooDesktopFile)
|
||||
MOO_INSTALL_DESKTOP_FILE(medit.desktop.in)
|
||||
|
||||
SET(PIXMAPS_DIR "${DATADIR}/pixmaps")
|
||||
SET(ICONTHEME_DIR "${DATADIR}/icons/hicolor/48x48/apps")
|
||||
SET(MEDIT_ICONS "${CMAKE_SOURCE_DIR}/moo/mooutils/pixmaps/medit.png")
|
||||
INSTALL(FILES ${MEDIT_ICONS} DESTINATION "${PIXMAPS_DIR}")
|
||||
INSTALL(FILES ${MEDIT_ICONS} DESTINATION "${ICONTHEME_DIR}")
|
||||
IF(MOO_OS_UNIX)
|
||||
SET(PIXMAPS_DIR "${DATADIR}/pixmaps")
|
||||
SET(ICONTHEME_DIR "${DATADIR}/icons/hicolor/48x48/apps")
|
||||
SET(MEDIT_ICONS "${CMAKE_SOURCE_DIR}/moo/mooutils/pixmaps/medit.png")
|
||||
INSTALL(FILES ${MEDIT_ICONS} DESTINATION "${PIXMAPS_DIR}")
|
||||
INSTALL(FILES ${MEDIT_ICONS} DESTINATION "${ICONTHEME_DIR}")
|
||||
ENDIF(MOO_OS_UNIX)
|
||||
|
@ -46,11 +46,7 @@ unit_tests_main (int argc, char *argv[])
|
||||
g_thread_init (NULL);
|
||||
g_set_prgname ("run-tests");
|
||||
|
||||
#ifdef __WIN32__
|
||||
data_dir = "test-data";
|
||||
#else
|
||||
data_dir = SRCDIR "/data";
|
||||
#endif
|
||||
|
||||
grp = g_option_group_new ("run-tests", "run-tests", "run-tests", NULL, NULL);
|
||||
g_option_group_add_entries (grp, options);
|
||||
@ -83,7 +79,7 @@ unit_tests_main (int argc, char *argv[])
|
||||
moo_test_cleanup ();
|
||||
|
||||
#ifdef __WIN32__
|
||||
if (!g_getenv ("WINESERVER"))
|
||||
if (!g_getenv ("WINESERVER") && !list_only)
|
||||
{
|
||||
printf ("Done, press Enter...");
|
||||
fflush (stdout);
|
||||
|
@ -2072,7 +2072,10 @@ test_encodings_1 (const char *name,
|
||||
|
||||
editor = moo_editor_instance ();
|
||||
doc = moo_editor_open_file (editor, NULL, NULL, filename, encoding);
|
||||
TEST_ASSERT (doc != NULL);
|
||||
TEST_ASSERT_MSG (doc != NULL,
|
||||
"file '%s', encoding '%s'",
|
||||
TEST_FMT_STR (filename),
|
||||
TEST_FMT_STR (encoding));
|
||||
|
||||
if (doc)
|
||||
{
|
||||
|
@ -1,3 +1,3 @@
|
||||
@pushd ${_MOO_BINARY_DIR}\moo
|
||||
${_MOO_RUN_HOW}${_MOO_BINARY_DIR}\medit\medit.exe -n --log-window %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
${_MOO_RUN_HOW}${_MOO_BINARY_DIR}\medit\medit.exe -n --log-window %*
|
||||
@popd
|
||||
|
3
plat/win32/run-tests.in
Normal file
3
plat/win32/run-tests.in
Normal file
@ -0,0 +1,3 @@
|
||||
@pushd ${_MOO_BINARY_DIR}
|
||||
${_MOO_RUN_HOW}${_MOO_BINARY_DIR}\medit\medit.exe --ut %*
|
||||
@popd
|
Loading…
x
Reference in New Issue
Block a user