test/src/SuiteMaker.cc
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Thu, 20 Jun 2019 17:45:10 +0200
branchsync
changeset 3863 e10b2a4785a5
parent 3814 79f71c45472b
child 3879 e8bf8bb51582
child 3902 7eb39c8f2f94
permissions -rw-r--r--
partial fix for the root cause of not finding the key for IOS-1664 - usernames with @ in them are now quoted before sending to generate key to ensure uids are created correctly and sequoia inserts them correctly into the db
krista@2645
     1
// This file is under GNU General Public License 3.0
krista@2645
     2
// see LICENSE.txt
krista@2645
     3
krista@2645
     4
//
krista@2645
     5
// src/SuiteMaker.cc generated by gensuitemaker.py - changes may be overwritten. You've been warned!
krista@2645
     6
//
krista@2645
     7
krista@2637
     8
#include <cpptest.h>
krista@2634
     9
#include <cpptest-suite.h>
krista@2644
    10
#include <memory>
krista@2644
    11
#include <vector>
krista@2645
    12
#include "SuiteMaker.h"
krista@2634
    13
krista@2645
    14
// Begin where we generate stuff
krista@3676
    15
#include "URIAddressTests.h"
vb@3540
    16
#include "MimeTests.h"
vb@3540
    17
#include "OwnIdentitiesRetrieveTests.h"
vb@3540
    18
#include "ExpiredSubkeyTests.h"
krista@3683
    19
#include "VerifyTests.h"
vb@3540
    20
#include "UserIdCollisionTests.h"
vb@3540
    21
#include "Engine463Tests.h"
krista@3863
    22
#include "IOS1664Tests.h"
vb@3540
    23
#include "BloblistTests.h"
vb@3540
    24
#include "NewUpdateIdAndMyselfTests.h"
vb@3540
    25
#include "NoOwnIdentWritesOnDecryptTests.h"
vb@3720
    26
#include "LiteralFilenameTests.h"
vb@3540
    27
#include "I18nTests.h"
vb@3540
    28
#include "IdentityListTests.h"
vb@3540
    29
#include "PgpBinaryTests.h"
vb@3540
    30
#include "SubkeyRatingEvalTests.h"
vb@3540
    31
#include "MessageNullFromTests.h"
krista@3596
    32
#include "ExportKeyTests.h"
vb@3540
    33
#include "LeastCommonDenomColorTests.h"
vb@3540
    34
#include "StringlistTests.h"
vb@3540
    35
#include "PgpListKeysTests.h"
vb@3540
    36
#include "MessageApiTests.h"
vb@3540
    37
#include "EncryptMissingPrivateKeyTests.h"
vb@3540
    38
#include "CaseAndDotAddressTests.h"
vb@3540
    39
#include "UserIDAliasTests.h"
vb@3655
    40
#include "KeyringImportTests.h"
krista@3538
    41
#include "EnterLeaveDeviceGroupTests.h"
vb@3540
    42
#include "SignOnlyTests.h"
krista@3806
    43
#include "LotsOfKeysTests.h"
vb@3540
    44
#include "BCCTests.h"
vb@3540
    45
#include "Engine358Tests.h"
vb@3540
    46
#include "BlacklistAcceptNewKeyTests.h"
vb@3540
    47
#include "DecryptAttachPrivateKeyUntrustedTests.h"
krista@3538
    48
#include "BlacklistTests.h"
vb@3540
    49
#include "RevokeRegenAttachTests.h"
vb@3540
    50
#include "PepSubjectReceivedTests.h"
vb@3540
    51
#include "SequenceTests.h"
vb@3540
    52
#include "HeaderKeyImportTests.h"
vb@3540
    53
#include "EncryptAttachPrivateKeyTests.h"
vb@3540
    54
#include "ExternalRevokeTests.h"
vb@3655
    55
#include "LookupTests.h"
vb@3540
    56
#include "KeyeditTests.h"
vb@3540
    57
#include "LeastColorGroupTests.h"
krista@3538
    58
#include "DecryptAttachPrivateKeyTrustedTests.h"
krista@3217
    59
#include "CheckRenewedExpiredKeyTrustStatusTests.h"
krista@3217
    60
#include "TrustwordsTests.h"
vb@3540
    61
#include "SimpleBodyNotAltTests.h"
vb@3540
    62
#include "ReencryptPlusExtraKeysTests.h"
vb@3540
    63
#include "MapAsn1Tests.h"
krista@3538
    64
#include "DecorateTests.h"
vb@3540
    65
#include "MessageTwoPointOhTests.h"
vb@3540
    66
#include "CrashdumpTests.h"
vb@3540
    67
#include "StringpairListTests.h"
vb@3540
    68
#include "EncryptForIdentityTests.h"
vb@3540
    69
#include "KeyResetMessageTests.h"
krista@3570
    70
#include "DeleteKeyTests.h"
vb@3540
    71
#include "KeyAttachmentTests.h"
krista@3583
    72
#include "OwnKeysRetrieveTests.h"
vb@3540
    73
#include "TrustManipulationTests.h"
vb@3540
    74
#include "SyncTests.h"
krista@3660
    75
#include "RevocationTests.h"
krista@3538
    76
#include "AppleMailTests.h"
krista@2642
    77
krista@2634
    78
krista@2644
    79
const char* SuiteMaker::all_suites[] = {
krista@3676
    80
    "URIAddressTests",
vb@3540
    81
    "MimeTests",
vb@3540
    82
    "OwnIdentitiesRetrieveTests",
vb@3540
    83
    "ExpiredSubkeyTests",
krista@3683
    84
    "VerifyTests",
vb@3540
    85
    "UserIdCollisionTests",
vb@3540
    86
    "Engine463Tests",
krista@3863
    87
    "IOS1664Tests",
vb@3540
    88
    "BloblistTests",
vb@3540
    89
    "NewUpdateIdAndMyselfTests",
vb@3540
    90
    "NoOwnIdentWritesOnDecryptTests",
vb@3720
    91
    "LiteralFilenameTests",
vb@3540
    92
    "I18nTests",
vb@3540
    93
    "IdentityListTests",
vb@3540
    94
    "PgpBinaryTests",
vb@3540
    95
    "SubkeyRatingEvalTests",
vb@3540
    96
    "MessageNullFromTests",
krista@3596
    97
    "ExportKeyTests",
vb@3540
    98
    "LeastCommonDenomColorTests",
vb@3540
    99
    "StringlistTests",
vb@3540
   100
    "PgpListKeysTests",
vb@3540
   101
    "MessageApiTests",
vb@3540
   102
    "EncryptMissingPrivateKeyTests",
vb@3540
   103
    "CaseAndDotAddressTests",
vb@3540
   104
    "UserIDAliasTests",
vb@3655
   105
    "KeyringImportTests",
krista@3538
   106
    "EnterLeaveDeviceGroupTests",
vb@3540
   107
    "SignOnlyTests",
krista@3806
   108
    "LotsOfKeysTests",
vb@3540
   109
    "BCCTests",
vb@3540
   110
    "Engine358Tests",
vb@3540
   111
    "BlacklistAcceptNewKeyTests",
vb@3540
   112
    "DecryptAttachPrivateKeyUntrustedTests",
krista@3538
   113
    "BlacklistTests",
vb@3540
   114
    "RevokeRegenAttachTests",
vb@3540
   115
    "PepSubjectReceivedTests",
vb@3540
   116
    "SequenceTests",
vb@3540
   117
    "HeaderKeyImportTests",
vb@3540
   118
    "EncryptAttachPrivateKeyTests",
vb@3540
   119
    "ExternalRevokeTests",
vb@3655
   120
    "LookupTests",
vb@3540
   121
    "KeyeditTests",
vb@3540
   122
    "LeastColorGroupTests",
krista@3538
   123
    "DecryptAttachPrivateKeyTrustedTests",
krista@3217
   124
    "CheckRenewedExpiredKeyTrustStatusTests",
krista@3217
   125
    "TrustwordsTests",
vb@3540
   126
    "SimpleBodyNotAltTests",
vb@3540
   127
    "ReencryptPlusExtraKeysTests",
vb@3540
   128
    "MapAsn1Tests",
krista@3538
   129
    "DecorateTests",
vb@3540
   130
    "MessageTwoPointOhTests",
vb@3540
   131
    "CrashdumpTests",
vb@3540
   132
    "StringpairListTests",
vb@3540
   133
    "EncryptForIdentityTests",
vb@3540
   134
    "KeyResetMessageTests",
krista@3570
   135
    "DeleteKeyTests",
vb@3540
   136
    "KeyAttachmentTests",
krista@3583
   137
    "OwnKeysRetrieveTests",
vb@3540
   138
    "TrustManipulationTests",
vb@3540
   139
    "SyncTests",
krista@3660
   140
    "RevocationTests",
krista@3538
   141
    "AppleMailTests",
krista@2642
   142
};
krista@2642
   143
krista@2644
   144
// This file is generated, so magic constants are ok.
krista@3863
   145
int SuiteMaker::num_suites = 62;
krista@2644
   146
krista@2644
   147
void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
krista@3676
   148
    if (strcmp(test_class_name, "URIAddressTests") == 0)
krista@3676
   149
        *test_suite = new URIAddressTests(test_class_name, test_home);
krista@3676
   150
    else if (strcmp(test_class_name, "MimeTests") == 0)
vb@3540
   151
        *test_suite = new MimeTests(test_class_name, test_home);
vb@3540
   152
    else if (strcmp(test_class_name, "OwnIdentitiesRetrieveTests") == 0)
vb@3540
   153
        *test_suite = new OwnIdentitiesRetrieveTests(test_class_name, test_home);
vb@3540
   154
    else if (strcmp(test_class_name, "ExpiredSubkeyTests") == 0)
vb@3540
   155
        *test_suite = new ExpiredSubkeyTests(test_class_name, test_home);
krista@3683
   156
    else if (strcmp(test_class_name, "VerifyTests") == 0)
krista@3683
   157
        *test_suite = new VerifyTests(test_class_name, test_home);
vb@3540
   158
    else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
vb@3540
   159
        *test_suite = new UserIdCollisionTests(test_class_name, test_home);
vb@3540
   160
    else if (strcmp(test_class_name, "Engine463Tests") == 0)
vb@3540
   161
        *test_suite = new Engine463Tests(test_class_name, test_home);
krista@3863
   162
    else if (strcmp(test_class_name, "IOS1664Tests") == 0)
krista@3863
   163
        *test_suite = new IOS1664Tests(test_class_name, test_home);
vb@3540
   164
    else if (strcmp(test_class_name, "BloblistTests") == 0)
vb@3540
   165
        *test_suite = new BloblistTests(test_class_name, test_home);
vb@3540
   166
    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
vb@3540
   167
        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
vb@3540
   168
    else if (strcmp(test_class_name, "NoOwnIdentWritesOnDecryptTests") == 0)
vb@3540
   169
        *test_suite = new NoOwnIdentWritesOnDecryptTests(test_class_name, test_home);
vb@3720
   170
    else if (strcmp(test_class_name, "LiteralFilenameTests") == 0)
vb@3720
   171
        *test_suite = new LiteralFilenameTests(test_class_name, test_home);
vb@3540
   172
    else if (strcmp(test_class_name, "I18nTests") == 0)
vb@3540
   173
        *test_suite = new I18nTests(test_class_name, test_home);
vb@3540
   174
    else if (strcmp(test_class_name, "IdentityListTests") == 0)
vb@3540
   175
        *test_suite = new IdentityListTests(test_class_name, test_home);
vb@3540
   176
    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
vb@3540
   177
        *test_suite = new PgpBinaryTests(test_class_name, test_home);
vb@3540
   178
    else if (strcmp(test_class_name, "SubkeyRatingEvalTests") == 0)
vb@3540
   179
        *test_suite = new SubkeyRatingEvalTests(test_class_name, test_home);
vb@3540
   180
    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
vb@3540
   181
        *test_suite = new MessageNullFromTests(test_class_name, test_home);
krista@3596
   182
    else if (strcmp(test_class_name, "ExportKeyTests") == 0)
krista@3596
   183
        *test_suite = new ExportKeyTests(test_class_name, test_home);
krista@3538
   184
    else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
krista@3538
   185
        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
vb@3540
   186
    else if (strcmp(test_class_name, "StringlistTests") == 0)
vb@3540
   187
        *test_suite = new StringlistTests(test_class_name, test_home);
vb@3540
   188
    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
vb@3540
   189
        *test_suite = new PgpListKeysTests(test_class_name, test_home);
vb@3540
   190
    else if (strcmp(test_class_name, "MessageApiTests") == 0)
vb@3540
   191
        *test_suite = new MessageApiTests(test_class_name, test_home);
vb@3540
   192
    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
vb@3540
   193
        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
vb@3540
   194
    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
vb@3540
   195
        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
vb@3540
   196
    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
vb@3540
   197
        *test_suite = new UserIDAliasTests(test_class_name, test_home);
vb@3655
   198
    else if (strcmp(test_class_name, "KeyringImportTests") == 0)
vb@3655
   199
        *test_suite = new KeyringImportTests(test_class_name, test_home);
vb@3540
   200
    else if (strcmp(test_class_name, "EnterLeaveDeviceGroupTests") == 0)
vb@3540
   201
        *test_suite = new EnterLeaveDeviceGroupTests(test_class_name, test_home);
vb@3540
   202
    else if (strcmp(test_class_name, "SignOnlyTests") == 0)
vb@3540
   203
        *test_suite = new SignOnlyTests(test_class_name, test_home);
krista@3806
   204
    else if (strcmp(test_class_name, "LotsOfKeysTests") == 0)
krista@3806
   205
        *test_suite = new LotsOfKeysTests(test_class_name, test_home);
vb@3540
   206
    else if (strcmp(test_class_name, "BCCTests") == 0)
vb@3540
   207
        *test_suite = new BCCTests(test_class_name, test_home);
vb@3540
   208
    else if (strcmp(test_class_name, "Engine358Tests") == 0)
vb@3540
   209
        *test_suite = new Engine358Tests(test_class_name, test_home);
vb@3540
   210
    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
vb@3540
   211
        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
vb@3540
   212
    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
vb@3540
   213
        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
krista@3538
   214
    else if (strcmp(test_class_name, "BlacklistTests") == 0)
krista@3538
   215
        *test_suite = new BlacklistTests(test_class_name, test_home);
vb@3540
   216
    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
vb@3540
   217
        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
vb@3540
   218
    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
vb@3540
   219
        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
vb@3540
   220
    else if (strcmp(test_class_name, "SequenceTests") == 0)
vb@3540
   221
        *test_suite = new SequenceTests(test_class_name, test_home);
vb@3540
   222
    else if (strcmp(test_class_name, "HeaderKeyImportTests") == 0)
vb@3540
   223
        *test_suite = new HeaderKeyImportTests(test_class_name, test_home);
vb@3540
   224
    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
vb@3540
   225
        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
vb@3540
   226
    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
vb@3540
   227
        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
vb@3655
   228
    else if (strcmp(test_class_name, "LookupTests") == 0)
vb@3655
   229
        *test_suite = new LookupTests(test_class_name, test_home);
vb@3540
   230
    else if (strcmp(test_class_name, "KeyeditTests") == 0)
vb@3540
   231
        *test_suite = new KeyeditTests(test_class_name, test_home);
vb@3540
   232
    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
vb@3540
   233
        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
krista@3538
   234
    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
krista@3538
   235
        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
krista@3217
   236
    else if (strcmp(test_class_name, "CheckRenewedExpiredKeyTrustStatusTests") == 0)
krista@3217
   237
        *test_suite = new CheckRenewedExpiredKeyTrustStatusTests(test_class_name, test_home);
krista@3217
   238
    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
krista@3217
   239
        *test_suite = new TrustwordsTests(test_class_name, test_home);
vb@3540
   240
    else if (strcmp(test_class_name, "SimpleBodyNotAltTests") == 0)
vb@3540
   241
        *test_suite = new SimpleBodyNotAltTests(test_class_name, test_home);
vb@3540
   242
    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
vb@3540
   243
        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
vb@3540
   244
    else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
vb@3540
   245
        *test_suite = new MapAsn1Tests(test_class_name, test_home);
krista@3538
   246
    else if (strcmp(test_class_name, "DecorateTests") == 0)
krista@3538
   247
        *test_suite = new DecorateTests(test_class_name, test_home);
vb@3540
   248
    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
vb@3540
   249
        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
vb@3540
   250
    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
vb@3540
   251
        *test_suite = new CrashdumpTests(test_class_name, test_home);
vb@3540
   252
    else if (strcmp(test_class_name, "StringpairListTests") == 0)
vb@3540
   253
        *test_suite = new StringpairListTests(test_class_name, test_home);
vb@3540
   254
    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
vb@3540
   255
        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
vb@3540
   256
    else if (strcmp(test_class_name, "KeyResetMessageTests") == 0)
vb@3540
   257
        *test_suite = new KeyResetMessageTests(test_class_name, test_home);
krista@3570
   258
    else if (strcmp(test_class_name, "DeleteKeyTests") == 0)
krista@3570
   259
        *test_suite = new DeleteKeyTests(test_class_name, test_home);
vb@3540
   260
    else if (strcmp(test_class_name, "KeyAttachmentTests") == 0)
vb@3540
   261
        *test_suite = new KeyAttachmentTests(test_class_name, test_home);
krista@3583
   262
    else if (strcmp(test_class_name, "OwnKeysRetrieveTests") == 0)
krista@3583
   263
        *test_suite = new OwnKeysRetrieveTests(test_class_name, test_home);
vb@3540
   264
    else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
vb@3540
   265
        *test_suite = new TrustManipulationTests(test_class_name, test_home);
vb@3540
   266
    else if (strcmp(test_class_name, "SyncTests") == 0)
vb@3540
   267
        *test_suite = new SyncTests(test_class_name, test_home);
krista@3660
   268
    else if (strcmp(test_class_name, "RevocationTests") == 0)
krista@3660
   269
        *test_suite = new RevocationTests(test_class_name, test_home);
krista@3538
   270
    else if (strcmp(test_class_name, "AppleMailTests") == 0)
krista@3538
   271
        *test_suite = new AppleMailTests(test_class_name, test_home);
krista@2634
   272
}
krista@2644
   273
krista@2644
   274
void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {
krista@2644
   275
    for (int i = 0; i < num_to_run; i++) {
krista@2644
   276
        Test::Suite* suite = NULL;
krista@2644
   277
        SuiteMaker::suitemaker_build(test_class_names[i], test_home, &suite);
krista@2644
   278
        if (!suite)
krista@2644
   279
            throw std::runtime_error("Could not create a test suite instance."); // FIXME, better error, cleanup, obviously
krista@2644
   280
        test_suites.push_back(suite);
krista@2645
   281
    }
krista@2644
   282
}
krista@2644
   283
void SuiteMaker::suitemaker_buildall(const char* test_home, std::vector<Test::Suite*>& test_suites) {
krista@2644
   284
    SuiteMaker::suitemaker_buildlist(SuiteMaker::all_suites, SuiteMaker::num_suites, test_home, test_suites);
krista@2644
   285
}
krista@2645
   286