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