mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Add an --accel switch to run unit tests with crypto acceleration
This commit is contained in:
parent
682c2252a5
commit
ab0fdbb618
@ -1660,6 +1660,7 @@ main(int c, const char **v)
|
|||||||
char *errmsg = NULL;
|
char *errmsg = NULL;
|
||||||
int i, i_out;
|
int i, i_out;
|
||||||
int loglevel = LOG_ERR;
|
int loglevel = LOG_ERR;
|
||||||
|
int accel_crypto = 0;
|
||||||
|
|
||||||
#ifdef USE_DMALLOC
|
#ifdef USE_DMALLOC
|
||||||
{
|
{
|
||||||
@ -1682,6 +1683,8 @@ main(int c, const char **v)
|
|||||||
loglevel = LOG_INFO;
|
loglevel = LOG_INFO;
|
||||||
} else if (!strcmp(v[i], "--debug")) {
|
} else if (!strcmp(v[i], "--debug")) {
|
||||||
loglevel = LOG_DEBUG;
|
loglevel = LOG_DEBUG;
|
||||||
|
} else if (!strcmp(v[i], "--accel")) {
|
||||||
|
accel_crypto = 1;
|
||||||
} else {
|
} else {
|
||||||
v[i_out++] = v[i];
|
v[i_out++] = v[i];
|
||||||
}
|
}
|
||||||
@ -1696,7 +1699,7 @@ main(int c, const char **v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
options->command = CMD_RUN_UNITTESTS;
|
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");
|
printf("Can't initialize crypto subsystem; exiting.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user