Change the place for testing libs mdlp, catch2 and File

Add copyright headers to source files
This commit is contained in:
2024-05-12 10:26:24 +02:00
parent 030ed6bc1c
commit 84d1c834d5
10 changed files with 43 additions and 15 deletions

6
.gitmodules vendored Normal file
View File

@@ -0,0 +1,6 @@
[submodule "tests/lib/Catch2"]
path = tests/lib/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "tests/lib/mdlp"]
path = tests/lib/mdlp
url = https://github.com/rmontanana/mdlp

View File

@@ -39,7 +39,7 @@ add_subdirectory(config)
# -------
if (ENABLE_TESTING)
MESSAGE("Testing enabled")
add_git_submodule("tests/lib/catch2")
add_git_submodule("tests/lib/Catch2")
add_git_submodule("tests/lib/Files")
add_git_submodule("tests/lib/mdlp")
include(CTest)

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2024 rmontanana
Copyright (c) 2024 Ricardo Montañana Gómez
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@@ -1,3 +1,9 @@
// ***************************************************************
// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez
// SPDX-FileType: SOURCE
// SPDX-License-Identifier: MIT
// ***************************************************************
#pragma once
#include <torch/torch.h>
#include <algorithm>

View File

@@ -1,4 +0,0 @@
filter = src/
exclude-directories = build_debug/lib/
print-summary = yes
sort-percentage = yes

View File

@@ -1,3 +1,9 @@
// ***************************************************************
// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez
// SPDX-FileType: SOURCE
// SPDX-License-Identifier: MIT
// ***************************************************************
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_approx.hpp>
#include <catch2/generators/catch_generators.hpp>

1
tests/lib/Catch2 Submodule

Submodule tests/lib/Catch2 added at 4e8d92bf02

View File

@@ -1,3 +1,9 @@
// ***************************************************************
// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez
// SPDX-FileType: SOURCE
// SPDX-License-Identifier: MIT
// ***************************************************************
#include "ArffFiles.h"
#include <fstream>
#include <sstream>

View File

@@ -1,3 +1,9 @@
// ***************************************************************
// SPDX-FileCopyrightText: Copyright 2024 Ricardo Montañana Gómez
// SPDX-FileType: SOURCE
// SPDX-License-Identifier: MIT
// ***************************************************************
#ifndef ARFFFILES_H
#define ARFFFILES_H
@@ -5,15 +11,6 @@
#include <vector>
class ArffFiles {
private:
std::vector<std::string> lines;
std::vector<std::pair<std::string, std::string>> attributes;
std::string className;
std::string classType;
std::vector<std::vector<float>> X;
std::vector<int> y;
void generateDataset(int);
void loadCommon(std::string);
public:
ArffFiles();
void load(const std::string&, bool = true);
@@ -27,6 +24,15 @@ public:
std::vector<int>& getY();
std::vector<std::pair<std::string, std::string>> getAttributes() const;
static std::vector<int> factorize(const std::vector<std::string>& labels_t);
private:
std::vector<std::string> lines;
std::vector<std::pair<std::string, std::string>> attributes;
std::string className;
std::string classType;
std::vector<std::vector<float>> X;
std::vector<int> y;
void generateDataset(int);
void loadCommon(std::string);
};
#endif

1
tests/lib/mdlp Submodule

Submodule tests/lib/mdlp added at 236d1b2f8b