grim/gplate

Parents 03e066487151
Children 83492ab5a9d7
trying to fix the path problem for templates in the include tests
--- a/tests/CMakeLists.txt Wed Sep 05 00:54:11 2012 -0500
+++ b/tests/CMakeLists.txt Wed Sep 05 01:01:52 2012 -0500
@@ -1,3 +1,7 @@
+add_definitions(
+ -DBUILD_DIR="\\"${CMAKE_CURRENT_BUILD_DIR}\\""
+)
+
add_subdirectory(functions)
add_subdirectory(tags)
add_subdirectory(variables)
--- a/tests/functions/test-gplate-include-function.c Wed Sep 05 00:54:11 2012 -0500
+++ b/tests/functions/test-gplate-include-function.c Wed Sep 05 01:01:52 2012 -0500
@@ -68,11 +68,15 @@
test_gplate_include_function_simple(TestGPlateIncludeFunctionFixture *fixture,
gconstpointer data)
{
+ gchar *path = NULL;
+
fixture->expected = "including\nincluded!\ndone";
+ path = g_build_path(BUILD_DIR, "templates", "simple.gplate", NULL);
fixture->actual = gplate_template_render_file(fixture->template,
- "templates/simple.gplate",
+ path,
&fixture->error);
+ g_free(path);
g_assert(fixture->error == NULL);
@@ -83,6 +87,8 @@
test_gplate_include_function_double(TestGPlateIncludeFunctionFixture *fixture,
gconstpointer data)
{
+ gchar *path = NULL;
+
fixture->expected = " \
<html>\
<head>\
@@ -93,9 +99,11 @@
</body>\
</html>";
+ path = g_build_path(BUILD_DIR, "templates", "html.gplate", NULL);
fixture->actual = gplate_template_render_file(fixture->template,
- "templates/html.gplate",
+ path,
&fixture->error);
+ g_free(path);
g_assert(fixture->error == NULL);