<commit_before>/**
 * @file
 *
 * @brief Tests for the Backend builder class
 *
 * @copyright BSD License (see doc/COPYING or http://www.libelektra.org)
 *
 */

#define ELEKTRA_PLUGINSPEC_WITH_COMPARE

#include <backend.hpp>
#include <backends.hpp>
#include <plugindatabase.hpp>

#include <string>
#include <iostream>
#include <algorithm>
#include <unordered_map>

#include <kdb.hpp>
#include <gtest/gtest.h>

TEST(BackendBuilder, loadAllPlugins)
{
	using namespace kdb;
	using namespace kdb::tools;
	ModulesPluginDatabase mpd;
	Modules m;
	for (auto const & p : mpd.listAllPlugins())
	{
		// std::cout << p << std::endl;
		// if (p == "python") continue;
		// if (p == "python2") continue;
		// if (p == "struct") continue;
		if (p == "jni") continue;
		if (p == "crypto_gcrypt") continue;
		try {
			m.load(p);
			// Backend b;
			// b.addPlugin(PluginSpec(p));
		}
		catch (std::exception const & e)
		{
			EXPECT_TRUE(true) << p;
		}
	}
}<commit_msg>memleaktest: use Backend again<commit_after>/**
 * @file
 *
 * @brief Tests for the Backend builder class
 *
 * @copyright BSD License (see doc/COPYING or http://www.libelektra.org)
 *
 */

#define ELEKTRA_PLUGINSPEC_WITH_COMPARE

#include <backend.hpp>
#include <backends.hpp>
#include <plugindatabase.hpp>

#include <string>
#include <iostream>
#include <algorithm>
#include <unordered_map>

#include <kdb.hpp>
#include <gtest/gtest.h>

TEST(BackendBuilder, loadAllPlugins)
{
	using namespace kdb;
	using namespace kdb::tools;
	ModulesPluginDatabase mpd;
	// Modules m;
	for (auto const & p : mpd.listAllPlugins())
	{
		// std::cout << p << std::endl;
		if (p == "python") continue;
		if (p == "python2") continue;
		if (p == "struct") continue;

		if (p == "jni") continue;
		if (p == "crypto_gcrypt") continue;
		try {
			// m.load(p);
			Backend b;
			b.addPlugin(PluginSpec(p));
		}
		catch (std::exception const & e)
		{
			EXPECT_TRUE(true) << p;
		}
	}
}
{'fraction_non_alphanumeric': 0.1643192488262911, 'fraction_numerical': 0.0010432968179447052, 'mean_word_length': 3.8680203045685277, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6938468', 'n_tokens_mistral': 771, 'n_tokens_neox': 734, 'n_words': 177}