From: Chandra Pratap <chandrapratap3519@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Patrick Steinhardt <ps@pks.im>,
Christian Couder <chriscool@tuxfamily.org>,
Chandra Pratap <chandrapratap3519@gmail.com>
Subject: [PATCH v5 7/7] t: clean up leftover reftable test cruft
Date: Fri, 6 Sep 2024 16:59:16 +0530 [thread overview]
Message-ID: <20240906113746.8903-8-chandrapratap3519@gmail.com> (raw)
In-Reply-To: <20240906113746.8903-1-chandrapratap3519@gmail.com>
From: Junio C Hamano <gitster@pobox.com>
With the migration of reftable tests to the unit-tests framework,
"test-tool reftable" becomes a no-op.
Get rid of everything that uses "test-tool reftable" alongside
everything that is used to implement it.
While at it, alphabetically sort the cmds[] list in
helper/test-tool.c by moving the entry for "dump-reftable".
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
---
Makefile | 2 --
reftable/reftable-tests.h | 13 --------
reftable/test_framework.c | 27 ----------------
reftable/test_framework.h | 61 ------------------------------------
t/helper/test-reftable.c | 7 -----
t/helper/test-tool.c | 3 +-
t/helper/test-tool.h | 1 -
t/t0032-reftable-unittest.sh | 16 ----------
8 files changed, 1 insertion(+), 129 deletions(-)
delete mode 100644 reftable/reftable-tests.h
delete mode 100644 reftable/test_framework.c
delete mode 100644 reftable/test_framework.h
delete mode 100755 t/t0032-reftable-unittest.sh
diff --git a/Makefile b/Makefile
index 1cbc2d61ae..64ccb1433f 100644
--- a/Makefile
+++ b/Makefile
@@ -2692,8 +2692,6 @@ REFTABLE_OBJS += reftable/stack.o
REFTABLE_OBJS += reftable/tree.o
REFTABLE_OBJS += reftable/writer.o
-REFTABLE_TEST_OBJS += reftable/test_framework.o
-
TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
.PHONY: test-objs
diff --git a/reftable/reftable-tests.h b/reftable/reftable-tests.h
deleted file mode 100644
index 05f8d2d5bc..0000000000
--- a/reftable/reftable-tests.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-Copyright 2020 Google LLC
-
-Use of this source code is governed by a BSD-style
-license that can be found in the LICENSE file or at
-https://developers.google.com/open-source/licenses/bsd
-*/
-
-#ifndef REFTABLE_TESTS_H
-#define REFTABLE_TESTS_H
-
-
-#endif
diff --git a/reftable/test_framework.c b/reftable/test_framework.c
deleted file mode 100644
index a07fec5d84..0000000000
--- a/reftable/test_framework.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Copyright 2020 Google LLC
-
-Use of this source code is governed by a BSD-style
-license that can be found in the LICENSE file or at
-https://developers.google.com/open-source/licenses/bsd
-*/
-
-#include "system.h"
-#include "test_framework.h"
-
-
-void set_test_hash(uint8_t *p, int i)
-{
- memset(p, (uint8_t)i, hash_size(GIT_SHA1_FORMAT_ID));
-}
-
-ssize_t strbuf_add_void(void *b, const void *data, size_t sz)
-{
- strbuf_add(b, data, sz);
- return sz;
-}
-
-int noop_flush(void *arg UNUSED)
-{
- return 0;
-}
diff --git a/reftable/test_framework.h b/reftable/test_framework.h
deleted file mode 100644
index 687390f9c2..0000000000
--- a/reftable/test_framework.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-Copyright 2020 Google LLC
-
-Use of this source code is governed by a BSD-style
-license that can be found in the LICENSE file or at
-https://developers.google.com/open-source/licenses/bsd
-*/
-
-#ifndef TEST_FRAMEWORK_H
-#define TEST_FRAMEWORK_H
-
-#include "system.h"
-#include "reftable-error.h"
-
-#define EXPECT_ERR(c) \
- do { \
- if (c != 0) { \
- fflush(stderr); \
- fflush(stdout); \
- fprintf(stderr, "%s: %d: error == %d (%s), want 0\n", \
- __FILE__, __LINE__, c, reftable_error_str(c)); \
- abort(); \
- } \
- } while (0)
-
-#define EXPECT_STREQ(a, b) \
- do { \
- if (strcmp(a, b)) { \
- fflush(stderr); \
- fflush(stdout); \
- fprintf(stderr, "%s:%d: %s (%s) != %s (%s)\n", __FILE__, \
- __LINE__, #a, a, #b, b); \
- abort(); \
- } \
- } while (0)
-
-#define EXPECT(c) \
- do { \
- if (!(c)) { \
- fflush(stderr); \
- fflush(stdout); \
- fprintf(stderr, "%s: %d: failed assertion %s\n", __FILE__, \
- __LINE__, #c); \
- abort(); \
- } \
- } while (0)
-
-#define RUN_TEST(f) \
- fprintf(stderr, "running %s\n", #f); \
- fflush(stderr); \
- f();
-
-void set_test_hash(uint8_t *p, int i);
-
-/* Like strbuf_add, but suitable for passing to reftable_new_writer
- */
-ssize_t strbuf_add_void(void *b, const void *data, size_t sz);
-
-int noop_flush(void *);
-
-#endif
diff --git a/t/helper/test-reftable.c b/t/helper/test-reftable.c
index d27d7ee798..29d4e9a755 100644
--- a/t/helper/test-reftable.c
+++ b/t/helper/test-reftable.c
@@ -6,15 +6,8 @@
#include "reftable/reftable-merged.h"
#include "reftable/reftable-reader.h"
#include "reftable/reftable-stack.h"
-#include "reftable/reftable-tests.h"
#include "test-tool.h"
-int cmd__reftable(int argc, const char **argv)
-{
- /* test from simple to complex. */
- return 0;
-}
-
static void print_help(void)
{
printf("usage: dump [-st] arg\n\n"
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index f8a67df7de..252fa5de63 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -26,6 +26,7 @@ static struct test_cmd cmds[] = {
{ "drop-caches", cmd__drop_caches },
{ "dump-cache-tree", cmd__dump_cache_tree },
{ "dump-fsmonitor", cmd__dump_fsmonitor },
+ { "dump-reftable", cmd__dump_reftable },
{ "dump-split-index", cmd__dump_split_index },
{ "dump-untracked-cache", cmd__dump_untracked_cache },
{ "env-helper", cmd__env_helper },
@@ -61,9 +62,7 @@ static struct test_cmd cmds[] = {
{ "read-graph", cmd__read_graph },
{ "read-midx", cmd__read_midx },
{ "ref-store", cmd__ref_store },
- { "reftable", cmd__reftable },
{ "rot13-filter", cmd__rot13_filter },
- { "dump-reftable", cmd__dump_reftable },
{ "regex", cmd__regex },
{ "repository", cmd__repository },
{ "revision-walking", cmd__revision_walking },
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index e74bc0ffd4..84291318cb 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -55,7 +55,6 @@ int cmd__read_graph(int argc, const char **argv);
int cmd__read_midx(int argc, const char **argv);
int cmd__ref_store(int argc, const char **argv);
int cmd__rot13_filter(int argc, const char **argv);
-int cmd__reftable(int argc, const char **argv);
int cmd__regex(int argc, const char **argv);
int cmd__repository(int argc, const char **argv);
int cmd__revision_walking(int argc, const char **argv);
diff --git a/t/t0032-reftable-unittest.sh b/t/t0032-reftable-unittest.sh
deleted file mode 100755
index 471cb37ac2..0000000000
--- a/t/t0032-reftable-unittest.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2020 Google LLC
-#
-
-test_description='reftable unittests'
-
-TEST_PASSES_SANITIZE_LEAK=true
-. ./test-lib.sh
-
-test_expect_success 'unittests' '
- TMPDIR=$(pwd) && export TMPDIR &&
- test-tool reftable
-'
-
-test_done
--
2.45.GIT
next prev parent reply other threads:[~2024-09-06 11:45 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 14:13 [GSoC][PATCH 0/6] t: port reftable/stack_test.c to the unit testing framework Chandra Pratap
2024-08-06 14:13 ` [PATCH 1/6] t: move " Chandra Pratap
2024-08-06 14:13 ` [PATCH 2/6] t: harmonize t-reftable-stack.c with coding guidelines Chandra Pratap
2024-08-06 18:20 ` Eric Sunshine
2024-08-07 5:23 ` Patrick Steinhardt
2024-08-06 14:13 ` [PATCH 3/6] t-reftable-stack: use Git's tempfile API instead of mkstemp() Chandra Pratap
2024-08-06 20:47 ` Junio C Hamano
2024-08-07 5:23 ` Patrick Steinhardt
2024-08-06 14:13 ` [PATCH 4/6] t-reftable-stack: use reftable_ref_record_equal() to compare ref records Chandra Pratap
2024-08-07 5:23 ` Patrick Steinhardt
2024-08-07 14:42 ` Chandra Pratap
2024-08-08 4:07 ` Patrick Steinhardt
2024-08-06 14:13 ` [PATCH 5/6] t-reftable-stack: add test for non-default compaction factor Chandra Pratap
2024-08-06 14:13 ` [PATCH 6/6] t-reftable-stack: add test for stack iterators Chandra Pratap
2024-08-07 5:23 ` Patrick Steinhardt
2024-08-06 20:38 ` [GSoC][PATCH 0/6] t: port reftable/stack_test.c to the unit testing framework Junio C Hamano
2024-08-07 13:01 ` Chandra Pratap
2024-08-23 11:48 ` [GSoC][PATCH v2 " Chandra Pratap
2024-08-23 11:48 ` [PATCH v2 1/6] t: move " Chandra Pratap
2024-08-23 11:48 ` [PATCH v2 2/6] t: harmonize t-reftable-stack.c with coding guidelines Chandra Pratap
2024-08-26 6:39 ` Patrick Steinhardt
2024-08-23 11:48 ` [PATCH v2 3/6] t-reftable-stack: use Git's tempfile API instead of mkstemp() Chandra Pratap
2024-08-23 11:48 ` [PATCH v2 4/6] t-reftable-stack: use reftable_ref_record_equal() to compare ref records Chandra Pratap
2024-08-23 11:48 ` [PATCH v2 5/6] t-reftable-stack: add test for non-default compaction factor Chandra Pratap
2024-08-23 11:48 ` [PATCH v2 6/6] t-reftable-stack: add test for stack iterators Chandra Pratap
2024-08-26 6:39 ` Patrick Steinhardt
2024-08-26 17:29 ` [GSoC][PATCH v3 0/6] t: port reftable/stack_test.c to the unit testing framework Chandra Pratap
2024-08-26 17:29 ` [PATCH v3 1/6] t: move " Chandra Pratap
2024-08-26 17:29 ` [PATCH v3 2/6] t: harmonize t-reftable-stack.c with coding guidelines Chandra Pratap
2024-08-26 17:29 ` [PATCH v3 3/6] t-reftable-stack: use Git's tempfile API instead of mkstemp() Chandra Pratap
2024-08-26 17:29 ` [PATCH v3 4/6] t-reftable-stack: use reftable_ref_record_equal() to compare ref records Chandra Pratap
2024-08-26 17:29 ` [PATCH v3 5/6] t-reftable-stack: add test for non-default compaction factor Chandra Pratap
2024-08-26 17:29 ` [PATCH v3 6/6] t-reftable-stack: add test for stack iterators Chandra Pratap
2024-08-26 17:48 ` [GSoC][PATCH v3 0/6] t: port reftable/stack_test.c to the unit testing framework Junio C Hamano
2024-08-26 18:34 ` Chandra Pratap
2024-08-26 19:07 ` Junio C Hamano
2024-08-26 19:26 ` Junio C Hamano
2024-09-04 14:38 ` [GSoC][PATCH v4 " Chandra Pratap
2024-09-04 14:38 ` [PATCH v4 1/6] t: move " Chandra Pratap
2024-09-04 17:17 ` Junio C Hamano
2024-09-05 7:15 ` Patrick Steinhardt
2024-09-05 14:45 ` Chandra Pratap
2024-09-05 15:00 ` Patrick Steinhardt
2024-09-05 18:42 ` Junio C Hamano
2024-09-06 6:02 ` Patrick Steinhardt
2024-09-04 14:38 ` [PATCH v4 2/6] t: harmonize t-reftable-stack.c with coding guidelines Chandra Pratap
2024-09-04 14:38 ` [PATCH v4 3/6] t-reftable-stack: use Git's tempfile API instead of mkstemp() Chandra Pratap
2024-09-05 7:14 ` Patrick Steinhardt
2024-09-04 14:38 ` [PATCH v4 4/6] t-reftable-stack: use reftable_ref_record_equal() to compare ref records Chandra Pratap
2024-09-05 7:15 ` Patrick Steinhardt
2024-09-04 14:38 ` [PATCH v4 5/6] t-reftable-stack: add test for non-default compaction factor Chandra Pratap
2024-09-04 14:38 ` [PATCH v4 6/6] t-reftable-stack: add test for stack iterators Chandra Pratap
2024-09-05 7:15 ` Patrick Steinhardt
2024-09-06 11:29 ` [GSoC][PATCH v5 0/7] t: port reftable/stack_test.c to the unit testing framework Chandra Pratap
2024-09-06 11:29 ` [PATCH v5 1/7] t: move " Chandra Pratap
2024-09-06 11:29 ` [PATCH v5 2/7] t: harmonize t-reftable-stack.c with coding guidelines Chandra Pratap
2024-09-06 11:29 ` [PATCH v5 3/7] t-reftable-stack: use Git's tempfile API instead of mkstemp() Chandra Pratap
2024-09-06 11:29 ` [PATCH v5 4/7] t-reftable-stack: use reftable_ref_record_equal() to compare ref records Chandra Pratap
2024-09-06 11:29 ` [PATCH v5 5/7] t-reftable-stack: add test for non-default compaction factor Chandra Pratap
2024-09-06 11:29 ` [PATCH v5 6/7] t-reftable-stack: add test for stack iterators Chandra Pratap
2024-09-06 11:29 ` Chandra Pratap [this message]
2024-09-06 16:38 ` [GSoC][PATCH v5 0/7] t: port reftable/stack_test.c to the unit testing framework Junio C Hamano
2024-09-06 23:57 ` Junio C Hamano
2024-09-08 4:05 ` [GSoC][PATCH v6 0/6] " Chandra Pratap
2024-09-08 4:05 ` [PATCH v6 1/6] t: move " Chandra Pratap
2024-09-08 4:05 ` [PATCH v6 2/6] t: harmonize t-reftable-stack.c with coding guidelines Chandra Pratap
2024-09-08 4:05 ` [PATCH v6 3/6] t-reftable-stack: use Git's tempfile API instead of mkstemp() Chandra Pratap
2024-09-08 4:05 ` [PATCH v6 4/6] t-reftable-stack: use reftable_ref_record_equal() to compare ref records Chandra Pratap
2024-09-09 11:42 ` Patrick Steinhardt
2024-09-08 4:06 ` [PATCH v6 5/6] t-reftable-stack: add test for non-default compaction factor Chandra Pratap
2024-09-08 4:06 ` [PATCH v6 6/6] t-reftable-stack: add test for stack iterators Chandra Pratap
2024-09-09 11:42 ` [GSoC][PATCH v6 0/6] t: port reftable/stack_test.c to the unit testing framework Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240906113746.8903-8-chandrapratap3519@gmail.com \
--to=chandrapratap3519@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).