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