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