1.1 --- a/test/include/EngineTestSuite.h Fri Aug 10 12:37:43 2018 +0200
1.2 +++ b/test/include/EngineTestSuite.h Tue Aug 14 15:46:57 2018 +0200
1.3 @@ -4,6 +4,8 @@
1.4 #include <cpptest.h>
1.5 #include <string>
1.6 #include <map>
1.7 +#include <vector>
1.8 +#include <utility>
1.9 #include "pEpEngine.h"
1.10
1.11 using namespace std;
1.12 @@ -34,12 +36,24 @@
1.13 unsigned int number_of_tests;
1.14 unsigned int on_test_number;
1.15
1.16 + string temp_test_home;
1.17 +
1.18 virtual void setup();
1.19 virtual void tear_down();
1.20
1.21 void set_full_env();
1.22 + void set_full_env(const char* gpg_conf_copy_path, const char* gpg_agent_conf_file_copy_path, const char* db_conf_file_copy_path);
1.23 void restore_full_env();
1.24 void initialise_test_home();
1.25 void set_my_name();
1.26 +
1.27 + void copy_conf_file_to_test_dir(const char* dest_path, const char* conf_orig_path, const char* conf_dest_name);
1.28 +
1.29 + std::vector<std::pair<std::string, std::string>> gpgdir_fileadd_queue;
1.30 + std::vector<std::pair<std::string, std::string>> homedir_fileadd_queue;
1.31 + void add_file_to_gpg_dir_queue(std::string copy_from, std::string dst_fname);
1.32 + void add_file_to_home_dir_queue(std::string copy_from, std::string dst_fname);
1.33 + void process_file_queue(std::string dirname, std::vector<std::pair<std::string, std::string>> file_queue);
1.34 +
1.35 };
1.36 #endif
2.1 --- a/test/include/test_util.h Fri Aug 10 12:37:43 2018 +0200
2.2 +++ b/test/include/test_util.h Tue Aug 14 15:46:57 2018 +0200
2.3 @@ -11,6 +11,8 @@
2.4
2.5 void test_init();
2.6
2.7 +bool file_exists(std::string filename);
2.8 +
2.9 // string equality (case and non-case sensitive)
2.10 bool _streq(const char* str1, const char* str2);
2.11 bool _strceq(const char* str1, const char* str2);
3.1 --- a/test/src/EngineTestSuite.cc Fri Aug 10 12:37:43 2018 +0200
3.2 +++ b/test/src/EngineTestSuite.cc Tue Aug 14 15:46:57 2018 +0200
3.3 @@ -5,6 +5,14 @@
3.4 #include <unistd.h>
3.5 #include <ftw.h>
3.6 #include <assert.h>
3.7 +#include <fstream>
3.8 +#include <iostream>
3.9 +#include <sys/types.h>
3.10 +#include <sys/stat.h>
3.11 +
3.12 +#import <string>
3.13 +#import <vector>
3.14 +#include <utility>
3.15
3.16 #include "platform_unix.h"
3.17
3.18 @@ -30,7 +38,58 @@
3.19 number_of_tests++;
3.20 }
3.21
3.22 +void EngineTestSuite::copy_conf_file_to_test_dir(const char* dest_path, const char* conf_orig_path, const char* conf_dest_name) {
3.23 + string conf_dest_path = dest_path;
3.24 +
3.25 + struct stat pathinfo;
3.26 +
3.27 + if(stat(conf_dest_path.c_str(), &pathinfo) != 0) {
3.28 + int errchk = mkdir(conf_dest_path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
3.29 + if (errchk != 0)
3.30 + throw std::runtime_error("Error accessing conf file directory.");
3.31 + }
3.32 +
3.33 + conf_dest_path += "/";
3.34 + conf_dest_path += conf_dest_name;
3.35 +
3.36 + ifstream src(conf_orig_path);
3.37 + ofstream dst(conf_dest_path.c_str(), ios::trunc);
3.38 +
3.39 + assert(src);
3.40 + assert(dst);
3.41 +
3.42 + dst << src.rdbuf();
3.43 +
3.44 + src.close();
3.45 + dst.close();
3.46 +}
3.47 +
3.48 +void EngineTestSuite::add_file_to_gpg_dir_queue(string copy_from, string dst_fname) {
3.49 + gpgdir_fileadd_queue.push_back(make_pair(copy_from, dst_fname));
3.50 +}
3.51 +
3.52 +void EngineTestSuite::add_file_to_home_dir_queue(string copy_from, string dst_fname) {
3.53 + homedir_fileadd_queue.push_back(make_pair(copy_from, dst_fname));
3.54 +}
3.55 +
3.56 +void EngineTestSuite::process_file_queue(string dirname, vector<pair<string, string>> file_queue) {
3.57 + if (file_queue.empty())
3.58 + return;
3.59 +
3.60 + vector<pair<string, string>>::iterator it;
3.61 +
3.62 + for (it = file_queue.begin(); it != file_queue.end(); it++) {
3.63 + copy_conf_file_to_test_dir(dirname.c_str(), it->first.c_str(), it->second.c_str());
3.64 + }
3.65 +
3.66 + file_queue.clear();
3.67 +}
3.68 +
3.69 void EngineTestSuite::set_full_env() {
3.70 + set_full_env(NULL, NULL, NULL);
3.71 +}
3.72 +
3.73 +void EngineTestSuite::set_full_env(const char* gpg_conf_copy_path, const char* gpg_agent_conf_file_copy_path, const char* db_conf_file_copy_path) {
3.74 int success = 0;
3.75 struct stat dirchk;
3.76
3.77 @@ -39,7 +98,7 @@
3.78 success = system("gpgconf --kill all");
3.79 if (success != 0)
3.80 throw std::runtime_error("SETUP: Error when executing 'gpgconf --kill all'.");
3.81 - sleep(1); // hopefully enough time for the system to recognise that it is dead. *sigh*
3.82 + // sleep(1); // hopefully enough time for the system to recognise that it is dead. *sigh*
3.83
3.84 if (stat(test_home.c_str(), &dirchk) == 0) {
3.85 if (!S_ISDIR(dirchk.st_mode))
3.86 @@ -59,7 +118,7 @@
3.87 throw std::runtime_error("Error creating a test directory.");
3.88 }
3.89
3.90 - string temp_test_home = test_home + "/" + my_name;
3.91 + temp_test_home = test_home + "/" + my_name;
3.92
3.93 int errchk = mkdir(temp_test_home.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
3.94 if (errchk != 0)
3.95 @@ -85,16 +144,22 @@
3.96 cout << "home is " << home << endl;
3.97 assert(temp_test_home.compare(home) != 0);
3.98 assert(temp_test_home.compare(home + "/") != 0);
3.99 + assert(temp_test_home.compare(home + "/.gnupg") != 0); // This is an EXCLUSION test, so we leave this.
3.100 + assert(temp_test_home.compare(home + ".gnupg") != 0);
3.101 assert(temp_test_home.compare(home + "/gnupg") != 0);
3.102 assert(temp_test_home.compare(home + "gnupg") != 0);
3.103 assert(temp_test_home.compare(prev_gpg_home) != 0);
3.104 assert(temp_test_home.compare(prev_gpg_home + "/gnupg") != 0);
3.105 assert(temp_test_home.compare(prev_gpg_home + "gnupg") != 0);
3.106 + assert(temp_test_home.compare(prev_gpg_home + "/.gnupg") != 0);
3.107 + assert(temp_test_home.compare(prev_gpg_home + ".gnupg") != 0);
3.108
3.109 if (temp_test_home.compare(home) == 0 || temp_test_home.compare(home + "/") == 0 ||
3.110 temp_test_home.compare(home + "/gnupg") == 0 || temp_test_home.compare(home + "gnupg") == 0 ||
3.111 + temp_test_home.compare(home + "/.gnupg") == 0 || temp_test_home.compare(home + ".gnupg") == 0 ||
3.112 temp_test_home.compare(prev_gpg_home) == 0 || temp_test_home.compare(prev_gpg_home + "/gnupg") == 0 ||
3.113 - temp_test_home.compare(prev_gpg_home + "gnupg") == 0)
3.114 + temp_test_home.compare(prev_gpg_home + "gnupg") == 0 || temp_test_home.compare(prev_gpg_home + "/.gnupg") == 0 ||
3.115 + temp_test_home.compare(prev_gpg_home + ".gnupg") == 0)
3.116 throw std::runtime_error("SETUP: new GNUPGHOME threatens to mess up user GNUPGHOME (and delete all their keys). NO DICE.");
3.117
3.118 // cout << "Ok - checked if new test home will be safe. We'll try and make the directory, deleting it if it has already exists." << endl;
3.119 @@ -110,7 +175,19 @@
3.120 success = setenv("HOME", temp_test_home.c_str(), 1);
3.121 if (success != 0)
3.122 throw std::runtime_error("SETUP: Cannot set test_home for init.");
3.123 -
3.124 +
3.125 + string tmp_gpg_dir = temp_test_home + "/.gnupg";
3.126 +
3.127 + process_file_queue(tmp_gpg_dir, gpgdir_fileadd_queue);
3.128 + process_file_queue(temp_test_home, homedir_fileadd_queue);
3.129 +
3.130 + if (gpg_conf_copy_path)
3.131 + copy_conf_file_to_test_dir((temp_test_home + "/gnupg").c_str(), gpg_conf_copy_path, "gpg.conf");
3.132 + if (gpg_agent_conf_file_copy_path)
3.133 + copy_conf_file_to_test_dir((temp_test_home + "/gnupg").c_str(), gpg_agent_conf_file_copy_path, "gpg-agent.conf");
3.134 + if (db_conf_file_copy_path)
3.135 + copy_conf_file_to_test_dir(temp_test_home.c_str(), db_conf_file_copy_path, ".pEp_management.db");
3.136 +
3.137 unix_local_db(true);
3.138 gpg_conf(true);
3.139 gpg_agent_conf(true);
4.1 --- a/test/src/SuiteMaker.cc Fri Aug 10 12:37:43 2018 +0200
4.2 +++ b/test/src/SuiteMaker.cc Tue Aug 14 15:46:57 2018 +0200
4.3 @@ -12,159 +12,159 @@
4.4 #include "SuiteMaker.h"
4.5
4.6 // Begin where we generate stuff
4.7 +#include "MapAsn1Tests.h"
4.8 +#include "DecorateTests.h"
4.9 +#include "EncryptMissingPrivateKeyTests.h"
4.10 +#include "KeyeditTests.h"
4.11 +#include "BlacklistAcceptNewKeyTests.h"
4.12 +#include "DecryptAttachPrivateKeyUntrustedTests.h"
4.13 +#include "AppleMailTests.h"
4.14 +#include "CaseAndDotAddressTests.h"
4.15 +#include "SequenceTests.h"
4.16 +#include "BCCTests.h"
4.17 +#include "MessageApiTests.h"
4.18 +#include "I18nTests.h"
4.19 +#include "CrashdumpTests.h"
4.20 +#include "PgpBinaryTests.h"
4.21 +#include "RevokeRegenAttachTests.h"
4.22 +#include "BlacklistTests.h"
4.23 +#include "LeastCommonDenomColorTests.h"
4.24 +#include "PepSubjectReceivedTests.h"
4.25 +#include "MistrustUndoTests.h"
4.26 +#include "StringpairListTests.h"
4.27 +#include "PgpListKeysTests.h"
4.28 +#include "ReencryptPlusExtraKeysTests.h"
4.29 #include "MimeTests.h"
4.30 #include "BloblistTests.h"
4.31 #include "NewUpdateIdAndMyselfTests.h"
4.32 -#include "I18nTests.h"
4.33 +#include "StringlistTests.h"
4.34 +#include "LeastColorGroupTests.h"
4.35 +#include "ExternalRevokeTests.h"
4.36 +#include "EncryptForIdentityTests.h"
4.37 +#include "TrustwordsTests.h"
4.38 +#include "TrustManipulationTests.h"
4.39 +#include "MessageTwoPointOhTests.h"
4.40 +#include "EncryptAttachPrivateKeyTests.h"
4.41 +#include "DecryptAttachPrivateKeyTrustedTests.h"
4.42 #include "IdentityListTests.h"
4.43 -#include "PgpBinaryTests.h"
4.44 -#include "MistrustUndoTests.h"
4.45 -#include "LeastCommonDenomColorTests.h"
4.46 -#include "StringlistTests.h"
4.47 -#include "PgpListKeysTests.h"
4.48 -#include "MessageApiTests.h"
4.49 -#include "EncryptMissingPrivateKeyTests.h"
4.50 -#include "CaseAndDotAddressTests.h"
4.51 #include "UserIDAliasTests.h"
4.52 -#include "BCCTests.h"
4.53 -#include "BlacklistAcceptNewKeyTests.h"
4.54 -#include "DecryptAttachPrivateKeyUntrustedTests.h"
4.55 -#include "BlacklistTests.h"
4.56 -#include "RevokeRegenAttachTests.h"
4.57 -#include "PepSubjectReceivedTests.h"
4.58 -#include "SequenceTests.h"
4.59 -#include "EncryptAttachPrivateKeyTests.h"
4.60 -#include "ExternalRevokeTests.h"
4.61 -#include "KeyeditTests.h"
4.62 -#include "LeastColorGroupTests.h"
4.63 -#include "DecryptAttachPrivateKeyTrustedTests.h"
4.64 -#include "TrustwordsTests.h"
4.65 -#include "ReencryptPlusExtraKeysTests.h"
4.66 -#include "MapAsn1Tests.h"
4.67 -#include "DecorateTests.h"
4.68 -#include "MessageTwoPointOhTests.h"
4.69 -#include "CrashdumpTests.h"
4.70 -#include "StringpairListTests.h"
4.71 -#include "EncryptForIdentityTests.h"
4.72 -#include "TrustManipulationTests.h"
4.73 -#include "AppleMailTests.h"
4.74
4.75
4.76 const char* SuiteMaker::all_suites[] = {
4.77 + "MapAsn1Tests",
4.78 + "DecorateTests",
4.79 + "EncryptMissingPrivateKeyTests",
4.80 + "KeyeditTests",
4.81 + "BlacklistAcceptNewKeyTests",
4.82 + "DecryptAttachPrivateKeyUntrustedTests",
4.83 + "AppleMailTests",
4.84 + "CaseAndDotAddressTests",
4.85 + "SequenceTests",
4.86 + "BCCTests",
4.87 + "MessageApiTests",
4.88 + "I18nTests",
4.89 + "CrashdumpTests",
4.90 + "PgpBinaryTests",
4.91 + "RevokeRegenAttachTests",
4.92 + "BlacklistTests",
4.93 + "LeastCommonDenomColorTests",
4.94 + "PepSubjectReceivedTests",
4.95 + "MistrustUndoTests",
4.96 + "StringpairListTests",
4.97 + "PgpListKeysTests",
4.98 + "ReencryptPlusExtraKeysTests",
4.99 "MimeTests",
4.100 "BloblistTests",
4.101 "NewUpdateIdAndMyselfTests",
4.102 - "I18nTests",
4.103 + "StringlistTests",
4.104 + "LeastColorGroupTests",
4.105 + "ExternalRevokeTests",
4.106 + "EncryptForIdentityTests",
4.107 + "TrustwordsTests",
4.108 + "TrustManipulationTests",
4.109 + "MessageTwoPointOhTests",
4.110 + "EncryptAttachPrivateKeyTests",
4.111 + "DecryptAttachPrivateKeyTrustedTests",
4.112 "IdentityListTests",
4.113 - "PgpBinaryTests",
4.114 - "MistrustUndoTests",
4.115 - "LeastCommonDenomColorTests",
4.116 - "StringlistTests",
4.117 - "PgpListKeysTests",
4.118 - "MessageApiTests",
4.119 - "EncryptMissingPrivateKeyTests",
4.120 - "CaseAndDotAddressTests",
4.121 "UserIDAliasTests",
4.122 - "BCCTests",
4.123 - "BlacklistAcceptNewKeyTests",
4.124 - "DecryptAttachPrivateKeyUntrustedTests",
4.125 - "BlacklistTests",
4.126 - "RevokeRegenAttachTests",
4.127 - "PepSubjectReceivedTests",
4.128 - "SequenceTests",
4.129 - "EncryptAttachPrivateKeyTests",
4.130 - "ExternalRevokeTests",
4.131 - "KeyeditTests",
4.132 - "LeastColorGroupTests",
4.133 - "DecryptAttachPrivateKeyTrustedTests",
4.134 - "TrustwordsTests",
4.135 - "ReencryptPlusExtraKeysTests",
4.136 - "MapAsn1Tests",
4.137 - "DecorateTests",
4.138 - "MessageTwoPointOhTests",
4.139 - "CrashdumpTests",
4.140 - "StringpairListTests",
4.141 - "EncryptForIdentityTests",
4.142 - "TrustManipulationTests",
4.143 - "AppleMailTests",
4.144 };
4.145
4.146 // This file is generated, so magic constants are ok.
4.147 int SuiteMaker::num_suites = 36;
4.148
4.149 void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
4.150 - if (strcmp(test_class_name, "MimeTests") == 0)
4.151 + if (strcmp(test_class_name, "MapAsn1Tests") == 0)
4.152 + *test_suite = new MapAsn1Tests(test_class_name, test_home);
4.153 + else if (strcmp(test_class_name, "DecorateTests") == 0)
4.154 + *test_suite = new DecorateTests(test_class_name, test_home);
4.155 + else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
4.156 + *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
4.157 + else if (strcmp(test_class_name, "KeyeditTests") == 0)
4.158 + *test_suite = new KeyeditTests(test_class_name, test_home);
4.159 + else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
4.160 + *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
4.161 + else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
4.162 + *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
4.163 + else if (strcmp(test_class_name, "AppleMailTests") == 0)
4.164 + *test_suite = new AppleMailTests(test_class_name, test_home);
4.165 + else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
4.166 + *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
4.167 + else if (strcmp(test_class_name, "SequenceTests") == 0)
4.168 + *test_suite = new SequenceTests(test_class_name, test_home);
4.169 + else if (strcmp(test_class_name, "BCCTests") == 0)
4.170 + *test_suite = new BCCTests(test_class_name, test_home);
4.171 + else if (strcmp(test_class_name, "MessageApiTests") == 0)
4.172 + *test_suite = new MessageApiTests(test_class_name, test_home);
4.173 + else if (strcmp(test_class_name, "I18nTests") == 0)
4.174 + *test_suite = new I18nTests(test_class_name, test_home);
4.175 + else if (strcmp(test_class_name, "CrashdumpTests") == 0)
4.176 + *test_suite = new CrashdumpTests(test_class_name, test_home);
4.177 + else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
4.178 + *test_suite = new PgpBinaryTests(test_class_name, test_home);
4.179 + else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
4.180 + *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
4.181 + else if (strcmp(test_class_name, "BlacklistTests") == 0)
4.182 + *test_suite = new BlacklistTests(test_class_name, test_home);
4.183 + else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
4.184 + *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
4.185 + else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
4.186 + *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
4.187 + else if (strcmp(test_class_name, "MistrustUndoTests") == 0)
4.188 + *test_suite = new MistrustUndoTests(test_class_name, test_home);
4.189 + else if (strcmp(test_class_name, "StringpairListTests") == 0)
4.190 + *test_suite = new StringpairListTests(test_class_name, test_home);
4.191 + else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
4.192 + *test_suite = new PgpListKeysTests(test_class_name, test_home);
4.193 + else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
4.194 + *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
4.195 + else if (strcmp(test_class_name, "MimeTests") == 0)
4.196 *test_suite = new MimeTests(test_class_name, test_home);
4.197 else if (strcmp(test_class_name, "BloblistTests") == 0)
4.198 *test_suite = new BloblistTests(test_class_name, test_home);
4.199 else if (strcmp(test_class_name, "NewUpdateIdAndMyselfTests") == 0)
4.200 *test_suite = new NewUpdateIdAndMyselfTests(test_class_name, test_home);
4.201 - else if (strcmp(test_class_name, "I18nTests") == 0)
4.202 - *test_suite = new I18nTests(test_class_name, test_home);
4.203 + else if (strcmp(test_class_name, "StringlistTests") == 0)
4.204 + *test_suite = new StringlistTests(test_class_name, test_home);
4.205 + else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
4.206 + *test_suite = new LeastColorGroupTests(test_class_name, test_home);
4.207 + else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
4.208 + *test_suite = new ExternalRevokeTests(test_class_name, test_home);
4.209 + else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
4.210 + *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
4.211 + else if (strcmp(test_class_name, "TrustwordsTests") == 0)
4.212 + *test_suite = new TrustwordsTests(test_class_name, test_home);
4.213 + else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
4.214 + *test_suite = new TrustManipulationTests(test_class_name, test_home);
4.215 + else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
4.216 + *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
4.217 + else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
4.218 + *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
4.219 + else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
4.220 + *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
4.221 else if (strcmp(test_class_name, "IdentityListTests") == 0)
4.222 *test_suite = new IdentityListTests(test_class_name, test_home);
4.223 - else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
4.224 - *test_suite = new PgpBinaryTests(test_class_name, test_home);
4.225 - else if (strcmp(test_class_name, "MistrustUndoTests") == 0)
4.226 - *test_suite = new MistrustUndoTests(test_class_name, test_home);
4.227 - else if (strcmp(test_class_name, "LeastCommonDenomColorTests") == 0)
4.228 - *test_suite = new LeastCommonDenomColorTests(test_class_name, test_home);
4.229 - else if (strcmp(test_class_name, "StringlistTests") == 0)
4.230 - *test_suite = new StringlistTests(test_class_name, test_home);
4.231 - else if (strcmp(test_class_name, "PgpListKeysTests") == 0)
4.232 - *test_suite = new PgpListKeysTests(test_class_name, test_home);
4.233 - else if (strcmp(test_class_name, "MessageApiTests") == 0)
4.234 - *test_suite = new MessageApiTests(test_class_name, test_home);
4.235 - else if (strcmp(test_class_name, "EncryptMissingPrivateKeyTests") == 0)
4.236 - *test_suite = new EncryptMissingPrivateKeyTests(test_class_name, test_home);
4.237 - else if (strcmp(test_class_name, "CaseAndDotAddressTests") == 0)
4.238 - *test_suite = new CaseAndDotAddressTests(test_class_name, test_home);
4.239 else if (strcmp(test_class_name, "UserIDAliasTests") == 0)
4.240 *test_suite = new UserIDAliasTests(test_class_name, test_home);
4.241 - else if (strcmp(test_class_name, "BCCTests") == 0)
4.242 - *test_suite = new BCCTests(test_class_name, test_home);
4.243 - else if (strcmp(test_class_name, "BlacklistAcceptNewKeyTests") == 0)
4.244 - *test_suite = new BlacklistAcceptNewKeyTests(test_class_name, test_home);
4.245 - else if (strcmp(test_class_name, "DecryptAttachPrivateKeyUntrustedTests") == 0)
4.246 - *test_suite = new DecryptAttachPrivateKeyUntrustedTests(test_class_name, test_home);
4.247 - else if (strcmp(test_class_name, "BlacklistTests") == 0)
4.248 - *test_suite = new BlacklistTests(test_class_name, test_home);
4.249 - else if (strcmp(test_class_name, "RevokeRegenAttachTests") == 0)
4.250 - *test_suite = new RevokeRegenAttachTests(test_class_name, test_home);
4.251 - else if (strcmp(test_class_name, "PepSubjectReceivedTests") == 0)
4.252 - *test_suite = new PepSubjectReceivedTests(test_class_name, test_home);
4.253 - else if (strcmp(test_class_name, "SequenceTests") == 0)
4.254 - *test_suite = new SequenceTests(test_class_name, test_home);
4.255 - else if (strcmp(test_class_name, "EncryptAttachPrivateKeyTests") == 0)
4.256 - *test_suite = new EncryptAttachPrivateKeyTests(test_class_name, test_home);
4.257 - else if (strcmp(test_class_name, "ExternalRevokeTests") == 0)
4.258 - *test_suite = new ExternalRevokeTests(test_class_name, test_home);
4.259 - else if (strcmp(test_class_name, "KeyeditTests") == 0)
4.260 - *test_suite = new KeyeditTests(test_class_name, test_home);
4.261 - else if (strcmp(test_class_name, "LeastColorGroupTests") == 0)
4.262 - *test_suite = new LeastColorGroupTests(test_class_name, test_home);
4.263 - else if (strcmp(test_class_name, "DecryptAttachPrivateKeyTrustedTests") == 0)
4.264 - *test_suite = new DecryptAttachPrivateKeyTrustedTests(test_class_name, test_home);
4.265 - else if (strcmp(test_class_name, "TrustwordsTests") == 0)
4.266 - *test_suite = new TrustwordsTests(test_class_name, test_home);
4.267 - else if (strcmp(test_class_name, "ReencryptPlusExtraKeysTests") == 0)
4.268 - *test_suite = new ReencryptPlusExtraKeysTests(test_class_name, test_home);
4.269 - else if (strcmp(test_class_name, "MapAsn1Tests") == 0)
4.270 - *test_suite = new MapAsn1Tests(test_class_name, test_home);
4.271 - else if (strcmp(test_class_name, "DecorateTests") == 0)
4.272 - *test_suite = new DecorateTests(test_class_name, test_home);
4.273 - else if (strcmp(test_class_name, "MessageTwoPointOhTests") == 0)
4.274 - *test_suite = new MessageTwoPointOhTests(test_class_name, test_home);
4.275 - else if (strcmp(test_class_name, "CrashdumpTests") == 0)
4.276 - *test_suite = new CrashdumpTests(test_class_name, test_home);
4.277 - else if (strcmp(test_class_name, "StringpairListTests") == 0)
4.278 - *test_suite = new StringpairListTests(test_class_name, test_home);
4.279 - else if (strcmp(test_class_name, "EncryptForIdentityTests") == 0)
4.280 - *test_suite = new EncryptForIdentityTests(test_class_name, test_home);
4.281 - else if (strcmp(test_class_name, "TrustManipulationTests") == 0)
4.282 - *test_suite = new TrustManipulationTests(test_class_name, test_home);
4.283 - else if (strcmp(test_class_name, "AppleMailTests") == 0)
4.284 - *test_suite = new AppleMailTests(test_class_name, test_home);
4.285 }
4.286
4.287 void SuiteMaker::suitemaker_buildlist(const char** test_class_names, int num_to_run, const char* test_home, std::vector<Test::Suite*>& test_suites) {
5.1 --- a/test/src/util/test_util.cc Fri Aug 10 12:37:43 2018 +0200
5.2 +++ b/test/src/util/test_util.cc Tue Aug 14 15:46:57 2018 +0200
5.3 @@ -13,6 +13,11 @@
5.4 #include <unistd.h>
5.5 #include <ftw.h>
5.6
5.7 +bool file_exists(std::string filename) {
5.8 + struct stat buffer;
5.9 + return (stat(filename.c_str(), &buffer) == 0);
5.10 +}
5.11 +
5.12 char* str_to_lower(const char* str) {
5.13 if (!str)
5.14 return NULL;