summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattdangerw <mattdangerw@gmail.com>2013-12-02 12:33:49 -0800
committermattdangerw <mattdangerw@gmail.com>2013-12-02 12:33:49 -0800
commit880f05d9261d4aa2184230e3c4feb877495de7a0 (patch)
tree0ea4dc2588fc9ad8f62317272acb2b60eb60b4d8
parent4a17d71d4f58ca2fbad31179f280f8894780a1dc (diff)
parent4b54cc4dacc502a583d864e49faf122272746a09 (diff)
Merge pull request #416 from endlessm/issues/357
Issues/357
-rw-r--r--test/Makefile.am13
-rw-r--r--test/test-application.c9
2 files changed, 14 insertions, 8 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index c2f68a7..81cae8c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -33,23 +33,19 @@ test_flexy_grid_LDADD = $(TEST_LIBS)
javascript_tests = \
test/tools/eos-run-test/sanitycheck.js \
+ test/webhelper/testTranslate.js \
+ test/webhelper/testWebActions.js \
test/wikipedia/models/testCategoryModel.js \
test/wikipedia/models/testArticleModel.js \
test/wikipedia/models/testDomainWikiModel.js \
$(NULL)
-# Disabled until post Echo release:
-# test/webhelper/testTranslate.js
-# test/webhelper/testWebActions.js
-
EXTRA_DIST += $(javascript_tests)
# Run tests when running 'make check'
TESTS = \
+ test/run-tests \
$(javascript_tests) \
$(NULL)
-# Disabled until post Echo release:
-# test/run-tests
-
TEST_EXTENSIONS = .js
JS_LOG_COMPILER = tools/eos-run-test
AM_JS_LOG_FLAGS = \
@@ -61,7 +57,10 @@ AM_LOG_FLAGS = -k --verbose
# Use locally built versions of Endless-0.gir and libraries; this may need to be
# changed to AM_TESTS_ENVIRONMENT in a future version of Automake
+# Set XDG_CONFIG_HOME so as to avoid cluttering the user's actual config
+# directory with junk from the tests
TESTS_ENVIRONMENT = \
export GI_TYPELIB_PATH="$(top_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}"; \
export LD_LIBRARY_PATH="$(top_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}"; \
+ export XDG_CONFIG_HOME=`mktemp -d $${TMPDIR:-/tmp}/sdktestconfig.XXXXXXXX`; \
$(NULL)
diff --git a/test/test-application.c b/test/test-application.c
index 065f3f8..75165d4 100644
--- a/test/test-application.c
+++ b/test/test-application.c
@@ -76,6 +76,8 @@ test_config_dir_returns_expected_path (ConfigDirFixture *fixture,
gconstpointer unused)
{
GFile *config_dir = eos_application_get_config_dir (fixture->app);
+ /* XDG_CONFIG_HOME may be a relative path, so resolve it via file handles */
+ GFile *xdg_user_config_dir = g_file_new_for_path (g_get_user_config_dir ());
char *basename = g_file_get_basename (config_dir);
g_assert_cmpstr (basename, ==, fixture->unique_id);
@@ -84,8 +86,13 @@ test_config_dir_returns_expected_path (ConfigDirFixture *fixture,
GFile *parent = g_file_get_parent (config_dir);
char *dirname = g_file_get_path (parent);
g_object_unref (parent);
- g_assert_cmpstr (dirname, ==, g_get_user_config_dir ());
+
+ char *xdg_dirname = g_file_get_path (xdg_user_config_dir);
+ g_object_unref (xdg_user_config_dir);
+
+ g_assert_cmpstr (dirname, ==, xdg_dirname);
g_free (dirname);
+ g_free (xdg_dirname);
}
static void