aboutsummaryrefslogtreecommitdiff
path: root/src/test/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-01-13 16:34:28 -0500
committerNick Mathewson <nickm@torproject.org>2014-01-17 11:58:09 -0500
commitab0fdbb618f52effad41625e88ee341e402a4d6d (patch)
treec36d31b533109c4e9b68bff089c33bf7910c387f /src/test/test.c
parent682c2252a564be67fd4fa817d535df0ddc1c758a (diff)
downloadtor-ab0fdbb618f52effad41625e88ee341e402a4d6d.tar
tor-ab0fdbb618f52effad41625e88ee341e402a4d6d.tar.gz
Add an --accel switch to run unit tests with crypto acceleration
Diffstat (limited to 'src/test/test.c')
-rw-r--r--src/test/test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 6ea41b140..9b474e9e9 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1660,6 +1660,7 @@ main(int c, const char **v)
char *errmsg = NULL;
int i, i_out;
int loglevel = LOG_ERR;
+ int accel_crypto = 0;
#ifdef USE_DMALLOC
{
@@ -1682,6 +1683,8 @@ main(int c, const char **v)
loglevel = LOG_INFO;
} else if (!strcmp(v[i], "--debug")) {
loglevel = LOG_DEBUG;
+ } else if (!strcmp(v[i], "--accel")) {
+ accel_crypto = 1;
} else {
v[i_out++] = v[i];
}
@@ -1696,7 +1699,7 @@ main(int c, const char **v)
}
options->command = CMD_RUN_UNITTESTS;
- if (crypto_global_init(0, NULL, NULL)) {
+ if (crypto_global_init(accel_crypto, NULL, NULL)) {
printf("Can't initialize crypto subsystem; exiting.\n");
return 1;
}