null+****@clear*****
null+****@clear*****
2010年 7月 23日 (金) 07:01:58 JST
Nobuyoshi Nakada 2010-07-22 22:01:58 +0000 (Thu, 22 Jul 2010) New Revision: c509b46d139dc536012efaf4b28dda746aff866c Log: use build_dir as tmp. #370 Modified files: test/unit/core/test-cast-table.c test/unit/core/test-command-cache-limit.c test/unit/core/test-command-column-list.c test/unit/core/test-command-delete.c test/unit/core/test-command-load.c test/unit/core/test-command-select-prefix-search.c test/unit/core/test-command-select-sort.c test/unit/core/test-command-select.c test/unit/core/test-database-create.c test/unit/core/test-database.c test/unit/core/test-dump.c test/unit/core/test-expr-parse.c test/unit/core/test-expr-query.c test/unit/core/test-expr-script.c test/unit/core/test-expr.c test/unit/core/test-function-cast.c test/unit/core/test-hash.h test/unit/core/test-inspect.c test/unit/core/test-inverted-index.c test/unit/core/test-log.c test/unit/core/test-patricia-trie.h test/unit/core/test-performance.c test/unit/core/test-public-context.c test/unit/core/test-register.c test/unit/core/test-store-ja.c test/unit/core/test-stress.c test/unit/core/test-table-patricia-trie-cursor.c test/unit/core/test-table-patricia-trie-sort.c test/unit/core/test-table-select-normalize.c test/unit/core/test-table-select.c test/unit/core/test-table-sort-key-from-str.c test/unit/core/test-table.c test/unit/core/test-view-operations.c test/unit/core/test-view.c test/unit/lib/grn-test-server.c test/unit/lib/grn-test-utils.c test/unit/run-test.sh test/unit/story/taiyaki/test-geo.c Modified: test/unit/core/test-cast-table.c (+1 -2) =================================================================== --- test/unit/core/test-cast-table.c 2010-07-22 09:26:31 +0000 (29e08b8) +++ test/unit/core/test-cast-table.c 2010-07-22 22:01:58 +0000 (87b069c) @@ -36,8 +36,7 @@ static grn_id users, daijiro; static void setup_database(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), NULL); database_path = g_build_filename(tmp_directory, "cast-table.db", Modified: test/unit/core/test-command-cache-limit.c (+1 -2) =================================================================== --- test/unit/core/test-command-cache-limit.c 2010-07-22 09:26:31 +0000 (01e9829) +++ test/unit/core/test-command-cache-limit.c 2010-07-22 22:01:58 +0000 (2931d88) @@ -37,8 +37,7 @@ static uint32_t default_cache_n_entries; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "cache-limit", NULL); default_cache_n_entries = *grn_cache_max_nentries(); Modified: test/unit/core/test-command-column-list.c (+1 -2) =================================================================== --- test/unit/core/test-command-column-list.c 2010-07-22 09:26:31 +0000 (70561bf) +++ test/unit/core/test-command-column-list.c 2010-07-22 22:01:58 +0000 (fadc50d) @@ -37,8 +37,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "column-list", NULL); } Modified: test/unit/core/test-command-delete.c (+1 -2) =================================================================== --- test/unit/core/test-command-delete.c 2010-07-22 09:26:31 +0000 (426d6bf) +++ test/unit/core/test-command-delete.c 2010-07-22 22:01:58 +0000 (c0bae5f) @@ -34,8 +34,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "command-delete", NULL); } Modified: test/unit/core/test-command-load.c (+1 -2) =================================================================== --- test/unit/core/test-command-load.c 2010-07-22 09:26:31 +0000 (e6650ce) +++ test/unit/core/test-command-load.c 2010-07-22 22:01:58 +0000 (7a124e1) @@ -39,8 +39,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "load", NULL); } Modified: test/unit/core/test-command-select-prefix-search.c (+1 -2) =================================================================== --- test/unit/core/test-command-select-prefix-search.c 2010-07-22 09:26:31 +0000 (c6adbc6) +++ test/unit/core/test-command-select-prefix-search.c 2010-07-22 22:01:58 +0000 (76e1536) @@ -34,8 +34,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "command-select-prefix-search", NULL); } Modified: test/unit/core/test-command-select-sort.c (+1 -2) =================================================================== --- test/unit/core/test-command-select-sort.c 2010-07-22 09:26:31 +0000 (fec9581) +++ test/unit/core/test-command-select-sort.c 2010-07-22 22:01:58 +0000 (3c03eff) @@ -36,8 +36,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "command-select-sort", NULL); } Modified: test/unit/core/test-command-select.c (+1 -2) =================================================================== --- test/unit/core/test-command-select.c 2010-07-22 09:26:31 +0000 (35f2498) +++ test/unit/core/test-command-select.c 2010-07-22 22:01:58 +0000 (f74190a) @@ -42,8 +42,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "command-select", NULL); } Modified: test/unit/core/test-database-create.c (+1 -2) =================================================================== --- test/unit/core/test-database-create.c 2010-07-22 09:26:31 +0000 (598748b) +++ test/unit/core/test-database-create.c 2010-07-22 22:01:58 +0000 (18cab51) @@ -37,8 +37,7 @@ static grn_db_create_optarg *options; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "function-cast", NULL); } Modified: test/unit/core/test-database.c (+1 -2) =================================================================== --- test/unit/core/test-database.c 2010-07-22 09:26:31 +0000 (6fb9bef) +++ test/unit/core/test-database.c 2010-07-22 22:01:58 +0000 (3c3cb65) @@ -40,8 +40,7 @@ static grn_obj *database, *database2; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-database", NULL); } Modified: test/unit/core/test-dump.c (+1 -2) =================================================================== --- test/unit/core/test-dump.c 2010-07-22 09:26:31 +0000 (356afa1) +++ test/unit/core/test-dump.c 2010-07-22 22:01:58 +0000 (aa7c457) @@ -46,8 +46,7 @@ static gchar *database_path; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-database", NULL); database_path = g_build_filename(tmp_directory, "database.groonga", NULL); Modified: test/unit/core/test-expr-parse.c (+1 -2) =================================================================== --- test/unit/core/test-expr-parse.c 2010-07-22 09:26:31 +0000 (32bc44b) +++ test/unit/core/test-expr-parse.c 2010-07-22 22:01:58 +0000 (bcfdf12) @@ -51,8 +51,7 @@ void test_syntax_equal_string_reference_key(void); void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-expr-parse", NULL); } Modified: test/unit/core/test-expr-query.c (+1 -2) =================================================================== --- test/unit/core/test-expr-query.c 2010-07-22 09:26:31 +0000 (bf1be0b) +++ test/unit/core/test-expr-query.c 2010-07-22 22:01:58 +0000 (9f728f8) @@ -39,8 +39,7 @@ void test_allow_update(gconstpointer data); void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-expr-query", NULL); } Modified: test/unit/core/test-expr-script.c (+1 -2) =================================================================== --- test/unit/core/test-expr-script.c 2010-07-22 09:26:31 +0000 (366f0df) +++ test/unit/core/test-expr-script.c 2010-07-22 22:01:58 +0000 (b8a98ef) @@ -51,8 +51,7 @@ void test_valid(gconstpointer data); void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-expr-script", NULL); } Modified: test/unit/core/test-expr.c (+1 -2) =================================================================== --- test/unit/core/test-expr.c 2010-07-22 09:26:31 +0000 (beccba3) +++ test/unit/core/test-expr.c 2010-07-22 22:01:58 +0000 (ab4a818) @@ -38,8 +38,7 @@ void test_expr_query(void); void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-expr", NULL); } Modified: test/unit/core/test-function-cast.c (+1 -2) =================================================================== --- test/unit/core/test-function-cast.c 2010-07-22 09:26:31 +0000 (ec4b7a4) +++ test/unit/core/test-function-cast.c 2010-07-22 22:01:58 +0000 (5591e13) @@ -34,8 +34,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "function-cast", NULL); } Modified: test/unit/core/test-hash.h (+1 -1) =================================================================== --- test/unit/core/test-hash.h 2010-07-22 09:26:31 +0000 (02fe77d) +++ test/unit/core/test-hash.h 2010-07-22 22:01:58 +0000 (afc3db1) @@ -85,7 +85,7 @@ setup_hash_common(const gchar *default_path_component) sample_value = cut_take_string(g_strdup("hash test")); sample_id = GRN_ID_NIL; - base_dir = g_build_filename(grn_test_get_base_dir(), "tmp", NULL); + base_dir = grn_test_get_tmp_dir(); default_path = g_build_filename(base_dir, "hash", NULL); grn_test_hash_factory_set_path(factory, default_path); g_free(default_path); Modified: test/unit/core/test-inspect.c (+1 -2) =================================================================== --- test/unit/core/test-inspect.c 2010-07-22 09:26:31 +0000 (fb198f7) +++ test/unit/core/test-inspect.c 2010-07-22 22:01:58 +0000 (a58e73e) @@ -88,8 +88,7 @@ static grn_obj *record; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "inspect", NULL); } Modified: test/unit/core/test-inverted-index.c (+1 -2) =================================================================== --- test/unit/core/test-inverted-index.c 2010-07-22 09:26:31 +0000 (7272a27) +++ test/unit/core/test-inverted-index.c 2010-07-22 22:01:58 +0000 (15aca3c) @@ -56,8 +56,7 @@ static grn_vgram *vgram; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-inverted-index", NULL); } Modified: test/unit/core/test-log.c (+1 -2) =================================================================== --- test/unit/core/test-log.c 2010-07-22 09:26:31 +0000 (e1d1be4) +++ test/unit/core/test-log.c 2010-07-22 22:01:58 +0000 (14f2da9) @@ -34,8 +34,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "log", NULL); } Modified: test/unit/core/test-patricia-trie.h (+1 -1) =================================================================== --- test/unit/core/test-patricia-trie.h 2010-07-22 09:26:31 +0000 (6036eed) +++ test/unit/core/test-patricia-trie.h 2010-07-22 22:01:58 +0000 (9ceac09) @@ -71,7 +71,7 @@ setup_trie_common(const gchar *default_path_component) sample_value = cut_take_string(g_strdup("patricia trie test")); sample_id = GRN_ID_NIL; - base_dir = g_build_filename(grn_test_get_base_dir(), "tmp", NULL); + base_dir = grn_test_get_tmp_dir(); default_path = g_build_filename(base_dir, default_path_component, NULL); default_key_size = GRN_PAT_MAX_KEY_SIZE / 2; default_value_size = DEFAULT_VALUE_SIZE; Modified: test/unit/core/test-performance.c (+1 -1) =================================================================== --- test/unit/core/test-performance.c 2010-07-22 09:26:31 +0000 (55cb411) +++ test/unit/core/test-performance.c 2010-07-22 22:01:58 +0000 (33f8040) @@ -92,7 +92,7 @@ cut_setup(void) #undef SAVE_ENV_VALUE - tmp_dir = g_build_filename(grn_test_get_base_dir(), "tmp", NULL); + tmp_dir = grn_test_get_tmp_dir(); cut_remove_path(tmp_dir, NULL); base_dir = g_build_filename(tmp_dir, "performance", NULL); Modified: test/unit/core/test-public-context.c (+1 -1) =================================================================== --- test/unit/core/test-public-context.c 2010-07-22 09:26:31 +0000 (01f6794) +++ test/unit/core/test-public-context.c 2010-07-22 22:01:58 +0000 (1bf1a29) @@ -39,7 +39,7 @@ cut_setup(void) db = NULL; context = g_new0(grn_ctx, 1); - base_dir = g_build_filename(grn_test_get_base_dir(), "tmp", NULL); + base_dir = grn_test_get_tmp_dir(); default_path = g_build_filename(base_dir, "db", NULL); default_encoding = GRN_ENC_DEFAULT; default_context_flags = GRN_CTX_USE_QL; Modified: test/unit/core/test-register.c (+1 -2) =================================================================== --- test/unit/core/test-register.c 2010-07-22 09:26:31 +0000 (f2c230f) +++ test/unit/core/test-register.c 2010-07-22 22:01:58 +0000 (7d28246) @@ -33,8 +33,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "register", NULL); } Modified: test/unit/core/test-store-ja.c (+1 -2) =================================================================== --- test/unit/core/test-store-ja.c 2010-07-22 09:26:31 +0000 (602b104) +++ test/unit/core/test-store-ja.c 2010-07-22 22:01:58 +0000 (9ec0b63) @@ -37,8 +37,7 @@ static grn_obj *vector; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "store-ja", NULL); } Modified: test/unit/core/test-stress.c (+1 -1) =================================================================== --- test/unit/core/test-stress.c 2010-07-22 09:26:31 +0000 (0a1c617) +++ test/unit/core/test-stress.c 2010-07-22 22:01:58 +0000 (0f5b5ad) @@ -60,7 +60,7 @@ cut_setup(void) #undef SAVE_ENV_VALUE - tmp_dir = g_build_filename(grn_test_get_base_dir(), "tmp", NULL); + tmp_dir = grn_test_get_tmp_dir(); cut_remove_path(tmp_dir, NULL); base_dir = g_build_filename(tmp_dir, "stress", NULL); Modified: test/unit/core/test-table-patricia-trie-cursor.c (+1 -2) =================================================================== --- test/unit/core/test-table-patricia-trie-cursor.c 2010-07-22 09:26:31 +0000 (68ec7c5) +++ test/unit/core/test-table-patricia-trie-cursor.c 2010-07-22 22:01:58 +0000 (dc99e44) @@ -57,8 +57,7 @@ static grn_table_cursor *cursor; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "table-patricia-trie-cursor", NULL); } Modified: test/unit/core/test-table-patricia-trie-sort.c (+1 -2) =================================================================== --- test/unit/core/test-table-patricia-trie-sort.c 2010-07-22 09:26:31 +0000 (e6ab0dc) +++ test/unit/core/test-table-patricia-trie-sort.c 2010-07-22 22:01:58 +0000 (fee5aae) @@ -53,8 +53,7 @@ static grn_table_cursor *cursor; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "table-patricia-trie-sort", NULL); } Modified: test/unit/core/test-table-select-normalize.c (+1 -2) =================================================================== --- test/unit/core/test-table-select-normalize.c 2010-07-22 09:26:31 +0000 (4e0d886) +++ test/unit/core/test-table-select-normalize.c 2010-07-22 22:01:58 +0000 (ee24606) @@ -31,8 +31,7 @@ static grn_obj *database, *comments, *content, *expression, *variable, *result; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-table-select-normalize", NULL); database_path = g_build_filename(tmp_directory, "database.groonga", NULL); Modified: test/unit/core/test-table-select.c (+1 -2) =================================================================== --- test/unit/core/test-table-select.c 2010-07-22 09:26:31 +0000 (ba542e4) +++ test/unit/core/test-table-select.c 2010-07-22 22:01:58 +0000 (6d67b68) @@ -44,8 +44,7 @@ void test_match_without_index(void); void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-table-select", NULL); } Modified: test/unit/core/test-table-sort-key-from-str.c (+1 -2) =================================================================== --- test/unit/core/test-table-sort-key-from-str.c 2010-07-22 09:26:31 +0000 (04d3cf4) +++ test/unit/core/test-table-sort-key-from-str.c 2010-07-22 22:01:58 +0000 (41a921e) @@ -37,8 +37,7 @@ static grn_obj *table; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "table-sort-key-from-str", NULL); } Modified: test/unit/core/test-table.c (+1 -2) =================================================================== --- test/unit/core/test-table.c 2010-07-22 09:26:31 +0000 (f42972d) +++ test/unit/core/test-table.c 2010-07-22 22:01:58 +0000 (1f0826c) @@ -46,8 +46,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-database", NULL); } Modified: test/unit/core/test-view-operations.c (+1 -2) =================================================================== --- test/unit/core/test-view-operations.c 2010-07-22 09:26:31 +0000 (c4690a8) +++ test/unit/core/test-view-operations.c 2010-07-22 22:01:58 +0000 (cbfa24f) @@ -36,8 +36,7 @@ static gchar *database_path; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-view", NULL); database_path = g_build_filename(tmp_directory, "database.groonga", NULL); Modified: test/unit/core/test-view.c (+1 -2) =================================================================== --- test/unit/core/test-view.c 2010-07-22 09:26:31 +0000 (9b06894) +++ test/unit/core/test-view.c 2010-07-22 22:01:58 +0000 (9bd9ac8) @@ -37,8 +37,7 @@ static gchar *database_path; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "test-view", NULL); database_path = g_build_filename(tmp_directory, "database.groonga", NULL); Modified: test/unit/lib/grn-test-server.c (+1 -1) =================================================================== --- test/unit/lib/grn-test-server.c 2010-07-22 09:26:31 +0000 (ab7178c) +++ test/unit/lib/grn-test-server.c 2010-07-22 22:01:58 +0000 (fbdf100) @@ -149,7 +149,7 @@ grn_test_server_ensure_base_directory(GrnTestServer *server, GError **error) if (priv->base_directory) return TRUE; - priv->base_directory = g_build_filename(grn_test_get_base_dir(), + priv->base_directory = g_build_filename(grn_test_get_tmp_dir(), "tmp-server", NULL); cut_utils_remove_path_recursive_force(priv->base_directory); if (g_mkdir_with_parents(priv->base_directory, 0700) == -1) { Modified: test/unit/lib/grn-test-utils.c (+11 -0) =================================================================== --- test/unit/lib/grn-test-utils.c 2010-07-22 09:26:31 +0000 (07fad99) +++ test/unit/lib/grn-test-utils.c 2010-07-22 22:01:58 +0000 (77b1e8a) @@ -218,6 +218,17 @@ grn_test_get_build_dir(void) return build_dir; } +static gchar *tmp_dir = NULL; +const gchar * +grn_test_get_tmp_dir(void) +{ + if (!tmp_dir) { + tmp_dir = g_build_filename(grn_test_get_build_dir(), "tmp", NULL); + } + + return tmp_dir; +} + typedef struct _grn_log { gint level; Modified: test/unit/run-test.sh (+1 -1) =================================================================== --- test/unit/run-test.sh 2010-07-22 09:26:31 +0000 (8c3d531) +++ test/unit/run-test.sh 2010-07-22 22:01:58 +0000 (dafdec3) @@ -7,7 +7,7 @@ fi export BUILD_DIR top_dir="$BUILD_DIR/../.." -top_dir=$(cd $top_dir; pwd) +top_dir=$(cd -P "$top_dir" 2>/dev/null || cd "$top_dir"; pwd) if test x"$NO_MAKE" != x"yes"; then make -C $top_dir > /dev/null || exit 1 Modified: test/unit/story/taiyaki/test-geo.c (+1 -2) =================================================================== --- test/unit/story/taiyaki/test-geo.c 2010-07-22 09:26:31 +0000 (0ec9e2a) +++ test/unit/story/taiyaki/test-geo.c 2010-07-22 22:01:58 +0000 (84e64cc) @@ -36,8 +36,7 @@ static grn_obj *database; void cut_startup(void) { - tmp_directory = g_build_filename(grn_test_get_base_dir(), - "tmp", + tmp_directory = g_build_filename(grn_test_get_tmp_dir(), "taiyaki-geo", NULL); }