test/src/SuiteMaker.cc
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Wed, 06 Feb 2019 07:17:26 +0100
branchsync
changeset 3270 d8aea79654c3
parent 3247 7019b507538c
parent 3265 0c1fc39abf15
child 3276 c0b3430f1f1d
child 3278 98f201d173cf
permissions -rw-r--r--
default with ENGINE-448 and ENGINE-510 merged in, tests updated
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 //
     5 // src/SuiteMaker.cc generated by gensuitemaker.py - changes may be overwritten. You've been warned!
     6 //
     7 
     8 #include <cpptest.h>
     9 #include <cpptest-suite.h>
    10 #include <memory>
    11 #include <vector>
    12 #include "SuiteMaker.h"
    13 
    14 // Begin where we generate stuff
    15 #include "MimeTests.h"
    16 #include "ExpiredSubkeyTests.h"
    17 #include "UserIdCollisionTests.h"
    18 #include "Engine463Tests.h"
    19 #include "BloblistTests.h"
    20 #include "NewUpdateIdAndMyselfTests.h"
    21 #include "I18nTests.h"
    22 #include "IdentityListTests.h"
    23 #include "PgpBinaryTests.h"
    24 #include "SubkeyRatingEvalTests.h"
    25 #include "MessageNullFromTests.h"
    26 #include "LeastCommonDenomColorTests.h"
    27 #include "StringlistTests.h"
    28 #include "PgpListKeysTests.h"
    29 #include "MessageApiTests.h"
    30 #include "EncryptMissingPrivateKeyTests.h"
    31 #include "CaseAndDotAddressTests.h"
    32 #include "UserIDAliasTests.h"
    33 #include "SignOnlyTests.h"
    34 #include "BCCTests.h"
    35 #include "Engine358Tests.h"
    36 #include "BlacklistAcceptNewKeyTests.h"
    37 #include "DecryptAttachPrivateKeyUntrustedTests.h"
    38 #include "ReturnMistrustFprTests.h"
    39 #include "BlacklistTests.h"
    40 #include "RevokeRegenAttachTests.h"
    41 #include "PepSubjectReceivedTests.h"
    42 #include "SequenceTests.h"
    43 #include "HeaderKeyImportTests.h"
    44 #include "EncryptAttachPrivateKeyTests.h"
    45 #include "ExternalRevokeTests.h"
    46 #include "KeyeditTests.h"
    47 #include "LeastColorGroupTests.h"
    48 #include "DecryptAttachPrivateKeyTrustedTests.h"
    49 #include "CheckRenewedExpiredKeyTrustStatusTests.h"
    50 #include "TrustwordsTests.h"
    51 #include "SimpleBodyNotAltTests.h"
    52 #include "ReencryptPlusExtraKeysTests.h"
    53 #include "MapAsn1Tests.h"
    54 #include "DecorateTests.h"
    55 #include "MessageTwoPointOhTests.h"
    56 #include "CrashdumpTests.h"
    57 #include "StringpairListTests.h"
    58 #include "EncryptForIdentityTests.h"
    59 #include "KeyResetMessageTests.h"
    60 #include "KeyAttachmentTests.h"
    61 #include "TrustManipulationTests.h"
    62 #include "SyncTests.h"
    63 #include "AppleMailTests.h"
    64 
    65 
    66 const char* SuiteMaker::all_suites[] = {
    67     "MimeTests",
    68     "ExpiredSubkeyTests",
    69     "UserIdCollisionTests",
    70     "Engine463Tests",
    71     "BloblistTests",
    72     "NewUpdateIdAndMyselfTests",
    73     "I18nTests",
    74     "IdentityListTests",
    75     "PgpBinaryTests",
    76     "SubkeyRatingEvalTests",
    77     "MessageNullFromTests",
    78     "LeastCommonDenomColorTests",
    79     "StringlistTests",
    80     "PgpListKeysTests",
    81     "MessageApiTests",
    82     "EncryptMissingPrivateKeyTests",
    83     "CaseAndDotAddressTests",
    84     "UserIDAliasTests",
    85     "SignOnlyTests",
    86     "BCCTests",
    87     "Engine358Tests",
    88     "BlacklistAcceptNewKeyTests",
    89     "DecryptAttachPrivateKeyUntrustedTests",
    90     "ReturnMistrustFprTests",
    91     "BlacklistTests",
    92     "RevokeRegenAttachTests",
    93     "PepSubjectReceivedTests",
    94     "SequenceTests",
    95     "HeaderKeyImportTests",
    96     "EncryptAttachPrivateKeyTests",
    97     "ExternalRevokeTests",
    98     "KeyeditTests",
    99     "LeastColorGroupTests",
   100     "DecryptAttachPrivateKeyTrustedTests",
   101     "CheckRenewedExpiredKeyTrustStatusTests",
   102     "TrustwordsTests",
   103     "SimpleBodyNotAltTests",
   104     "ReencryptPlusExtraKeysTests",
   105     "MapAsn1Tests",
   106     "DecorateTests",
   107     "MessageTwoPointOhTests",
   108     "CrashdumpTests",
   109     "StringpairListTests",
   110     "EncryptForIdentityTests",
   111     "KeyResetMessageTests",
   112     "KeyAttachmentTests",
   113     "TrustManipulationTests",
   114     "SyncTests",
   115     "AppleMailTests",
   116 };
   117 
   118 // This file is generated, so magic constants are ok.
   119 int SuiteMaker::num_suites = 49;
   120 
   121 void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
   122     if (strcmp(test_class_name, "MimeTests") == 0)
   123         *test_suite = new MimeTests(test_class_name, test_home);
   124     else if (strcmp(test_class_name, "ExpiredSubkeyTests") == 0)
   125         *test_suite = new ExpiredSubkeyTests(test_class_name, test_home);
   126     else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
   127         *test_suite = new UserIdCollisionTests(test_class_name, test_home);
   128     else if (strcmp(test_class_name, "Engine463Tests") == 0)
   129         *test_suite = new Engine463Tests(test_class_name, test_home);
   130     else if (strcmp(test_class_name, "BloblistTests") == 0)
   131         *test_suite = new BloblistTests(test_class_name, test_home);
   132     else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   133         *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   134     else if (strcmp(test_class_name, "I18nTests") == 0)
   135         *test_suite = new I18nTests(test_class_name, test_home);
   136     else if (strcmp(test_class_name, "IdentityListTests") == 0)
   137         *test_suite = new IdentityListTests(test_class_name, test_home);
   138     else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   139         *test_suite = new PgpBinaryTests(test_class_name, test_home);
   140     else if (strcmp(test_class_name, "SubkeyRatingEvalTests") == 0)
   141         *test_suite = new SubkeyRatingEvalTests(test_class_name, test_home);
   142     else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   143         *test_suite = new MessageNullFromTests(test_class_name, test_home);
   144     else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   145         *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   146     else if (strcmp(test_class_name, "StringlistTests") == 0)
   147         *test_suite = new StringlistTests(test_class_name, test_home);
   148     else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   149         *test_suite = new PgpListKeysTests(test_class_name, test_home);
   150     else if (strcmp(test_class_name, "MessageApiTests") == 0)
   151         *test_suite = new MessageApiTests(test_class_name, test_home);
   152     else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   153         *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   154     else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   155         *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   156     else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   157         *test_suite = new UserIDAliasTests(test_class_name, test_home);
   158     else if (strcmp(test_class_name, "SignOnlyTests") == 0)
   159         *test_suite = new SignOnlyTests(test_class_name, test_home);
   160     else if (strcmp(test_class_name, "BCCTests") == 0)
   161         *test_suite = new BCCTests(test_class_name, test_home);
   162     else if (strcmp(test_class_name, "Engine358Tests") == 0)
   163         *test_suite = new Engine358Tests(test_class_name, test_home);
   164     else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   165         *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   166     else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   167         *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   168     else if (strcmp(test_class_name, "ReturnMistrustFprTests") == 0)
   169         *test_suite = new ReturnMistrustFprTests(test_class_name, test_home);
   170     else if (strcmp(test_class_name, "BlacklistTests") == 0)
   171         *test_suite = new BlacklistTests(test_class_name, test_home);
   172     else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   173         *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   174     else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   175         *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   176     else if (strcmp(test_class_name, "SequenceTests") == 0)
   177         *test_suite = new SequenceTests(test_class_name, test_home);
   178     else if (strcmp(test_class_name, "HeaderKeyImportTests") == 0)
   179         *test_suite = new HeaderKeyImportTests(test_class_name, test_home);
   180     else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   181         *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   182     else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   183         *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   184     else if (strcmp(test_class_name, "KeyeditTests") == 0)
   185         *test_suite = new KeyeditTests(test_class_name, test_home);
   186     else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   187         *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   188     else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   189         *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   190     else if (strcmp(test_class_name, "CheckRenewedExpiredKeyTrustStatusTests") == 0)
   191         *test_suite = new CheckRenewedExpiredKeyTrustStatusTests(test_class_name, test_home);
   192     else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   193         *test_suite = new TrustwordsTests(test_class_name, test_home);
   194     else if (strcmp(test_class_name, "SimpleBodyNotAltTests") == 0)
   195         *test_suite = new SimpleBodyNotAltTests(test_class_name, test_home);
   196     else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   197         *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   198     else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   199         *test_suite = new MapAsn1Tests(test_class_name, test_home);
   200     else if (strcmp(test_class_name, "DecorateTests") == 0)
   201         *test_suite = new DecorateTests(test_class_name, test_home);
   202     else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   203         *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   204     else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   205         *test_suite = new CrashdumpTests(test_class_name, test_home);
   206     else if (strcmp(test_class_name, "StringpairListTests") == 0)
   207         *test_suite = new StringpairListTests(test_class_name, test_home);
   208     else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   209         *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   210     else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   211         *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   212     else if (strcmp(test_class_name, "KeyAttachmentTests") == 0)
   213         *test_suite = new KeyAttachmentTests(test_class_name, test_home);
   214     else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
   215         *test_suite = new TrustManipulationTests(test_class_name, test_home);
   216     else if (strcmp(test_class_name, "SyncTests") == 0)
   217         *test_suite = new SyncTests(test_class_name, test_home);
   218     else if (strcmp(test_class_name, "AppleMailTests") == 0)
   219         *test_suite = new AppleMailTests(test_class_name, test_home);
   220 }
   221 
   222 void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {
   223     for (int i = 0; i < num_to_run; i++) {
   224         Test::Suite* suite = NULL;
   225         SuiteMaker::suitemaker_build(test_class_names[i], test_home, &suite);
   226         if (!suite)
   227             throw std::runtime_error("Could not create a test suite instance."); // FIXME, better error, cleanup, obviously
   228         test_suites.push_back(suite);
   229     }
   230 }
   231 void SuiteMaker::suitemaker_buildall(const char* test_home, std::vector<Test::Suite*>& test_suites) {
   232     SuiteMaker::suitemaker_buildlist(SuiteMaker::all_suites, SuiteMaker::num_suites, test_home, test_suites);
   233 }
   234