Cleanup of the test code that looks for the WolfSSL root directory. Now it tries to open the certs/ntru-cert.pem file in each directory up (limited to 5) until it opens it.

This commit is contained in:
David Garske
2015-10-28 23:54:08 -07:00
parent d31cec0df0
commit f977caa492
7 changed files with 42 additions and 123 deletions

View File

@@ -29,24 +29,6 @@
#include <wolfssl/test.h>
#include "wolfcrypt/test/test.h"
/* This function changes the current directory to the wolfssl root */
static void ChangeDirToRoot(void)
{
/* Normal Command Line=_build, Visual Studio=testsuite */
if (CurrentDir("testsuite") || CurrentDir("_build")) {
ChangeDirBack(1);
}
/* Xcode: To output application to correct location: */
/* 1. Xcode->Preferences->Locations->Locations */
/* 2. Derived Data Advanced -> Custom */
/* 3. Relative to Workspace, Build/Products */
/* Build/Products/Debug or Build/Products/Release */
else if (CurrentDir("Debug") || CurrentDir("Release")) {
ChangeDirBack(5);
}
}
#ifndef SINGLE_THREADED
@@ -118,7 +100,7 @@ int testsuite_test(int argc, char** argv)
#endif
#if !defined(WOLFSSL_TIRTOS)
ChangeDirToRoot();
ChangeToWolfRoot();
#endif
#ifdef WOLFSSL_TIRTOS
@@ -431,7 +413,7 @@ int main(int argc, char** argv)
server_args.argc = argc;
server_args.argv = argv;
ChangeDirToRoot();
ChangeToWolfRoot();
wolfcrypt_test(&server_args);
if (server_args.return_code != 0) return server_args.return_code;