Le 05/10/2012 11:57, Jean-Marc Lasgouttes a écrit :
The branch, master, has been updated.
- Log -----------------------------------------------------------------
commit 4729b1c35de08963cf8b40b59bcf50d427f2bb0c
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Fri Oct 5 11:55:23 2012 +0200
Fix make check target
A dummy getGuiMessages function was missing. Instead of adding it
everywhere, a new file is created that contains all the dummy functions needed
by the tests.
Pavel, if this satisfies you, I will port to branch.
Kornel, this requires some changes to cmake. I will wait until they are
don in trunk to backport anyway.
JMarc
diff --git a/src/support/Makefile.am b/src/support/Makefile.am
index 2418168..dc317c0 100644
--- a/src/support/Makefile.am
+++ b/src/support/Makefile.am
@@ -156,18 +156,21 @@ check_convert_LDADD = liblyxsupport.a $(INTLLIBS)
$(LIBICONV) $(BOOST_LIBS) $(QT
check_convert_LDFLAGS = $(QT4_LDFLAGS)
check_convert_SOURCES = \
tests/check_convert.cpp \
+ tests/dummy_functions.cpp \
tests/boost.cpp
check_filetools_LDADD = liblyxsupport.a $(INTLLIBS) $(LIBICONV) $(BOOST_LIBS)
$(QT4_CORE_LIBS) $(LIBSHLWAPI)
check_filetools_LDFLAGS = $(QT4_CORE_LDFLAGS)
check_filetools_SOURCES = \
tests/check_filetools.cpp \
+ tests/dummy_functions.cpp \
tests/boost.cpp
check_lstrings_LDADD = liblyxsupport.a $(INTLLIBS) $(LIBICONV) $(BOOST_LIBS)
$(QT4_CORE_LIBS) $(LIBSHLWAPI)
check_lstrings_LDFLAGS = $(QT4_CORE_LDFLAGS)
check_lstrings_SOURCES = \
tests/check_lstrings.cpp \
+ tests/dummy_functions.cpp \
tests/boost.cpp
makeregfiles: ${check_PROGRAMS}
diff --git a/src/support/tests/check_convert.cpp
b/src/support/tests/check_convert.cpp
index 30ea647..1e12a46 100644
--- a/src/support/tests/check_convert.cpp
+++ b/src/support/tests/check_convert.cpp
@@ -1,7 +1,6 @@
#include <config.h>
#include "../convert.h"
-#include "../docstring.h"
#include <iostream>
@@ -9,18 +8,6 @@ using lyx::convert;
using namespace std;
-
-namespace lyx {
- // Dummy LyXRC support
- struct LyXRC { string icon_set; } lyxrc;
-
- // Keep the linker happy on Windows
- void lyx_exit(int) {}
-
- docstring const _(string const & s) { return from_ascii(s); }
-}
-
-
void convert_int()
{
cout << convert<int>("123") << '\n'
diff --git a/src/support/tests/check_filetools.cpp
b/src/support/tests/check_filetools.cpp
index 7da548a..ad657fa 100644
--- a/src/support/tests/check_filetools.cpp
+++ b/src/support/tests/check_filetools.cpp
@@ -10,16 +10,6 @@ using namespace lyx::support;
using namespace std;
-namespace lyx {
- // Dummy LyXRC support
- struct LyXRC { string icon_set; } lyxrc;
-
- // Keep the linker happy on Windows
- void lyx_exit(int) {}
-
- docstring const _(string const & s) { return from_ascii(s); }
-}
-
void test_normalizePath()
{
cout << FileName("/foo/../bar").absFileName() << endl;
diff --git a/src/support/tests/check_lstrings.cpp
b/src/support/tests/check_lstrings.cpp
index 8a4aea8..3509e45 100644
--- a/src/support/tests/check_lstrings.cpp
+++ b/src/support/tests/check_lstrings.cpp
@@ -10,16 +10,6 @@ using namespace lyx;
using namespace std;
-namespace lyx {
- // Dummy LyXRC support
- struct LyXRC { string icon_set; } lyxrc;
-
- // Keep the linker happy on Windows
- void lyx_exit(int) {}
-
- docstring const _(string const & s) { return from_ascii(s); }
-}
-
void test_lowercase()
{
cout << to_ascii(docstring(1, lowercase(char_type('A')))) << endl;
diff --git a/src/support/tests/dummy_functions.cpp
b/src/support/tests/dummy_functions.cpp
new file mode 100644
index 0000000..229198e
--- /dev/null
+++ b/src/support/tests/dummy_functions.cpp
@@ -0,0 +1,23 @@
+#include <config.h>
+
+#include "../Messages.h"
+
+using namespace std;
+
+namespace lyx {
+ // Dummy LyXRC support
+ struct LyXRC { string icon_set; } lyxrc;
+
+ // Keep the linker happy on Windows
+ void lyx_exit(int) {}
+
+ docstring const _(string const & s) { return from_ascii(s); }
+
+ // Dummy language support
+ Messages const & getGuiMessages()
+ {
+ static Messages lyx_messages;
+
+ return lyx_messages;
+ }
+}
-----------------------------------------------------------------------
Summary of changes:
src/support/Makefile.am | 3 +++
src/support/tests/check_convert.cpp | 13 -------------
src/support/tests/check_filetools.cpp | 10 ----------
src/support/tests/check_lstrings.cpp | 10 ----------
src/support/tests/dummy_functions.cpp | 23 +++++++++++++++++++++++
5 files changed, 26 insertions(+), 33 deletions(-)
create mode 100644 src/support/tests/dummy_functions.cpp
hooks/post-receive