aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-10-18 13:49:35 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-18 13:49:35 -0400
commit72b5e4a2db4282002fe50e11c2b8a79e108d30f8 (patch)
treefe3b853d65170b1d3c30df4a6d9553ae51c3fc64 /src/test
parentb9b5f9a1a5a683611789ffe4c49e41325102cabc (diff)
downloadtor-72b5e4a2db4282002fe50e11c2b8a79e108d30f8.tar.gz
tor-72b5e4a2db4282002fe50e11c2b8a79e108d30f8.zip
Move tor_git_revision into a new module.
At first, we put the tor_git_revision constant in tor_main.c, so that we wouldn't have to recompile config.o every time the git revision changed. But putting it there had unintended side effect of forcing every program that wanted to link libor.a (including test, test-slow, the fuzzers, the benchmarks, etc) to declare their own tor_git_revision instance. That's not very nice, especially since we want to start supporting others who want to link against Tor (see 23846). So, create a new git_revision.c file that only contains this constant, and remove the duplicated boilerplate from everywhere else. Part of implementing ticket 23845.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench.c5
-rw-r--r--src/test/fuzz/fuzzing_common.c3
-rw-r--r--src/test/testing_common.c6
3 files changed, 0 insertions, 14 deletions
diff --git a/src/test/bench.c b/src/test/bench.c
index b7b123eee2..f30b609900 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -3,11 +3,6 @@
* Copyright (c) 2007-2017, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-extern const char tor_git_revision[];
-/* Ordinarily defined in tor_main.c; this bit is just here to provide one
- * since we're not linking to tor_main.c */
-const char tor_git_revision[] = "";
-
/**
* \file bench.c
* \brief Benchmarks for lower level Tor modules.
diff --git a/src/test/fuzz/fuzzing_common.c b/src/test/fuzz/fuzzing_common.c
index 7aee92df63..cd88ce560f 100644
--- a/src/test/fuzz/fuzzing_common.c
+++ b/src/test/fuzz/fuzzing_common.c
@@ -9,9 +9,6 @@
#include "crypto.h"
#include "crypto_ed25519.h"
-extern const char tor_git_revision[];
-const char tor_git_revision[] = "";
-
static or_options_t *mock_options = NULL;
static const or_options_t *
mock_get_options(void)
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index 7e9c47b48d..e43fa46c84 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -3,12 +3,6 @@
* Copyright (c) 2007-2017, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-extern const char tor_git_revision[];
-
-/* Ordinarily defined in tor_main.c; this bit is just here to provide one
- * since we're not linking to tor_main.c */
-const char tor_git_revision[] = "";
-
/**
* \file test_common.c
* \brief Common pieces to implement unit tests.