Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mike Perry
Tor
Commits
da1aa66f
Commit
da1aa66f
authored
Sep 22, 2009
by
Nick Mathewson
🎨
Browse files
Move testing code into new src/test directory.
parent
d4b54549
Changes
13
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
da1aa66f
...
...
@@ -127,7 +127,13 @@
/src/or/or_sha1.i
/src/or/micro-revision.*
/src/or/tor
/src/or/test
/src/or/libtor.a
# /src/test
/src/test/Makefile
/src/test/Makefile.in
/src/test/test
# /src/tools/
/src/tools/tor-checkkey
...
...
Makefile.am
View file @
da1aa66f
...
...
@@ -59,14 +59,15 @@ doxygen:
doxygen
&&
cd
doc/doxygen/latex
&&
make
test
:
./src/
or
/test
./src/
test
/test
# Avoid strlcpy.c, strlcat.c, tree.h
check-spaces
:
./contrib/checkSpace.pl
-C
\
src/common/
*
.h
\
src/common/[^asO]
*
.c src/common/address.c
\
src/or/[^et]
*
.[ch] src/or/t[^i]
*
.c src/or/eventdns_tor.h
src/or/[^et]
*
.[ch] src/or/t
*
.c src/or/eventdns_tor.h
\
src/test/test
*
.[ch]
check-docs
:
./contrib/checkOptionDocs.pl
...
...
configure.in
View file @
da1aa66f
...
...
@@ -826,7 +826,7 @@ fi
CPPFLAGS="$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl $TOR_CPPFLAGS_zlib"
AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile doc/spec/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile contrib/suse/Makefile contrib/suse/tor.sh])
AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile doc/spec/Makefile src/config/Makefile src/common/Makefile src/or/Makefile
src/test/Makefile
src/win32/Makefile src/tools/Makefile contrib/suse/Makefile contrib/suse/tor.sh])
AC_OUTPUT
if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then
...
...
src/Makefile.am
View file @
da1aa66f
# leave in dependency order, since common must be built first
SUBDIRS
=
common or tools win32 config
DIST_SUBDIRS
=
common or tools win32 config
SUBDIRS
=
common or
test
tools win32 config
DIST_SUBDIRS
=
common or
test
tools win32 config
src/or/Makefile.am
View file @
da1aa66f
TESTS
=
test
noinst_PROGRAMS
=
test
bin_PROGRAMS
=
tor
noinst_LIBRARIES
=
libtor.a
if
BUILD_NT_SERVICES
tor_platform_source
=
ntmain.c
...
...
@@ -18,7 +15,7 @@ else
evdns_source
=
eventdns.c
endif
COMMON_SRC
=
buffers.c circuitbuild.c circuitlist.c
\
libtor_a_SOURCES
=
buffers.c circuitbuild.c circuitlist.c
\
circuituse.c command.c config.c
\
connection.c connection_edge.c connection_or.c control.c
\
cpuworker.c directory.c dirserv.c dirvote.c
\
...
...
@@ -28,7 +25,11 @@ COMMON_SRC = buffers.c circuitbuild.c circuitlist.c \
rendservice.c rephist.c router.c routerlist.c routerparse.c
\
$(evdns_source)
config_codedigest.c
tor_SOURCES
=
$(COMMON_SRC)
tor_main.c
#libtor_a_LIBADD = ../common/libor.a ../common/libor-crypto.a \
# ../common/libor-event.a
tor_SOURCES
=
tor_main.c
AM_CPPFLAGS
=
-DSHARE_DATADIR
=
"
\"
$(datadir)
\"
"
\
-DLOCALSTATEDIR
=
"
\"
$(localstatedir)
\"
"
\
...
...
@@ -39,21 +40,11 @@ AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \
# matters a lot there, and is quite hard to debug if you forget to do it.
tor_LDFLAGS
=
@TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
tor_LDADD
=
../common/libor.a ../common/libor-crypto.a
\
../common/libor-event.a
\
-lz
-lm
-levent
-lssl
-lcrypto
@TOR_LIB_WS32@ @TOR_LIB_GDI@
test_SOURCES
=
$(COMMON_SRC)
test_data.c test.c tinytest.c
test_LDFLAGS
=
@TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
\
@TOR_LDFLAGS_libevent@
test_LDADD
=
../common/libor.a ../common/libor-crypto.a
\
tor_LDADD
=
./libtor.a ../common/libor.a ../common/libor-crypto.a
\
../common/libor-event.a
\
-lz
-lm
-levent
-lssl
-lcrypto
@TOR_LIB_WS32@ @TOR_LIB_GDI@
noinst_HEADERS
=
or.h eventdns.h eventdns_tor.h micro-revision.i tinytest.h
\
tinytest_macros.h
EXTRA_DIST
=
tinytest_demo.c
noinst_HEADERS
=
or.h eventdns.h eventdns_tor.h micro-revision.i
config_codedigest.o
:
or_sha1.i
...
...
@@ -74,17 +65,15 @@ micro-revision.i: FORCE
mv
micro-revision.tmp micro-revision.i
;
\
fi
;
true
or_sha1.i
:
$(tor_SOURCES)
test_data.c test.c
or_sha1.i
:
$(tor_SOURCES)
if
test
"@SHA1SUM@"
!=
none
;
then
\
@SHA1SUM@
$(tor_SOURCES)
test_data.c test.c
| @SED@
-n
's/^\(.*\)$$/"\1\\n"/p'
>
or_sha1.i
;
\
@SHA1SUM@
$(tor_SOURCES)
| @SED@
-n
's/^\(.*\)$$/"\1\\n"/p'
>
or_sha1.i
;
\
elif
test
"@OPENSSL@"
!=
none
;
then
\
@OPENSSL@ sha1
$(tor_SOURCES)
test_data.c test.c
| @SED@
-n
's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p'
>
or_sha1.i
;
\
@OPENSSL@ sha1
$(tor_SOURCES)
| @SED@
-n
's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p'
>
or_sha1.i
;
\
else
\
rm
or_sha1.i
;
\
touch
or_sha1.i
;
\
fi
#Dummy target to ensure that micro-revision.i _always_ gets built.
FORCE
:
src/test/Makefile.am
0 → 100644
View file @
da1aa66f
TESTS
=
test
noinst_PROGRAMS
=
test
AM_CPPFLAGS
=
-DSHARE_DATADIR
=
"
\"
$(datadir)
\"
"
\
-DLOCALSTATEDIR
=
"
\"
$(localstatedir)
\"
"
\
-DBINDIR
=
"
\"
$(bindir)
\"
"
CFLAGS
+=
-I
../or
# -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
# This seems to matter nowhere but on windows, but I assure you that it
# matters a lot there, and is quite hard to debug if you forget to do it.
test_SOURCES
=
test_data.c test.c tinytest.c
test_LDFLAGS
=
@TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
\
@TOR_LDFLAGS_libevent@
test_LDADD
=
../or/libtor.a ../common/libor.a ../common/libor-crypto.a
\
../common/libor-event.a
\
-lz
-lm
-levent
-lssl
-lcrypto
@TOR_LIB_WS32@ @TOR_LIB_GDI@
noinst_HEADERS
=
tinytest.h tinytest_macros.h
EXTRA_DIST
=
tinytest_demo.c
src/
or
/test.c
→
src/
test
/test.c
View file @
da1aa66f
File moved
src/
or
/test.h
→
src/
test
/test.h
View file @
da1aa66f
File moved
src/
or
/test_data.c
→
src/
test
/test_data.c
View file @
da1aa66f
File moved
src/
or
/tinytest.c
→
src/
test
/tinytest.c
View file @
da1aa66f
File moved
src/
or
/tinytest.h
→
src/
test
/tinytest.h
View file @
da1aa66f
File moved
src/
or
/tinytest_demo.c
→
src/
test
/tinytest_demo.c
View file @
da1aa66f
File moved
src/
or
/tinytest_macros.h
→
src/
test
/tinytest_macros.h
View file @
da1aa66f
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment