test/src/SuiteMaker.cc
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Thu, 16 May 2019 18:02:11 +0200
branchENGINE-553
changeset 3716 55f1a6d89704
parent 3708 42c376229484
child 3731 ecd9059f224d
permissions -rw-r--r--
Suitemaker 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 "URIAddressTests.h"
    16 #include "MimeTests.h"
    17 #include "OwnIdentitiesRetrieveTests.h"
    18 #include "ExpiredSubkeyTests.h"
    19 #include "VerifyTests.h"
    20 #include "UserIdCollisionTests.h"
    21 #include "Engine463Tests.h"
    22 #include "BloblistTests.h"
    23 #include "NewUpdateIdAndMyselfTests.h"
    24 #include "NoOwnIdentWritesOnDecryptTests.h"
    25 #include "LiteralFilenameTests.h"
    26 #include "I18nTests.h"
    27 #include "IdentityListTests.h"
    28 #include "PgpBinaryTests.h"
    29 #include "SubkeyRatingEvalTests.h"
    30 #include "MessageNullFromTests.h"
    31 #include "ExportKeyTests.h"
    32 #include "LeastCommonDenomColorTests.h"
    33 #include "StringlistTests.h"
    34 #include "PgpListKeysTests.h"
    35 #include "MessageApiTests.h"
    36 #include "EncryptMissingPrivateKeyTests.h"
    37 #include "CaseAndDotAddressTests.h"
    38 #include "UserIDAliasTests.h"
    39 #include "KeyringImportTests.h"
    40 #include "EnterLeaveDeviceGroupTests.h"
    41 #include "SignOnlyTests.h"
    42 #include "BCCTests.h"
    43 #include "Engine358Tests.h"
    44 #include "BlacklistAcceptNewKeyTests.h"
    45 #include "DecryptAttachPrivateKeyUntrustedTests.h"
    46 #include "BlacklistTests.h"
    47 #include "RevokeRegenAttachTests.h"
    48 #include "PepSubjectReceivedTests.h"
    49 #include "SequenceTests.h"
    50 #include "HeaderKeyImportTests.h"
    51 #include "EncryptAttachPrivateKeyTests.h"
    52 #include "ExternalRevokeTests.h"
    53 #include "LookupTests.h"
    54 #include "KeyeditTests.h"
    55 #include "LeastColorGroupTests.h"
    56 #include "DecryptAttachPrivateKeyTrustedTests.h"
    57 #include "CheckRenewedExpiredKeyTrustStatusTests.h"
    58 #include "TrustwordsTests.h"
    59 #include "SimpleBodyNotAltTests.h"
    60 #include "ReencryptPlusExtraKeysTests.h"
    61 #include "MapAsn1Tests.h"
    62 #include "DecorateTests.h"
    63 #include "MessageTwoPointOhTests.h"
    64 #include "CrashdumpTests.h"
    65 #include "StringpairListTests.h"
    66 #include "EncryptForIdentityTests.h"
    67 #include "KeyResetMessageTests.h"
    68 #include "DeleteKeyTests.h"
    69 #include "KeyAttachmentTests.h"
    70 #include "OwnKeysRetrieveTests.h"
    71 #include "TrustManipulationTests.h"
    72 #include "SyncTests.h"
    73 #include "SenderFPRTests.h"
    74 #include "RevocationTests.h"
    75 #include "AppleMailTests.h"
    76 
    77 
    78 const char* SuiteMaker::all_suites[] = {
    79     "URIAddressTests",
    80     "MimeTests",
    81     "OwnIdentitiesRetrieveTests",
    82     "ExpiredSubkeyTests",
    83     "VerifyTests",
    84     "UserIdCollisionTests",
    85     "Engine463Tests",
    86     "BloblistTests",
    87     "NewUpdateIdAndMyselfTests",
    88     "NoOwnIdentWritesOnDecryptTests",
    89     "LiteralFilenameTests",
    90     "I18nTests",
    91     "IdentityListTests",
    92     "PgpBinaryTests",
    93     "SubkeyRatingEvalTests",
    94     "MessageNullFromTests",
    95     "ExportKeyTests",
    96     "LeastCommonDenomColorTests",
    97     "StringlistTests",
    98     "PgpListKeysTests",
    99     "MessageApiTests",
   100     "EncryptMissingPrivateKeyTests",
   101     "CaseAndDotAddressTests",
   102     "UserIDAliasTests",
   103     "KeyringImportTests",
   104     "EnterLeaveDeviceGroupTests",
   105     "SignOnlyTests",
   106     "BCCTests",
   107     "Engine358Tests",
   108     "BlacklistAcceptNewKeyTests",
   109     "DecryptAttachPrivateKeyUntrustedTests",
   110     "BlacklistTests",
   111     "RevokeRegenAttachTests",
   112     "PepSubjectReceivedTests",
   113     "SequenceTests",
   114     "HeaderKeyImportTests",
   115     "EncryptAttachPrivateKeyTests",
   116     "ExternalRevokeTests",
   117     "LookupTests",
   118     "KeyeditTests",
   119     "LeastColorGroupTests",
   120     "DecryptAttachPrivateKeyTrustedTests",
   121     "CheckRenewedExpiredKeyTrustStatusTests",
   122     "TrustwordsTests",
   123     "SimpleBodyNotAltTests",
   124     "ReencryptPlusExtraKeysTests",
   125     "MapAsn1Tests",
   126     "DecorateTests",
   127     "MessageTwoPointOhTests",
   128     "CrashdumpTests",
   129     "StringpairListTests",
   130     "EncryptForIdentityTests",
   131     "KeyResetMessageTests",
   132     "DeleteKeyTests",
   133     "KeyAttachmentTests",
   134     "OwnKeysRetrieveTests",
   135     "TrustManipulationTests",
   136     "SyncTests",
   137     "SenderFPRTests",
   138     "RevocationTests",
   139     "AppleMailTests",
   140 };
   141 
   142 // This file is generated, so magic constants are ok.
   143 int SuiteMaker::num_suites = 61;
   144 
   145 void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
   146     if (strcmp(test_class_name, "URIAddressTests") == 0)
   147         *test_suite = new URIAddressTests(test_class_name, test_home);
   148     else if (strcmp(test_class_name, "MimeTests") == 0)
   149         *test_suite = new MimeTests(test_class_name, test_home);
   150     else if (strcmp(test_class_name, "OwnIdentitiesRetrieveTests") == 0)
   151         *test_suite = new OwnIdentitiesRetrieveTests(test_class_name, test_home);
   152     else if (strcmp(test_class_name, "ExpiredSubkeyTests") == 0)
   153         *test_suite = new ExpiredSubkeyTests(test_class_name, test_home);
   154     else if (strcmp(test_class_name, "VerifyTests") == 0)
   155         *test_suite = new VerifyTests(test_class_name, test_home);
   156     else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
   157         *test_suite = new UserIdCollisionTests(test_class_name, test_home);
   158     else if (strcmp(test_class_name, "Engine463Tests") == 0)
   159         *test_suite = new Engine463Tests(test_class_name, test_home);
   160     else if (strcmp(test_class_name, "BloblistTests") == 0)
   161         *test_suite = new BloblistTests(test_class_name, test_home);
   162     else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
   163         *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
   164     else if (strcmp(test_class_name, "NoOwnIdentWritesOnDecryptTests") == 0)
   165         *test_suite = new NoOwnIdentWritesOnDecryptTests(test_class_name, test_home);
   166     else if (strcmp(test_class_name, "LiteralFilenameTests") == 0)
   167         *test_suite = new LiteralFilenameTests(test_class_name, test_home);
   168     else if (strcmp(test_class_name, "I18nTests") == 0)
   169         *test_suite = new I18nTests(test_class_name, test_home);
   170     else if (strcmp(test_class_name, "IdentityListTests") == 0)
   171         *test_suite = new IdentityListTests(test_class_name, test_home);
   172     else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
   173         *test_suite = new PgpBinaryTests(test_class_name, test_home);
   174     else if (strcmp(test_class_name, "SubkeyRatingEvalTests") == 0)
   175         *test_suite = new SubkeyRatingEvalTests(test_class_name, test_home);
   176     else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
   177         *test_suite = new MessageNullFromTests(test_class_name, test_home);
   178     else if (strcmp(test_class_name, "ExportKeyTests") == 0)
   179         *test_suite = new ExportKeyTests(test_class_name, test_home);
   180     else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
   181         *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
   182     else if (strcmp(test_class_name, "StringlistTests") == 0)
   183         *test_suite = new StringlistTests(test_class_name, test_home);
   184     else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
   185         *test_suite = new PgpListKeysTests(test_class_name, test_home);
   186     else if (strcmp(test_class_name, "MessageApiTests") == 0)
   187         *test_suite = new MessageApiTests(test_class_name, test_home);
   188     else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
   189         *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
   190     else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
   191         *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
   192     else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
   193         *test_suite = new UserIDAliasTests(test_class_name, test_home);
   194     else if (strcmp(test_class_name, "KeyringImportTests") == 0)
   195         *test_suite = new KeyringImportTests(test_class_name, test_home);
   196     else if (strcmp(test_class_name, "EnterLeaveDeviceGroupTests") == 0)
   197         *test_suite = new EnterLeaveDeviceGroupTests(test_class_name, test_home);
   198     else if (strcmp(test_class_name, "SignOnlyTests") == 0)
   199         *test_suite = new SignOnlyTests(test_class_name, test_home);
   200     else if (strcmp(test_class_name, "BCCTests") == 0)
   201         *test_suite = new BCCTests(test_class_name, test_home);
   202     else if (strcmp(test_class_name, "Engine358Tests") == 0)
   203         *test_suite = new Engine358Tests(test_class_name, test_home);
   204     else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
   205         *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
   206     else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
   207         *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
   208     else if (strcmp(test_class_name, "BlacklistTests") == 0)
   209         *test_suite = new BlacklistTests(test_class_name, test_home);
   210     else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
   211         *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
   212     else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
   213         *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
   214     else if (strcmp(test_class_name, "SequenceTests") == 0)
   215         *test_suite = new SequenceTests(test_class_name, test_home);
   216     else if (strcmp(test_class_name, "HeaderKeyImportTests") == 0)
   217         *test_suite = new HeaderKeyImportTests(test_class_name, test_home);
   218     else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
   219         *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
   220     else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
   221         *test_suite = new ExternalRevokeTests(test_class_name, test_home);
   222     else if (strcmp(test_class_name, "LookupTests") == 0)
   223         *test_suite = new LookupTests(test_class_name, test_home);
   224     else if (strcmp(test_class_name, "KeyeditTests") == 0)
   225         *test_suite = new KeyeditTests(test_class_name, test_home);
   226     else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
   227         *test_suite = new LeastColorGroupTests(test_class_name, test_home);
   228     else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
   229         *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
   230     else if (strcmp(test_class_name, "CheckRenewedExpiredKeyTrustStatusTests") == 0)
   231         *test_suite = new CheckRenewedExpiredKeyTrustStatusTests(test_class_name, test_home);
   232     else if (strcmp(test_class_name, "TrustwordsTests") == 0)
   233         *test_suite = new TrustwordsTests(test_class_name, test_home);
   234     else if (strcmp(test_class_name, "SimpleBodyNotAltTests") == 0)
   235         *test_suite = new SimpleBodyNotAltTests(test_class_name, test_home);
   236     else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
   237         *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
   238     else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
   239         *test_suite = new MapAsn1Tests(test_class_name, test_home);
   240     else if (strcmp(test_class_name, "DecorateTests") == 0)
   241         *test_suite = new DecorateTests(test_class_name, test_home);
   242     else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
   243         *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
   244     else if (strcmp(test_class_name, "CrashdumpTests") == 0)
   245         *test_suite = new CrashdumpTests(test_class_name, test_home);
   246     else if (strcmp(test_class_name, "StringpairListTests") == 0)
   247         *test_suite = new StringpairListTests(test_class_name, test_home);
   248     else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
   249         *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
   250     else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
   251         *test_suite = new KeyResetMessageTests(test_class_name, test_home);
   252     else if (strcmp(test_class_name, "DeleteKeyTests") == 0)
   253         *test_suite = new DeleteKeyTests(test_class_name, test_home);
   254     else if (strcmp(test_class_name, "KeyAttachmentTests") == 0)
   255         *test_suite = new KeyAttachmentTests(test_class_name, test_home);
   256     else if (strcmp(test_class_name, "OwnKeysRetrieveTests") == 0)
   257         *test_suite = new OwnKeysRetrieveTests(test_class_name, test_home);
   258     else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
   259         *test_suite = new TrustManipulationTests(test_class_name, test_home);
   260     else if (strcmp(test_class_name, "SyncTests") == 0)
   261         *test_suite = new SyncTests(test_class_name, test_home);
   262     else if (strcmp(test_class_name, "SenderFPRTests") == 0)
   263         *test_suite = new SenderFPRTests(test_class_name, test_home);
   264     else if (strcmp(test_class_name, "RevocationTests") == 0)
   265         *test_suite = new RevocationTests(test_class_name, test_home);
   266     else if (strcmp(test_class_name, "AppleMailTests") == 0)
   267         *test_suite = new AppleMailTests(test_class_name, test_home);
   268 }
   269 
   270 void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {
   271     for (int i = 0; i < num_to_run; i++) {
   272         Test::Suite* suite = NULL;
   273         SuiteMaker::suitemaker_build(test_class_names[i], test_home, &suite);
   274         if (!suite)
   275             throw std::runtime_error("Could not create a test suite instance."); // FIXME, better error, cleanup, obviously
   276         test_suites.push_back(suite);
   277     }
   278 }
   279 void SuiteMaker::suitemaker_buildall(const char* test_home, std::vector<Test::Suite*>& test_suites) {
   280     SuiteMaker::suitemaker_buildlist(SuiteMaker::all_suites, SuiteMaker::num_suites, test_home, test_suites);
   281 }
   282