mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
glib/tests: Use explicit file listings
This is a preparatory commit for installed tests work; having things cleanly categorized helps. https://bugzilla.gnome.org/show_bug.cgi?id=699079
This commit is contained in:
parent
6e64bbe8de
commit
225d8fb97d
@ -1,4 +1,57 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
NULL =
|
||||
|
||||
bookmark_test_files = \
|
||||
bookmarks/fail-01.xbel \
|
||||
bookmarks/fail-02.xbel \
|
||||
bookmarks/fail-03.xbel \
|
||||
bookmarks/fail-04.xbel \
|
||||
bookmarks/fail-05.xbel \
|
||||
bookmarks/fail-06.xbel \
|
||||
bookmarks/fail-07.xbel \
|
||||
bookmarks/fail-08.xbel \
|
||||
bookmarks/fail-09.xbel \
|
||||
bookmarks/fail-10.xbel \
|
||||
bookmarks/fail-11.xbel \
|
||||
bookmarks/fail-12.xbel \
|
||||
bookmarks/fail-13.xbel \
|
||||
bookmarks/fail-14.xbel \
|
||||
bookmarks/fail-15.xbel \
|
||||
bookmarks/fail-16.xbel \
|
||||
bookmarks/fail-17.xbel \
|
||||
bookmarks/valid-01.xbel \
|
||||
bookmarks/valid-02.xbel \
|
||||
bookmarks/valid-03.xbel \
|
||||
$(NULL)
|
||||
|
||||
markup_tests = \
|
||||
fail-1 fail-2 fail-3 fail-4 fail-5 \
|
||||
fail-6 fail-7 fail-8 fail-9 fail-10 \
|
||||
fail-11 fail-12 fail-13 fail-14 fail-15 \
|
||||
fail-16 fail-17 fail-18 fail-19 fail-20 \
|
||||
fail-21 fail-22 fail-23 fail-24 fail-25 \
|
||||
fail-26 fail-27 fail-28 fail-29 fail-30 \
|
||||
fail-31 fail-32 fail-33 fail-34 fail-35 \
|
||||
fail-36 fail-37 fail-38 fail-39 fail-40 \
|
||||
fail-41 fail-42 fail-43 fail-44 fail-45 \
|
||||
fail-46 fail-47 fail-48 fail-49 \
|
||||
valid-1 valid-2 valid-3 valid-4 valid-5 \
|
||||
valid-6 valid-7 valid-8 valid-9 valid-10 \
|
||||
valid-11 valid-12 valid-13 valid-14 valid-15 \
|
||||
$(NULL)
|
||||
|
||||
all_markup_test_files = $(addprefix markups/,$(markup_tests:=.gmarkup) $(markup_tests:=.expected))
|
||||
|
||||
test_files = \
|
||||
keyfiletest.ini \
|
||||
pages.ini \
|
||||
keyfile.c \
|
||||
empty \
|
||||
4096-random-bytes \
|
||||
$(NULL)
|
||||
|
||||
test_script_files = \
|
||||
echo-script
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-g \
|
||||
@ -131,17 +184,9 @@ CLEANFILES = \
|
||||
tmpsample.xml
|
||||
|
||||
EXTRA_DIST += \
|
||||
4096-random-bytes \
|
||||
keyfiletest.ini \
|
||||
pages.ini \
|
||||
$(bookmark_test_files) \
|
||||
$(all_markup_test_files) \
|
||||
$(test_files) \
|
||||
$(test_script_files) \
|
||||
bookmarks.xbel \
|
||||
empty \
|
||||
echo-script
|
||||
|
||||
dist-hook:
|
||||
mkdir $(distdir)/markups; \
|
||||
for f in $(srcdir)/markups/*; do \
|
||||
cp $$f $(distdir)/markups; done
|
||||
mkdir $(distdir)/bookmarks; \
|
||||
for f in $(srcdir)/bookmarks/* ; do \
|
||||
cp $$f $(distdir)/bookmarks; done
|
||||
$(NULL)
|
||||
|
@ -250,6 +250,7 @@ test_parse (gconstpointer d)
|
||||
const gchar *filename = d;
|
||||
gchar *expected_file;
|
||||
gchar *expected;
|
||||
GError *error = NULL;
|
||||
gint res;
|
||||
|
||||
depth = 0;
|
||||
@ -263,11 +264,10 @@ test_parse (gconstpointer d)
|
||||
g_assert_cmpint (res, ==, 1);
|
||||
|
||||
expected_file = get_expected_filename (filename);
|
||||
if (g_file_get_contents (expected_file, &expected, NULL, NULL))
|
||||
{
|
||||
g_assert_cmpstr (string->str, ==, expected);
|
||||
g_free (expected);
|
||||
}
|
||||
g_file_get_contents (expected_file, &expected, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpstr (string->str, ==, expected);
|
||||
g_free (expected);
|
||||
g_free (expected_file);
|
||||
|
||||
g_string_free (string, TRUE);
|
||||
|
50
glib/tests/markups/fail-3.expected
Normal file
50
glib/tests/markups/fail-3.expected
Normal file
@ -0,0 +1,50 @@
|
||||
ELEMENT 'foobar'
|
||||
ERROR Error on line 49 char 2: Invalid UTF-8 encoded text in name - not valid '
|
||||
Παν語
|
||||
|
||||
This is a list of ways to say hello in various languages. Its purpose is to illustrate a number of scripts.
|
||||
|
||||
(Converted into UTF-8)
|
||||
|
||||
---------------------------------------------------------
|
||||
Arabic السلام عليكم
|
||||
Czech (Ä<>esky) Dobrý den
|
||||
Danish (Dansk) Hej, Goddag
|
||||
English Hello
|
||||
Esperanto Saluton
|
||||
Estonian Tere, Tervist
|
||||
FORTRAN PROGRAM
|
||||
Finnish (Suomi) Hei
|
||||
French (Français) Bonjour, Salut
|
||||
German (Deutsch Nord) Guten Tag
|
||||
German (Deutsch Süd) Grüß Gott
|
||||
Greek (Ελληνικά) Γειά σας
|
||||
Hebrew שלו×<E280A2>
|
||||
Hindi नमसà¥<C3A0>ते, à¨à¤®à¤¸à¥<C3A0>कार।
|
||||
Italiano Ciao, Buon giorno
|
||||
Maltese Ċaw, Saħħa
|
||||
Nederlands, Vlaams Hallo, Dag
|
||||
Norwegian (Norsk) Hei, God dag
|
||||
Polish Dzień dobry, Hej
|
||||
Russian (РуÑ<C692>Ñ<EFBFBD>кий) ЗдравÑ<C2B2>твуйте!‎
|
||||
Slovak Dobrý deň
|
||||
Spanish (Español) ‎¡Hola!‎
|
||||
Swedish (Svenska) Hej, Goddag
|
||||
Thai (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ
|
||||
Turkish (Türkçe) Merhaba
|
||||
Vietnamese (Tiếng Việt) Xin Chà o
|
||||
Yiddish (ײַדישע) ד×<E2809C>ָס הײַזעלע
|
||||
|
||||
Japanese (日本語) ã<>“ã‚“ã<E2809C>«ã<C2AB>¡ã<C2A1>¯, コï¾<C3AF>ニï¾<C3AF>ハ
|
||||
Chinese (ä¸æ–‡,普通è¯<C3A8>,汉è¯) ä½ å¥½
|
||||
Cantonese (粵語,廣æ<C2A3>±è©±) 早晨, ä½ å¥½
|
||||
Korean (한글) 안녕하세요, 안녕하ì‹ë‹ˆê¹Œ
|
||||
|
||||
Difference among chinese characters in GB, JIS, KSC, BIG5:‎
|
||||
GB -- 元气 å¼€å<E282AC>‘
|
||||
JIS -- 元気 開発
|
||||
KSC -- 元氣 開發
|
||||
BIG5 -- 元氣 開發
|
||||
|
||||
|
||||
'
|
4
glib/tests/markups/fail-36.expected
Normal file
4
glib/tests/markups/fail-36.expected
Normal file
@ -0,0 +1,4 @@
|
||||
ELEMENT 'foo'
|
||||
TEXT '<27>'
|
||||
END 'foo'
|
||||
ERROR Error on line 2 char 1: '^$non-carriage-null-fail|' is not a valid name
|
Loading…
Reference in New Issue
Block a user