Updated and refactored code

- Added `doxygen` API documentation with theme
- Added error-compatible logging function
- Added more error codes
- Added `non_copyable` function
- Added test function from exporting package list
- Changed how errors are handled with returns
- Change `gdpm remote` API to reflect `git`
- Change most functions to accept a vector of arguments instead of a single parameter
- Updated `.gitignore` and `README.md` files
- Fixed issue with `gdpm export` command crashing
This commit is contained in:
David Allen 2023-05-14 19:30:33 -06:00
parent 8e82a22ebd
commit ba23299777
14 changed files with 2950 additions and 93 deletions

View file

@ -8,7 +8,7 @@
#include <doctest.h>
TEST_SUITE("Test database functions"){
TEST_SUITE("Cache functions"){
TEST_CASE("Test cache database functions"){
gdpm::cache::create_package_database();
@ -16,11 +16,12 @@ TEST_SUITE("Test database functions"){
}
TEST_SUITE("Package manager function"){
TEST_SUITE("Command functions"){
using namespace gdpm;
using namespace gdpm::package_manager;
std::vector<std::string> packages{"ResolutionManagerPlugin","godot-hmac", "Godot"};
config::context config = config::make_context();
std::vector<std::string> packages{"ResolutionManagerPlugin","godot-hmac", "Godot"};
auto check_error = [](const error& error){
if(error.has_error()){
@ -32,20 +33,21 @@ TEST_SUITE("Package manager function"){
TEST_CASE("Test install packages"){
error error = package_manager::install_packages(packages, true);
check_error(error);
check_error(install_packages(packages, true));
}
TEST_CASE("Test searching packages"){
error error = package_manager::search_for_packages(packages, true);
check_error(error);
check_error(search_for_packages(packages, true));
}
TEST_CASE("Test remove packages"){
error error = package_manager::remove_packages(packages, true);
check_error(error);
check_error(remove_packages(packages, true));
}
TEST_CASE("Test exporting installed package list"){
check_error(export_packages({"tests/gdpm/.tmp/packages.txt"}));
}
}