test/src/SuiteMaker.cc
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 14 Jan 2019 13:00:09 +0100
changeset 3217 79720a7b9c49
parent 3121 f33a2ae77177
child 3225 e2dfdb612445
child 3228 0d6ffda184f7
permissions -rw-r--r--
Fixed pathlength problems for MacOS tests:
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@2644
    13
krista@2645
    14
// Begin where we generate stuff
krista@3217
    15
#include "MimeTests.h"
krista@3217
    16
#include "ExpiredSubkeyTests.h"
krista@3121
    17
#include "UserIdCollisionTests.h"
krista@3121
    18
#include "Engine463Tests.h"
krista@3121
    19
#include "BloblistTests.h"
krista@3217
    20
#include "NewUpdateIdAndMyselfTests.h"
krista@3217
    21
#include "I18nTests.h"
krista@3217
    22
#include "IdentityListTests.h"
krista@3121
    23
#include "PgpBinaryTests.h"
krista@3217
    24
#include "MistrustUndoTests.h"
krista@3121
    25
#include "MessageNullFromTests.h"
krista@3217
    26
#include "LeastCommonDenomColorTests.h"
krista@3217
    27
#include "StringlistTests.h"
krista@3121
    28
#include "PgpListKeysTests.h"
krista@3217
    29
#include "MessageApiTests.h"
krista@3217
    30
#include "EncryptMissingPrivateKeyTests.h"
krista@3217
    31
#include "CaseAndDotAddressTests.h"
krista@3217
    32
#include "UserIDAliasTests.h"
krista@3217
    33
#include "BCCTests.h"
krista@3217
    34
#include "Engine358Tests.h"
krista@3217
    35
#include "BlacklistAcceptNewKeyTests.h"
krista@3217
    36
#include "DecryptAttachPrivateKeyUntrustedTests.h"
krista@3217
    37
#include "BlacklistTests.h"
krista@3217
    38
#include "RevokeRegenAttachTests.h"
krista@3217
    39
#include "PepSubjectReceivedTests.h"
krista@3217
    40
#include "SequenceTests.h"
krista@3217
    41
#include "HeaderKeyImportTests.h"
krista@3217
    42
#include "EncryptAttachPrivateKeyTests.h"
krista@3217
    43
#include "ExternalRevokeTests.h"
krista@3217
    44
#include "KeyeditTests.h"
krista@3217
    45
#include "LeastColorGroupTests.h"
krista@3217
    46
#include "DecryptAttachPrivateKeyTrustedTests.h"
krista@3217
    47
#include "CheckRenewedExpiredKeyTrustStatusTests.h"
krista@3217
    48
#include "TrustwordsTests.h"
krista@3217
    49
#include "ReencryptPlusExtraKeysTests.h"
krista@3217
    50
#include "MapAsn1Tests.h"
krista@3217
    51
#include "DecorateTests.h"
krista@3217
    52
#include "MessageTwoPointOhTests.h"
krista@3121
    53
#include "CrashdumpTests.h"
krista@3217
    54
#include "StringpairListTests.h"
krista@3217
    55
#include "EncryptForIdentityTests.h"
krista@3217
    56
#include "TrustManipulationTests.h"
krista@3217
    57
#include "AppleMailTests.h"
krista@2642
    58
krista@2637
    59
krista@2644
    60
const char* SuiteMaker::all_suites[] = {
krista@3217
    61
    "MimeTests",
krista@3217
    62
    "ExpiredSubkeyTests",
krista@3121
    63
    "UserIdCollisionTests",
krista@3121
    64
    "Engine463Tests",
krista@3121
    65
    "BloblistTests",
krista@3217
    66
    "NewUpdateIdAndMyselfTests",
krista@3217
    67
    "I18nTests",
krista@3217
    68
    "IdentityListTests",
krista@3121
    69
    "PgpBinaryTests",
krista@3217
    70
    "MistrustUndoTests",
krista@3121
    71
    "MessageNullFromTests",
krista@3217
    72
    "LeastCommonDenomColorTests",
krista@3217
    73
    "StringlistTests",
krista@3121
    74
    "PgpListKeysTests",
krista@3217
    75
    "MessageApiTests",
krista@3217
    76
    "EncryptMissingPrivateKeyTests",
krista@3217
    77
    "CaseAndDotAddressTests",
krista@3217
    78
    "UserIDAliasTests",
krista@3217
    79
    "BCCTests",
krista@3217
    80
    "Engine358Tests",
krista@3217
    81
    "BlacklistAcceptNewKeyTests",
krista@3217
    82
    "DecryptAttachPrivateKeyUntrustedTests",
krista@3217
    83
    "BlacklistTests",
krista@3217
    84
    "RevokeRegenAttachTests",
krista@3217
    85
    "PepSubjectReceivedTests",
krista@3217
    86
    "SequenceTests",
krista@3217
    87
    "HeaderKeyImportTests",
krista@3217
    88
    "EncryptAttachPrivateKeyTests",
krista@3217
    89
    "ExternalRevokeTests",
krista@3217
    90
    "KeyeditTests",
krista@3217
    91
    "LeastColorGroupTests",
krista@3217
    92
    "DecryptAttachPrivateKeyTrustedTests",
krista@3217
    93
    "CheckRenewedExpiredKeyTrustStatusTests",
krista@3217
    94
    "TrustwordsTests",
krista@3217
    95
    "ReencryptPlusExtraKeysTests",
krista@3217
    96
    "MapAsn1Tests",
krista@3217
    97
    "DecorateTests",
krista@3217
    98
    "MessageTwoPointOhTests",
krista@3121
    99
    "CrashdumpTests",
krista@3217
   100
    "StringpairListTests",
krista@3217
   101
    "EncryptForIdentityTests",
krista@3217
   102
    "TrustManipulationTests",
krista@3217
   103
    "AppleMailTests",
krista@2642
   104
};
krista@2642
   105
krista@2644
   106
// This file is generated, so magic constants are ok.
krista@3104
   107
int SuiteMaker::num_suites = 43;
krista@2644
   108
krista@2644
   109
void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
krista@3217
   110
    if (strcmp(test_class_name, "MimeTests") == 0)
krista@3217
   111
        *test_suite = new MimeTests(test_class_name, test_home);
krista@3217
   112
    else if (strcmp(test_class_name, "ExpiredSubkeyTests") == 0)
krista@3217
   113
        *test_suite = new ExpiredSubkeyTests(test_class_name, test_home);
krista@3121
   114
    else if (strcmp(test_class_name, "UserIdCollisionTests") == 0)
krista@3121
   115
        *test_suite = new UserIdCollisionTests(test_class_name, test_home);
krista@3217
   116
    else if (strcmp(test_class_name, "Engine463Tests") == 0)
krista@3217
   117
        *test_suite = new Engine463Tests(test_class_name, test_home);
krista@3217
   118
    else if (strcmp(test_class_name, "BloblistTests") == 0)
krista@3217
   119
        *test_suite = new BloblistTests(test_class_name, test_home);
krista@3217
   120
    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
krista@3217
   121
        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
krista@3217
   122
    else if (strcmp(test_class_name, "I18nTests") == 0)
krista@3217
   123
        *test_suite = new I18nTests(test_class_name, test_home);
krista@3121
   124
    else if (strcmp(test_class_name, "IdentityListTests") == 0)
krista@3121
   125
        *test_suite = new IdentityListTests(test_class_name, test_home);
krista@3217
   126
    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
krista@3217
   127
        *test_suite = new PgpBinaryTests(test_class_name, test_home);
krista@3217
   128
    else if (strcmp(test_class_name, "MistrustUndoTests") == 0)
krista@3217
   129
        *test_suite = new MistrustUndoTests(test_class_name, test_home);
krista@3217
   130
    else if (strcmp(test_class_name, "MessageNullFromTests") == 0)
krista@3217
   131
        *test_suite = new MessageNullFromTests(test_class_name, test_home);
krista@3217
   132
    else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
krista@3217
   133
        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
krista@3217
   134
    else if (strcmp(test_class_name, "StringlistTests") == 0)
krista@3217
   135
        *test_suite = new StringlistTests(test_class_name, test_home);
krista@3217
   136
    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
krista@3217
   137
        *test_suite = new PgpListKeysTests(test_class_name, test_home);
krista@3217
   138
    else if (strcmp(test_class_name, "MessageApiTests") == 0)
krista@3217
   139
        *test_suite = new MessageApiTests(test_class_name, test_home);
krista@3217
   140
    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
krista@3217
   141
        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
krista@3217
   142
    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
krista@3217
   143
        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
krista@3217
   144
    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
krista@3217
   145
        *test_suite = new UserIDAliasTests(test_class_name, test_home);
krista@3217
   146
    else if (strcmp(test_class_name, "BCCTests") == 0)
krista@3217
   147
        *test_suite = new BCCTests(test_class_name, test_home);
krista@3217
   148
    else if (strcmp(test_class_name, "Engine358Tests") == 0)
krista@3217
   149
        *test_suite = new Engine358Tests(test_class_name, test_home);
krista@3217
   150
    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
krista@3217
   151
        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
krista@3121
   152
    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
krista@3121
   153
        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
krista@3217
   154
    else if (strcmp(test_class_name, "BlacklistTests") == 0)
krista@3217
   155
        *test_suite = new BlacklistTests(test_class_name, test_home);
krista@3217
   156
    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
krista@3217
   157
        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
krista@3217
   158
    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
krista@3217
   159
        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
krista@3217
   160
    else if (strcmp(test_class_name, "SequenceTests") == 0)
krista@3217
   161
        *test_suite = new SequenceTests(test_class_name, test_home);
krista@3121
   162
    else if (strcmp(test_class_name, "HeaderKeyImportTests") == 0)
krista@3121
   163
        *test_suite = new HeaderKeyImportTests(test_class_name, test_home);
krista@3121
   164
    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
krista@3121
   165
        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
krista@3217
   166
    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
krista@3217
   167
        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
krista@3121
   168
    else if (strcmp(test_class_name, "KeyeditTests") == 0)
krista@3121
   169
        *test_suite = new KeyeditTests(test_class_name, test_home);
krista@3217
   170
    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
krista@3217
   171
        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
krista@3121
   172
    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
krista@3121
   173
        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
krista@3217
   174
    else if (strcmp(test_class_name, "CheckRenewedExpiredKeyTrustStatusTests") == 0)
krista@3217
   175
        *test_suite = new CheckRenewedExpiredKeyTrustStatusTests(test_class_name, test_home);
krista@3217
   176
    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
krista@3217
   177
        *test_suite = new TrustwordsTests(test_class_name, test_home);
krista@3217
   178
    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
krista@3217
   179
        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
krista@3217
   180
    else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
krista@3217
   181
        *test_suite = new MapAsn1Tests(test_class_name, test_home);
krista@3217
   182
    else if (strcmp(test_class_name, "DecorateTests") == 0)
krista@3217
   183
        *test_suite = new DecorateTests(test_class_name, test_home);
krista@3217
   184
    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
krista@3217
   185
        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
krista@3217
   186
    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
krista@3217
   187
        *test_suite = new CrashdumpTests(test_class_name, test_home);
krista@3217
   188
    else if (strcmp(test_class_name, "StringpairListTests") == 0)
krista@3217
   189
        *test_suite = new StringpairListTests(test_class_name, test_home);
krista@3121
   190
    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
krista@3121
   191
        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
krista@3217
   192
    else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
krista@3217
   193
        *test_suite = new TrustManipulationTests(test_class_name, test_home);
krista@3217
   194
    else if (strcmp(test_class_name, "AppleMailTests") == 0)
krista@3217
   195
        *test_suite = new AppleMailTests(test_class_name, test_home);
krista@2634
   196
}
krista@2644
   197
krista@2644
   198
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
   199
    for (int i = 0; i < num_to_run; i++) {
krista@2644
   200
        Test::Suite* suite = NULL;
krista@2644
   201
        SuiteMaker::suitemaker_build(test_class_names[i], test_home, &suite);
krista@2644
   202
        if (!suite)
krista@2644
   203
            throw std::runtime_error("Could not create a test suite instance."); // FIXME, better error, cleanup, obviously
krista@2644
   204
        test_suites.push_back(suite);
krista@2645
   205
    }
krista@2644
   206
}
krista@2644
   207
void SuiteMaker::suitemaker_buildall(const char* test_home, std::vector<Test::Suite*>& test_suites) {
krista@2644
   208
    SuiteMaker::suitemaker_buildlist(SuiteMaker::all_suites, SuiteMaker::num_suites, test_home, test_suites);
krista@2644
   209
}
krista@2645
   210