mirror of
https://github.com/davidallendj/gdpm.git
synced 2025-12-20 03:27:02 -07:00
Major refactor and API changes
- Updated `.gitignore` file - Updated `CMakeLists.txt` to build static exectuable - Changed some `Doxyfile` configurations to build more robust and complete documentation (WIP) - Changed how `remote` works to better reflect `git`'s API (WIP) - Changed how error handling works - Improved `bin/compile.sh` script - Improved `bin/lines.sh` script (kinda) - Removed some instances of `fmt` in favor of `std` string functions - Restructed style for better readibility
This commit is contained in:
parent
ba23299777
commit
5a73651ad1
29 changed files with 1836 additions and 1140 deletions
|
|
@ -4,11 +4,12 @@
|
|||
#include "log.hpp"
|
||||
#include "cache.hpp"
|
||||
#include "config.hpp"
|
||||
#include "package.hpp"
|
||||
|
||||
#include <doctest.h>
|
||||
|
||||
|
||||
TEST_SUITE("Cache functions"){
|
||||
TEST_SUITE("Caching functions"){
|
||||
|
||||
TEST_CASE("Test cache database functions"){
|
||||
gdpm::cache::create_package_database();
|
||||
|
|
@ -21,33 +22,34 @@ TEST_SUITE("Command functions"){
|
|||
using namespace gdpm::package_manager;
|
||||
|
||||
config::context config = config::make_context();
|
||||
std::vector<std::string> packages{"ResolutionManagerPlugin","godot-hmac", "Godot"};
|
||||
package::params params = package::params();
|
||||
package::title_list package_titles{"ResolutionManagerPlugin","godot-hmac", "Godot"};
|
||||
|
||||
auto check_error = [](const error& error){
|
||||
if(error.has_error()){
|
||||
log::error(error.get_message());
|
||||
if(error.has_occurred()){
|
||||
log::error(error);
|
||||
}
|
||||
|
||||
CHECK(!error.has_error());
|
||||
CHECK(!error.has_occurred());
|
||||
};
|
||||
|
||||
|
||||
TEST_CASE("Test install packages"){
|
||||
check_error(install_packages(packages, true));
|
||||
check_error(package::install(config, package_titles, params));
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Test searching packages"){
|
||||
check_error(search_for_packages(packages, true));
|
||||
check_error(package::search(config, package_titles, params));
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Test remove packages"){
|
||||
check_error(remove_packages(packages, true));
|
||||
check_error(package::remove(config, package_titles, params));
|
||||
}
|
||||
|
||||
TEST_CASE("Test exporting installed package list"){
|
||||
check_error(export_packages({"tests/gdpm/.tmp/packages.txt"}));
|
||||
check_error(package::export_to({"tests/gdpm/.tmp/packages.txt"}));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue