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