Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
45a7defb
Unverified
Commit
45a7defb
authored
Oct 13, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix all tests to work with embedded data, no CCD, part 3
parent
906f6ac1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
14 deletions
+21
-14
test/structure-test.cpp
+10
-5
test/unit-test.cpp
+11
-9
No files found.
test/structure-test.cpp
View file @
45a7defb
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/
#define BOOST_TEST_
MODULE Structure_Test
#define BOOST_TEST_
ALTERNATIVE_INIT_API
#include <boost/test/included/unit_test.hpp>
#include <boost/test/included/unit_test.hpp>
#include <stdexcept>
#include <stdexcept>
...
@@ -52,18 +52,23 @@ cif::File operator""_cf(const char* text, size_t length)
...
@@ -52,18 +52,23 @@ cif::File operator""_cf(const char* text, size_t length)
std
::
filesystem
::
path
gTestDir
=
std
::
filesystem
::
current_path
();
std
::
filesystem
::
path
gTestDir
=
std
::
filesystem
::
current_path
();
BOOST_AUTO_TEST_CASE
(
init
)
bool
init_unit_test
(
)
{
{
// not a test, just initialize test dir
cif
::
VERBOSE
=
1
;
// not a test, just initialize test dir
if
(
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
==
2
)
if
(
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
==
2
)
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
// do this now, avoids the need for installing
cif
::
addFileResource
(
"mmcif_pdbx_v50.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx_v50.dic"
);
// initialize CCD location
// initialize CCD location
if
(
std
::
filesystem
::
exists
(
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
))
cif
::
addFileResource
(
"components.cif"
,
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
);
cif
::
addFileResource
(
"components.cif"
,
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
);
mmcif
::
CompoundFactory
::
instance
().
pushDictionary
(
gTestDir
/
"HEM.cif"
);
mmcif
::
CompoundFactory
::
instance
().
pushDictionary
(
gTestDir
/
"HEM.cif"
);
return
true
;
}
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
...
...
test/unit-test.cpp
View file @
45a7defb
...
@@ -24,7 +24,8 @@
...
@@ -24,7 +24,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/
#define BOOST_TEST_MODULE LibCifPP_Test
#define BOOST_TEST_ALTERNATIVE_INIT_API
// #define BOOST_TEST_MODULE LibCifPP_Test
#include <boost/test/included/unit_test.hpp>
#include <boost/test/included/unit_test.hpp>
#include <stdexcept>
#include <stdexcept>
...
@@ -53,26 +54,27 @@ cif::File operator""_cf(const char* text, size_t length)
...
@@ -53,26 +54,27 @@ cif::File operator""_cf(const char* text, size_t length)
// --------------------------------------------------------------------
// --------------------------------------------------------------------
BOOST_AUTO_TEST_CASE
(
init
)
bool
init_unit_test
(
)
{
{
cif
::
VERBOSE
=
1
;
// not a test, just initialize test dir
// not a test, just initialize test dir
if
(
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
==
2
)
if
(
boost
::
unit_test
::
framework
::
master_test_suite
().
argc
==
2
)
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
// do this now, avoids the need for installing
cif
::
addFileResource
(
"mmcif_pdbx_v50.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx_v50.dic"
);
// initialize CCD location
// initialize CCD location
if
(
std
::
filesystem
::
exists
(
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
))
cif
::
addFileResource
(
"components.cif"
,
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
);
cif
::
addFileResource
(
"components.cif"
,
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
);
return
true
;
}
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
BOOST_AUTO_TEST_CASE
(
ut1
)
BOOST_AUTO_TEST_CASE
(
ut1
)
{
{
cif
::
VERBOSE
=
1
;
// do this now, avoids the need for installing
cif
::
addFileResource
(
"mmcif_pdbx_v50.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx_v50.dic"
);
// using namespace mmcif;
// using namespace mmcif;
auto
f
=
R"(data_TEST
auto
f
=
R"(data_TEST
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment