summaryrefslogtreecommitdiff
path: root/test.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-12-06 22:02:46 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-12-06 22:02:46 +0000
commita3f0af934e387ba259919f0b72b42120eef3bc5c (patch)
treedf9cff822523331cad30742ddb34056544c7a80d /test.cpp
parentf8840dc745d13414205c944b2ffc0796837340f5 (diff)
downloadcryptopp-a3f0af934e387ba259919f0b72b42120eef3bc5c.tar.gz
add script-driven testing
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@24 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'test.cpp')
-rw-r--r--test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test.cpp b/test.cpp
index 77719fe..926d98d 100644
--- a/test.cpp
+++ b/test.cpp
@@ -19,6 +19,7 @@
#include "osrng.h"
#include "wait.h"
#include "fips140.h"
+#include "factory.h"
#include "validate.h"
#include "bench.h"
@@ -78,6 +79,11 @@ void FIPS140_GenerateRandomFiles();
bool Validate(int, bool, const char *);
+void RegisterFactories();
+bool RunTestDataFile(const char *filename);
+
+int (*AdhocTest)(int argc, char *argv[]) = NULL;
+
#ifdef __BCPLUSPLUS__
int cmain(int argc, char *argv[])
#elif defined(_MSC_VER)
@@ -199,6 +205,10 @@ int main(int argc, char *argv[])
return 0;
case 't':
{
+ if (command == "tv")
+ {
+ return !RunTestDataFile(argv[2]);
+ }
// VC60 workaround: use char array instead of std::string to workaround MSVC's getline bug
char passPhrase[MAX_PHRASE_LENGTH], plaintext[1024];
@@ -277,6 +287,11 @@ int main(int argc, char *argv[])
else if (command == "ft")
ForwardTcpPort(argv[2], argv[3], argv[4]);
return 0;
+ case 'a':
+ if (AdhocTest)
+ return (*AdhocTest)(argc, argv);
+ else
+ return 0;
default:
FileSource usage("usage.dat", true, new FileSink(cout));
return 1;