test/src/SuiteMaker.cc
author Krista Bennett <krista@pep-project.org>
Wed, 20 Jun 2018 10:32:41 +0200
branchENGINE-434
changeset 2756 4a814f99426c
parent 2755 65c6b4bb11a6
permissions -rw-r--r--
ENGINE-434: intermittent commit - need to update tests for yesterdays crypto-dev discussion and then we'll see if things work correctly
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@2754
    15
#include "MapAsn1Tests.h"
krista@2754
    16
#include "DecorateTests.h"
krista@2754
    17
#include "EncryptMissingPrivateKeyTests.h"
krista@2754
    18
#include "KeyeditTests.h"
krista@2754
    19
#include "BlacklistAcceptNewKeyTests.h"
krista@2754
    20
#include "DecryptAttachPrivateKeyUntrustedTests.h"
krista@2754
    21
#include "AppleMailTests.h"
krista@2754
    22
#include "CaseAndDotAddressTests.h"
krista@2754
    23
#include "SequenceTests.h"
krista@2754
    24
#include "BCCTests.h"
krista@2754
    25
#include "MessageApiTests.h"
krista@2754
    26
#include "I18nTests.h"
krista@2754
    27
#include "CrashdumpTests.h"
krista@2754
    28
#include "PgpBinaryTests.h"
krista@2754
    29
#include "RevokeRegenAttachTests.h"
krista@2754
    30
#include "BlacklistTests.h"
krista@2754
    31
#include "LeastCommonDenomColorTests.h"
krista@2754
    32
#include "PepSubjectReceivedTests.h"
krista@2754
    33
#include "MistrustUndoTests.h"
krista@2677
    34
#include "IntegrityTests.h"
krista@2754
    35
#include "StringpairListTests.h"
krista@2754
    36
#include "PgpListKeysTests.h"
krista@2754
    37
#include "ReencryptPlusExtraKeysTests.h"
krista@2654
    38
#include "MimeTests.h"
krista@2650
    39
#include "BloblistTests.h"
krista@2654
    40
#include "NewUpdateIdAndMyselfTests.h"
krista@2754
    41
#include "StringlistTests.h"
krista@2754
    42
#include "LeastColorGroupTests.h"
krista@2754
    43
#include "ExternalRevokeTests.h"
krista@2754
    44
#include "EncryptForIdentityTests.h"
krista@2754
    45
#include "TrustwordsTests.h"
krista@2754
    46
#include "TrustManipulationTests.h"
krista@2754
    47
#include "MessageTwoPointOhTests.h"
krista@2754
    48
#include "EncryptAttachPrivateKeyTests.h"
krista@2754
    49
#include "DecryptAttachPrivateKeyTrustedTests.h"
vb@2749
    50
#include "IdentityListTests.h"
vb@2749
    51
#include "UserIDAliasTests.h"
krista@2642
    52
krista@2634
    53
krista@2644
    54
const char* SuiteMaker::all_suites[] = {
krista@2754
    55
    "MapAsn1Tests",
krista@2754
    56
    "DecorateTests",
krista@2754
    57
    "EncryptMissingPrivateKeyTests",
krista@2754
    58
    "KeyeditTests",
krista@2754
    59
    "BlacklistAcceptNewKeyTests",
krista@2754
    60
    "DecryptAttachPrivateKeyUntrustedTests",
krista@2754
    61
    "AppleMailTests",
krista@2754
    62
    "CaseAndDotAddressTests",
krista@2754
    63
    "SequenceTests",
krista@2754
    64
    "BCCTests",
krista@2754
    65
    "MessageApiTests",
krista@2754
    66
    "I18nTests",
krista@2754
    67
    "CrashdumpTests",
krista@2754
    68
    "PgpBinaryTests",
krista@2754
    69
    "RevokeRegenAttachTests",
krista@2754
    70
    "BlacklistTests",
krista@2754
    71
    "LeastCommonDenomColorTests",
krista@2754
    72
    "PepSubjectReceivedTests",
krista@2754
    73
    "MistrustUndoTests",
krista@2677
    74
    "IntegrityTests",
krista@2754
    75
    "StringpairListTests",
krista@2754
    76
    "PgpListKeysTests",
krista@2754
    77
    "ReencryptPlusExtraKeysTests",
krista@2654
    78
    "MimeTests",
krista@2650
    79
    "BloblistTests",
krista@2654
    80
    "NewUpdateIdAndMyselfTests",
krista@2754
    81
    "StringlistTests",
krista@2754
    82
    "LeastColorGroupTests",
krista@2754
    83
    "ExternalRevokeTests",
krista@2754
    84
    "EncryptForIdentityTests",
krista@2754
    85
    "TrustwordsTests",
krista@2754
    86
    "TrustManipulationTests",
krista@2754
    87
    "MessageTwoPointOhTests",
krista@2754
    88
    "EncryptAttachPrivateKeyTests",
krista@2754
    89
    "DecryptAttachPrivateKeyTrustedTests",
vb@2749
    90
    "IdentityListTests",
vb@2749
    91
    "UserIDAliasTests",
krista@2642
    92
};
krista@2642
    93
krista@2644
    94
// This file is generated, so magic constants are ok.
krista@2756
    95
int SuiteMaker::num_suites = 37;
krista@2644
    96
krista@2644
    97
void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
krista@2754
    98
    if (strcmp(test_class_name, "MapAsn1Tests") == 0)
krista@2754
    99
        *test_suite = new MapAsn1Tests(test_class_name, test_home);
krista@2754
   100
    else if (strcmp(test_class_name, "DecorateTests") == 0)
krista@2754
   101
        *test_suite = new DecorateTests(test_class_name, test_home);
krista@2754
   102
    else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
krista@2754
   103
        *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
krista@2754
   104
    else if (strcmp(test_class_name, "KeyeditTests") == 0)
krista@2754
   105
        *test_suite = new KeyeditTests(test_class_name, test_home);
krista@2754
   106
    else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
krista@2754
   107
        *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
krista@2754
   108
    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
krista@2754
   109
        *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
krista@2754
   110
    else if (strcmp(test_class_name, "AppleMailTests") == 0)
krista@2754
   111
        *test_suite = new AppleMailTests(test_class_name, test_home);
krista@2754
   112
    else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
krista@2754
   113
        *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
krista@2754
   114
    else if (strcmp(test_class_name, "SequenceTests") == 0)
krista@2754
   115
        *test_suite = new SequenceTests(test_class_name, test_home);
krista@2754
   116
    else if (strcmp(test_class_name, "BCCTests") == 0)
krista@2754
   117
        *test_suite = new BCCTests(test_class_name, test_home);
krista@2754
   118
    else if (strcmp(test_class_name, "MessageApiTests") == 0)
krista@2754
   119
        *test_suite = new MessageApiTests(test_class_name, test_home);
krista@2754
   120
    else if (strcmp(test_class_name, "I18nTests") == 0)
krista@2754
   121
        *test_suite = new I18nTests(test_class_name, test_home);
krista@2754
   122
    else if (strcmp(test_class_name, "CrashdumpTests") == 0)
krista@2754
   123
        *test_suite = new CrashdumpTests(test_class_name, test_home);
krista@2754
   124
    else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
krista@2754
   125
        *test_suite = new PgpBinaryTests(test_class_name, test_home);
krista@2754
   126
    else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
krista@2754
   127
        *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
krista@2754
   128
    else if (strcmp(test_class_name, "BlacklistTests") == 0)
krista@2754
   129
        *test_suite = new BlacklistTests(test_class_name, test_home);
krista@2754
   130
    else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
krista@2754
   131
        *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
krista@2754
   132
    else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
krista@2754
   133
        *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
krista@2754
   134
    else if (strcmp(test_class_name, "MistrustUndoTests") == 0)
krista@2754
   135
        *test_suite = new MistrustUndoTests(test_class_name, test_home);
krista@2677
   136
    else if (strcmp(test_class_name, "IntegrityTests") == 0)
krista@2677
   137
        *test_suite = new IntegrityTests(test_class_name, test_home);
krista@2754
   138
    else if (strcmp(test_class_name, "StringpairListTests") == 0)
krista@2754
   139
        *test_suite = new StringpairListTests(test_class_name, test_home);
krista@2754
   140
    else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
krista@2754
   141
        *test_suite = new PgpListKeysTests(test_class_name, test_home);
krista@2754
   142
    else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
krista@2754
   143
        *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
krista@2754
   144
    else if (strcmp(test_class_name, "MimeTests") == 0)
krista@2654
   145
        *test_suite = new MimeTests(test_class_name, test_home);
krista@2650
   146
    else if (strcmp(test_class_name, "BloblistTests") == 0)
krista@2650
   147
        *test_suite = new BloblistTests(test_class_name, test_home);
krista@2654
   148
    else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
krista@2654
   149
        *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
krista@2754
   150
    else if (strcmp(test_class_name, "StringlistTests") == 0)
krista@2754
   151
        *test_suite = new StringlistTests(test_class_name, test_home);
krista@2754
   152
    else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
krista@2754
   153
        *test_suite = new LeastColorGroupTests(test_class_name, test_home);
krista@2754
   154
    else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
krista@2754
   155
        *test_suite = new ExternalRevokeTests(test_class_name, test_home);
krista@2754
   156
    else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
krista@2754
   157
        *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
krista@2754
   158
    else if (strcmp(test_class_name, "TrustwordsTests") == 0)
krista@2754
   159
        *test_suite = new TrustwordsTests(test_class_name, test_home);
krista@2754
   160
    else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
krista@2754
   161
        *test_suite = new TrustManipulationTests(test_class_name, test_home);
krista@2754
   162
    else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
krista@2754
   163
        *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
krista@2754
   164
    else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
krista@2754
   165
        *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
krista@2754
   166
    else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
krista@2754
   167
        *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
vb@2749
   168
    else if (strcmp(test_class_name, "IdentityListTests") == 0)
vb@2749
   169
        *test_suite = new IdentityListTests(test_class_name, test_home);
vb@2749
   170
    else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
vb@2749
   171
        *test_suite = new UserIDAliasTests(test_class_name, test_home);
krista@2634
   172
}
krista@2644
   173
krista@2644
   174
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
   175
    for (int i = 0; i < num_to_run; i++) {
krista@2644
   176
        Test::Suite* suite = NULL;
krista@2644
   177
        SuiteMaker::suitemaker_build(test_class_names[i], test_home, &suite);
krista@2644
   178
        if (!suite)
krista@2644
   179
            throw std::runtime_error("Could not create a test suite instance."); // FIXME, better error, cleanup, obviously
krista@2644
   180
        test_suites.push_back(suite);
krista@2645
   181
    }
krista@2644
   182
}
krista@2644
   183
void SuiteMaker::suitemaker_buildall(const char* test_home, std::vector<Test::Suite*>& test_suites) {
krista@2644
   184
    SuiteMaker::suitemaker_buildlist(SuiteMaker::all_suites, SuiteMaker::num_suites, test_home, test_suites);
krista@2644
   185
}
krista@2645
   186