the start of the test name standardization
refs #15
--- a/.hgignore Sun Jul 04 02:58:33 2010 -0500
+++ b/.hgignore Sun Jul 04 03:34:39 2010 -0500
@@ -25,6 +25,4 @@
^tests/html/results.html$
^tests/test-(util|variables)$
-tests/test-([a-zA-Z0-9-]+)(\.exe)?$
-tests/([a-zA-Z0-9-]+)-test(\.exe)?$
-tests/([a-zA-Z0-9-]+)\.log$
+tests/test-([a-zA-Z0-9-]+)(\.exe|\.log)?$ --- a/gplate/tags/tests/CMakeLists.txt Sun Jul 04 02:58:33 2010 -0500
+++ b/gplate/tags/tests/CMakeLists.txt Sun Jul 04 03:34:39 2010 -0500
@@ -1,26 +1,29 @@
# define the static library for tag testing
-add_library(gplate-tag-test STATIC
+add_library(test-gplate-tag STATIC -target_link_libraries(gplate-tag-test gplate)
+target_link_libraries(test-gplate-tag gplate) -add_executable(gplate-text-tag-test gplate-text-tag-test.c)
-target_link_libraries(gplate-text-tag-test gplate-tag-test)
-list(APPEND TAG_TESTS gplate-text-tag-test)
+add_executable(test-gplate-text-tag test-gplate-text-tag.c) +target_link_libraries(test-gplate-text-tag test-gplate-tag) +list(APPEND TAG_TESTS test-gplate-text-tag) # add the variable tag tests
-add_executable(gplate-variable-tag-test gplate-variable-tag-test.c)
-target_link_libraries(gplate-variable-tag-test gplate-tag-test)
-list(APPEND TAG_TESTS gplate-variable-tag-test)
+add_executable(test-gplate-variable-tag test-gplate-variable-tag.c) +target_link_libraries(test-gplate-variable-tag test-gplate-tag) +list(APPEND TAG_TESTS test-gplate-variable-tag) # add the comment tag tests
-add_executable(gplate-comment-tag-test gplate-comment-tag-test.c)
-target_link_libraries(gplate-comment-tag-test gplate-tag-test)
-list(APPEND TAG_TESTS gplate-comment-tag-test)
+add_executable(test-gplate-comment-tag test-gplate-comment-tag.c) +target_link_libraries(test-gplate-comment-tag test-gplate-tag) +list(APPEND TAG_TESTS test-gplate-comment-tag) # add the tests for gtester
-add_test(GPlateTagTests ${GTESTER} -k --verbose -o gplate-tag-test.log ${TAG_TESTS})
+ ${GTESTER} -k --verbose -o test-gplate-tag.log --- a/gplate/tags/tests/gplate-comment-tag-test.c Sun Jul 04 02:58:33 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-#include <gplate/gplate.h>
-#include "gplate-tag-test.h"
-/******************************************************************************
- *****************************************************************************/
-gplate_comment_tag_test_empty(GPlateTagTestFixture *fixture,
- gplate_tag_test_output(fixture, data, "{##}", "");
-gplate_comment_tag_test_whitespace(GPlateTagTestFixture *fixture,
- gplate_tag_test_output(fixture, data, "{# #}", "");
- gplate_tag_test_output(fixture, data, "{#\t#}", "");
- gplate_tag_test_output(fixture, data, "{#\n#}", "");
- gplate_tag_test_output(fixture, data, "{#\r#}", "");
- gplate_tag_test_output(fixture, data, "{#\r\n#}", "");
- gplate_tag_test_output(fixture, data, "{#\n\r#}", "");
-gplate_comment_tag_test_simple(GPlateTagTestFixture *fixture,
- gplate_tag_test_output(fixture, data, "{# foo#}", "");
- gplate_tag_test_output(fixture, data, "{#foo #}", "");
- gplate_tag_test_output(fixture, data, "{#\tfoo#}", "");
- gplate_tag_test_output(fixture, data, "{#foo\t#}", "");
- gplate_tag_test_output(fixture, data, "{#\nfoo#}", "");
- gplate_tag_test_output(fixture, data, "{#foo\n#}", "");
- gplate_tag_test_output(fixture, data, "{#\rfoo#}", "");
- gplate_tag_test_output(fixture, data, "{#foo\r#}", "");
- gplate_tag_test_output(fixture, data, "{#\r\nfoo#}", "");
- gplate_tag_test_output(fixture, data, "{#foo\r\n#}", "");
-/******************************************************************************
- *****************************************************************************/
-main(gint argc, gchar **argv) {
- g_test_init(&argc, &argv, NULL);
- gplate_config_load_default();
- gplate_tag_test_add("/tags/comment/empty",
- gplate_comment_tag_test_empty);
- gplate_tag_test_add("/tags/comment/whitespace",
- gplate_comment_tag_test_whitespace);
- gplate_tag_test_add("/tags/comment/simple",
- gplate_comment_tag_test_simple);
--- a/gplate/tags/tests/gplate-tag-test.c Sun Jul 04 02:58:33 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
- * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include "gplate-tag-test.h"
-gplate_tag_test_setup(GPlateTagTestFixture *fixture, gconstpointer data) {
- fixture->template = gplate_template_new();
-gplate_tag_test_teardown(GPlateTagTestFixture *fixture, gconstpointer data) {
- g_object_unref(fixture->template);
- fixture->template = NULL;
- g_error_free(fixture->error);
- g_free(fixture->actual);
- fixture->actual = NULL;
-gplate_tag_test_output(GPlateTagTestFixture *fixture,
- const gchar *template_string,
- fixture->template_string = template_string;
- fixture->expected = expected;
- fixture->actual = gplate_template_render(fixture->template,
- fixture->template_string,
- g_assert(fixture->error == NULL);
- g_assert_cmpstr(fixture->expected, ==, fixture->actual);
--- a/gplate/tags/tests/gplate-tag-test.h Sun Jul 04 02:58:33 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
- * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef GPLATE_TAG_TEST_H
-#define GPLATE_TAG_TEST_H
-#include <gplate/gplate.h>
-#define gplate_tag_test_add(path, func) \
- g_test_add((path), GPlateTagTestFixture, NULL, gplate_tag_test_setup, (func), gplate_tag_test_teardown)
-typedef struct _GPlateTagTestFixture GPlateTagTestFixture;
-typedef void (*GPlateTagTestFixtureFunc)(GPlateTagTestFixture *fixture, gconstpointer data);
-struct _GPlateTagTestFixture {
- GPlateTemplate *template;
- const gchar *template_string;
-void gplate_tag_test_setup(GPlateTagTestFixture *fixture, gconstpointer data);
-void gplate_tag_test_teardown(GPlateTagTestFixture *fixture, gconstpointer data);
-void gplate_tag_test_output(GPlateTagTestFixture *fixture, gconstpointer data, const gchar *template_string, const gchar *expected);
-#endif /* GPLATE_TAG_TEST_H */
--- a/gplate/tags/tests/gplate-text-tag-test.c Sun Jul 04 02:58:33 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
- * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <gplate/gplate.h>
-#include "gplate-tag-test.h"
-/******************************************************************************
- *****************************************************************************/
-gplate_text_tag_test_syntax_plain(GPlateTagTestFixture *fixture,
- gplate_tag_test_output(fixture, data,
- "simple template", "simple template");
-gplate_text_tag_test_syntax_keywords(GPlateTagTestFixture *fixture,
- gplate_tag_test_output(fixture, data,
- "extends if else endif for endfor",
- "extends if else endif for endfor");
-gplate_text_tag_test_syntax_keywords_case_sensitive(GPlateTagTestFixture *fixture,
- gplate_tag_test_output(fixture, data,
- "EXteNds iF eLse enDif fOr enDFor",
- "EXteNds iF eLse enDif fOr enDFor");
-/******************************************************************************
- *****************************************************************************/
-main(gint argc, gchar **argv) {
- g_test_init(&argc, &argv, NULL);
- gplate_config_load_default();
- gplate_tag_test_add("/tags/text/plain",
- gplate_text_tag_test_syntax_plain);
- gplate_tag_test_add("/tags/text/keywords",
- gplate_text_tag_test_syntax_keywords);
- gplate_tag_test_add("/tags/text/keywords_case_sensitive",
- gplate_text_tag_test_syntax_keywords_case_sensitive);
--- a/gplate/tags/tests/gplate-variable-tag-test.c Sun Jul 04 02:58:33 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
- * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <gplate/gplate.h>
-#include "gplate-tag-test.h"
-/******************************************************************************
- *****************************************************************************/
-gplate_variable_tag_test(GPlateTagTestFixture *fixture, gconstpointer data,
- const gchar *template_string, const gchar *expected,
- const gchar *name = NULL, *value = NULL;
- va_start(vargs, expected);
- while((name = va_arg(vargs, const gchar *))) {
- value = va_arg(vargs, const gchar *);
- gplate_collection_add_string(GPLATE_COLLECTION(fixture->template),
- gplate_tag_test_output(fixture, data, template_string, expected);
-/******************************************************************************
- *****************************************************************************/
-gplate_variable_tag_test_single(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
-gplate_variable_tag_test_double(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
- "{{ foo }}{{ bar }}", "foobar",
-gplate_variable_tag_test_tripple(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
- "{{ foo }}{{ bar }}{{ baz }}", "foobarbaz",
-gplate_variable_tag_test_newline_prefix(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
-gplate_variable_tag_test_newline_suffix(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
-gplate_variable_tag_test_newline_wrapped(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
-gplate_variable_tag_test_single_quotes(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
- "foo '{{ bar }}' baz", "foo 'bar' baz",
-gplate_variable_tag_test_double_quotes(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
- "foo \"{{ bar }}\" baz", "foo \"bar\" baz",
-gplate_variable_tag_test_mixed_quotes(GPlateTagTestFixture *fixture,
- gplate_variable_tag_test(fixture, data,
- "foo \"{{ bar }}' baz", "foo \"bar' baz",
- gplate_variable_tag_test(fixture, data,
- "foo '{{ bar }}\" baz", "foo 'bar\" baz",
-/******************************************************************************
- *****************************************************************************/
-main(gint argc, gchar **argv) {
- g_test_init(&argc, &argv, NULL);
- gplate_config_load_default();
- gplate_tag_test_add("/tags/variable/single",
- gplate_variable_tag_test_single);
- gplate_tag_test_add("/tags/variable/double",
- gplate_variable_tag_test_double);
- gplate_tag_test_add("/tags/variable/tripple",
- gplate_variable_tag_test_tripple);
- gplate_tag_test_add("/tags/variable/newline_prefix",
- gplate_variable_tag_test_newline_prefix);
- gplate_tag_test_add("/tags/variable/newline_suffix",
- gplate_variable_tag_test_newline_suffix);
- gplate_tag_test_add("/tags/variable/newline_wrapped",
- gplate_variable_tag_test_newline_wrapped);
- gplate_tag_test_add("/tags/variable/quotes/single",
- gplate_variable_tag_test_single_quotes);
- gplate_tag_test_add("/tags/variable/quotes/double",
- gplate_variable_tag_test_double_quotes);
- gplate_tag_test_add("/tags/variable/quotes/mixed",
- gplate_variable_tag_test_mixed_quotes);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/tags/tests/test-gplate-comment-tag.c Sun Jul 04 03:34:39 2010 -0500
@@ -0,0 +1,81 @@
+ * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplate/gplate.h> +#include "test-gplate-tag.h" +/****************************************************************************** + *****************************************************************************/ +test_gplate_comment_tag_empty(TestGPlateTagFixture *fixture, + test_gplate_tag_output(fixture, data, "{##}", ""); +test_gplate_comment_tag_whitespace(TestGPlateTagFixture *fixture, + test_gplate_tag_output(fixture, data, "{# #}", ""); + test_gplate_tag_output(fixture, data, "{#\t#}", ""); + test_gplate_tag_output(fixture, data, "{#\n#}", ""); + test_gplate_tag_output(fixture, data, "{#\r#}", ""); + test_gplate_tag_output(fixture, data, "{#\r\n#}", ""); + test_gplate_tag_output(fixture, data, "{#\n\r#}", ""); +test_gplate_comment_tag_simple(TestGPlateTagFixture *fixture, + test_gplate_tag_output(fixture, data, "{# foo#}", ""); + test_gplate_tag_output(fixture, data, "{#foo #}", ""); + test_gplate_tag_output(fixture, data, "{#\tfoo#}", ""); + test_gplate_tag_output(fixture, data, "{#foo\t#}", ""); + test_gplate_tag_output(fixture, data, "{#\nfoo#}", ""); + test_gplate_tag_output(fixture, data, "{#foo\n#}", ""); + test_gplate_tag_output(fixture, data, "{#\rfoo#}", ""); + test_gplate_tag_output(fixture, data, "{#foo\r#}", ""); + test_gplate_tag_output(fixture, data, "{#\r\nfoo#}", ""); + test_gplate_tag_output(fixture, data, "{#foo\r\n#}", ""); +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplate_config_load_default(); + test_gplate_tag_add("/tags/comment/empty", + test_gplate_comment_tag_empty); + test_gplate_tag_add("/tags/comment/whitespace", + test_gplate_comment_tag_whitespace); + test_gplate_tag_add("/tags/comment/simple", + test_gplate_comment_tag_simple); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/tags/tests/test-gplate-tag.c Sun Jul 04 03:34:39 2010 -0500
@@ -0,0 +1,55 @@
+ * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include "test-gplate-tag.h" +test_gplate_tag_setup(TestGPlateTagFixture *fixture, gconstpointer data) { + fixture->template = gplate_template_new(); +test_gplate_tag_teardown(TestGPlateTagFixture *fixture, gconstpointer data) { + g_object_unref(fixture->template); + fixture->template = NULL; + g_error_free(fixture->error); + g_free(fixture->actual); + fixture->actual = NULL; +test_gplate_tag_output(TestGPlateTagFixture *fixture, + const gchar *template_string, + fixture->template_string = template_string; + fixture->expected = expected; + fixture->actual = gplate_template_render(fixture->template, + fixture->template_string, + g_assert(fixture->error == NULL); + g_assert_cmpstr(fixture->expected, ==, fixture->actual); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/tags/tests/test-gplate-tag.h Sun Jul 04 03:34:39 2010 -0500
@@ -0,0 +1,50 @@
+ * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#ifndef TEST_GPLATE_TAG_H +#define TEST_GPLATE_TAG_H +#include <gplate/gplate.h> +#define test_gplate_tag_add(path, func) \ + g_test_add((path), TestGPlateTagFixture, NULL, test_gplate_tag_setup, (func), test_gplate_tag_teardown) +typedef struct _TestGPlateTagFixture TestGPlateTagFixture; +typedef void (*TestGPlateTagFixtureFunc)(TestGPlateTagFixture *fixture, gconstpointer data); +struct _TestGPlateTagFixture { + GPlateTemplate *template; + const gchar *template_string; +void test_gplate_tag_setup(TestGPlateTagFixture *fixture, gconstpointer data); +void test_gplate_tag_teardown(TestGPlateTagFixture *fixture, gconstpointer data); +void test_gplate_tag_output(TestGPlateTagFixture *fixture, gconstpointer data, const gchar *template_string, const gchar *expected); +#endif /* TEST_GPLATE_TAG_H */ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/tags/tests/test-gplate-text-tag.c Sun Jul 04 03:34:39 2010 -0500
@@ -0,0 +1,72 @@
+ * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplate/gplate.h> +#include "test-gplate-tag.h" +/****************************************************************************** + *****************************************************************************/ +test_gplate_text_tag_syntax_plain(TestGPlateTagFixture *fixture, + test_gplate_tag_output(fixture, data, + "simple template", "simple template"); +test_gplate_text_tag_syntax_keywords(TestGPlateTagFixture *fixture, + test_gplate_tag_output(fixture, data, + "extends if else endif for endfor", + "extends if else endif for endfor"); +test_gplate_text_tag_syntax_keywords_case_sensitive(TestGPlateTagFixture *fixture, + test_gplate_tag_output(fixture, data, + "EXteNds iF eLse enDif fOr enDFor", + "EXteNds iF eLse enDif fOr enDFor"); +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplate_config_load_default(); + test_gplate_tag_add("/tags/text/plain", + test_gplate_text_tag_syntax_plain); + test_gplate_tag_add("/tags/text/keywords", + test_gplate_text_tag_syntax_keywords); + test_gplate_tag_add("/tags/text/keywords_case_sensitive", + test_gplate_text_tag_syntax_keywords_case_sensitive); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/tags/tests/test-gplate-variable-tag.c Sun Jul 04 03:34:39 2010 -0500
@@ -0,0 +1,186 @@
+ * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplate/gplate.h> +#include "test-gplate-tag.h" +/****************************************************************************** + *****************************************************************************/ +test_gplate_variable_tag(TestGPlateTagFixture *fixture, gconstpointer data, + const gchar *template_string, const gchar *expected, + const gchar *name = NULL, *value = NULL; + va_start(vargs, expected); + while((name = va_arg(vargs, const gchar *))) { + value = va_arg(vargs, const gchar *); + gplate_collection_add_string(GPLATE_COLLECTION(fixture->template), + test_gplate_tag_output(fixture, data, template_string, expected); +/****************************************************************************** + *****************************************************************************/ +test_gplate_variable_tag_single(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, +test_gplate_variable_tag_double(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, + "{{ foo }}{{ bar }}", "foobar", +test_gplate_variable_tag_tripple(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, + "{{ foo }}{{ bar }}{{ baz }}", "foobarbaz", +test_gplate_variable_tag_newline_prefix(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, +test_gplate_variable_tag_newline_suffix(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, +test_gplate_variable_tag_newline_wrapped(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, +test_gplate_variable_tag_single_quotes(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, + "foo '{{ bar }}' baz", "foo 'bar' baz", +test_gplate_variable_tag_double_quotes(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, + "foo \"{{ bar }}\" baz", "foo \"bar\" baz", +test_gplate_variable_tag_mixed_quotes(TestGPlateTagFixture *fixture, + test_gplate_variable_tag(fixture, data, + "foo \"{{ bar }}' baz", "foo \"bar' baz", + test_gplate_variable_tag(fixture, data, + "foo '{{ bar }}\" baz", "foo 'bar\" baz", +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplate_config_load_default(); + test_gplate_tag_add("/tags/variable/single", + test_gplate_variable_tag_single); + test_gplate_tag_add("/tags/variable/double", + test_gplate_variable_tag_double); + test_gplate_tag_add("/tags/variable/tripple", + test_gplate_variable_tag_tripple); + test_gplate_tag_add("/tags/variable/newline_prefix", + test_gplate_variable_tag_newline_prefix); + test_gplate_tag_add("/tags/variable/newline_suffix", + test_gplate_variable_tag_newline_suffix); + test_gplate_tag_add("/tags/variable/newline_wrapped", + test_gplate_variable_tag_newline_wrapped); + test_gplate_tag_add("/tags/variable/quotes/single", + test_gplate_variable_tag_single_quotes); + test_gplate_tag_add("/tags/variable/quotes/double", + test_gplate_variable_tag_double_quotes); + test_gplate_tag_add("/tags/variable/quotes/mixed", + test_gplate_variable_tag_mixed_quotes); --- a/gplate/tests/CMakeLists.txt Sun Jul 04 02:58:33 2010 -0500
+++ b/gplate/tests/CMakeLists.txt Sun Jul 04 03:34:39 2010 -0500
@@ -1,10 +1,22 @@
-add_executable(test-collection-interface test-collection-interface.c)
-target_link_libraries(test-collection-interface gplate)
-add_test(GPlateCollectionInterface test-collection-interface)
+############################################################################### +############################################################################### +add_executable(test-gplate-collection-interface test-gplate-collection-interface.c) +target_link_libraries(test-gplate-collection-interface gplate) +add_test(GPlateCollectionInterface + gtester -k --verbose -o test-gplate-collection-interface.log + test-gplate-collection-interface -add_executable(test-util-functions test-util-functions.c)
-target_link_libraries(test-util-functions gplate)
-add_test(GPlateUtilityFunctions test-util-functions)
+############################################################################### +############################################################################### +add_executable(test-gplate-utility-functions test-gplate-utility-functions.c) +target_link_libraries(test-gplate-utility-functions gplate) +add_test(GPlateUtilityFunctions + gtester -k --verbose -o test-gplate-utility-functions.log + test-gplate-utility-functions --- a/gplate/tests/test-collection-interface.c Sun Jul 04 02:58:33 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
- * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <gplate/gplate.h>
-/******************************************************************************
- *****************************************************************************/
-main(gint argc, gchar **argv) {
- g_test_init(&argc, &argv, NULL);
- gplate_config_load_default();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/tests/test-gplate-collection-interface.c Sun Jul 04 03:34:39 2010 -0500
@@ -0,0 +1,34 @@
+ * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplate/gplate.h> +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplate_config_load_default(); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/tests/test-gplate-utility-functions.c Sun Jul 04 03:34:39 2010 -0500
@@ -0,0 +1,58 @@
+ * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com> + * * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplate/gplate.h> +gplate_util_test_quoted_string_helper(const gchar *string, + const gchar *contents, gboolean value) + r = gplate_util_is_quoted_string(string, &c); + g_assert_cmpint(r, ==, value); + g_assert_cmpstr(c, ==, contents); +gplate_util_test_quoted_string(void) { + gplate_util_test_quoted_string_helper("\"abc\"", "abc", TRUE); + gplate_util_test_quoted_string_helper("\"abc def\"", "abc def", TRUE); + gplate_util_test_quoted_string_helper("\"abc\tdef\bghi\"", "abc\tdef\bghi", TRUE); + gplate_util_test_quoted_string_helper("abc \"def\"", NULL, FALSE); + gplate_util_test_quoted_string_helper("\"abc\" def", NULL, FALSE); + gplate_util_test_quoted_string_helper("'abc'", "abc", TRUE); + gplate_util_test_quoted_string_helper("'abc def'", "abc def", TRUE); + gplate_util_test_quoted_string_helper("'abc\tdef\bghi'", "abc\tdef\bghi", TRUE); + gplate_util_test_quoted_string_helper("abc 'def'", NULL, FALSE); + gplate_util_test_quoted_string_helper("'abc' def", NULL, FALSE); + gplate_util_test_quoted_string_helper("'abc\"", NULL, FALSE); + gplate_util_test_quoted_string_helper("\"abc'", NULL, FALSE); +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + g_test_add_func("/util/quoted_string", gplate_util_test_quoted_string); --- a/gplate/tests/test-util-functions.c Sun Jul 04 02:58:33 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
- * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
- * * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <gplate/gplate.h>
-gplate_util_test_quoted_string_helper(const gchar *string,
- const gchar *contents, gboolean value)
- r = gplate_util_is_quoted_string(string, &c);
- g_assert_cmpint(r, ==, value);
- g_assert_cmpstr(c, ==, contents);
-gplate_util_test_quoted_string(void) {
- gplate_util_test_quoted_string_helper("\"abc\"", "abc", TRUE);
- gplate_util_test_quoted_string_helper("\"abc def\"", "abc def", TRUE);
- gplate_util_test_quoted_string_helper("\"abc\tdef\bghi\"", "abc\tdef\bghi", TRUE);
- gplate_util_test_quoted_string_helper("abc \"def\"", NULL, FALSE);
- gplate_util_test_quoted_string_helper("\"abc\" def", NULL, FALSE);
- gplate_util_test_quoted_string_helper("'abc'", "abc", TRUE);
- gplate_util_test_quoted_string_helper("'abc def'", "abc def", TRUE);
- gplate_util_test_quoted_string_helper("'abc\tdef\bghi'", "abc\tdef\bghi", TRUE);
- gplate_util_test_quoted_string_helper("abc 'def'", NULL, FALSE);
- gplate_util_test_quoted_string_helper("'abc' def", NULL, FALSE);
- gplate_util_test_quoted_string_helper("'abc\"", NULL, FALSE);
- gplate_util_test_quoted_string_helper("\"abc'", NULL, FALSE);
-main(gint argc, gchar **argv) {
- g_test_init(&argc, &argv, NULL);
- g_test_add_func("/util/quoted_string", gplate_util_test_quoted_string);