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