Add minimal components.cif

This commit is contained in:
Maarten L. Hekkelman
2026-04-14 11:50:24 +02:00
parent f5a2566b5d
commit 5187ff7355
3 changed files with 2708 additions and 15 deletions

View File

@@ -118,14 +118,14 @@ CPMFindPackage(
EXCLUDE_FROM_ALL YES)
# No longer using CPM for libcifpp. It is now simply required to install it first.
find_package(cifpp 10.0.1 QUIET)
find_package(cifpp 10.0.2 QUIET)
if(NOT (cifpp_FOUND OR TARGET cifpp))
# message(FATAL_ERROR "Could not find libcifpp. Please make sure you install libcifpp first, code can be found at https://github.com/PDB-REDO/libcifpp")
CPMAddPackage(
NAME cifpp
GIT_REPOSITORY "https://github.com/PDB-REDO/libcifpp"
GIT_TAG v10.0.1
GIT_TAG v10.0.2
EXCLUDE_FROM_ALL YES)
endif()

2686
test/minimal-components.cif Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -84,6 +84,10 @@ int main(int argc, char *argv[])
if (not rsrc_dir.empty() and std::filesystem::exists(rsrc_dir))
cif::add_data_directory(rsrc_dir);
cif::add_data_directory(gTestDir / "libdssp" / "mmcif_pdbx");
cif::add_file_resource("components.cif", gTestDir / "minimal-components.cif");
return session.run();
}
@@ -129,16 +133,12 @@ TEST_CASE("ut_dssp")
if (cif::starts_with(line_t, "REFERENCE ") and cif::starts_with(line_r, "REFERENCE "))
continue;
std::cerr << line_nr << '\n'
<< line_t << '\n'
<< line_r << '\n';
// std::cerr << line_nr << '\n'
// << line_t << '\n'
// << line_r << '\n';
}
if (line_t != line_r)
{
CHECK(line_t == line_r);
break;
}
REQUIRE(line_t == line_r);
}
CHECK(test.eof());
@@ -162,18 +162,25 @@ TEST_CASE("ut_mmcif_2")
auto &db1 = f.front();
auto &db2 = rf.front();
db1["software"].erase("name"_key == "dssp");
db1["software"].erase("name"_key == "DSSP");
std::erase_if(db1, [](cif::category &cat)
{ return cat.name() == "audit_conform"; });
db2["software"].erase("name"_key == "dssp");
db2["software"].erase("name"_key == "DSSP");
std::erase_if(db2, [](cif::category &cat)
{ return cat.name() == "audit_conform"; });
// generate some output on different files:
// cif::VERBOSE = 2;
if (not (f.front() == rf.front()))
{
// std::ofstream a(std::filesystem::temp_directory_path() / "dssp-test-a.cif");
// a << f.front();
// a.close();
// std::ofstream b(std::filesystem::temp_directory_path() / "dssp-test-b.cif");
// b << rf.front();
// b.close();
CHECK(f.front() == rf.front());
CHECK(false);
}
}
// --------------------------------------------------------------------