From f07afa50ffa8d2e191815197f678dd979890d40e Mon Sep 17 00:00:00 2001 From: "Oleg E. Peil" Date: Thu, 24 Mar 2016 14:30:50 +0100 Subject: [PATCH] Fixed 'atm' test To make it work one has to create a symlink in 'dft/converters/plovasp' pointing to the built library 'atm.so'. Also, one has to use 'from import ' inside the test itself to avoid problems with module name substitutions. --- python/converters/plovasp/CMakeLists.txt | 3 ++- test/plovasp/atm/test_atm.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/converters/plovasp/CMakeLists.txt b/python/converters/plovasp/CMakeLists.txt index 64bce9c0..6271b4b0 100644 --- a/python/converters/plovasp/CMakeLists.txt +++ b/python/converters/plovasp/CMakeLists.txt @@ -5,6 +5,7 @@ triqs_python_extension(atm ${python_destination}) target_link_libraries(atm atm_c ${TRIQS_LIBRARY_ALL}) triqs_set_rpath_for_target(atm) -#execute_process(COMMAND ln -fs ${CMAKE_CURRENT_BINARY_DIR}/atm.so ${CMAKE_BINARY_DIR}/${python_destination}) +# This we need in order for tests to work +add_custom_command(TARGET atm POST_BUILD COMMAND ln -fs ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/atm.so ${CMAKE_BINARY_DIR}/python/dft/converters/plovasp) install (TARGETS atm DESTINATION ${TRIQS_PYTHON_LIB_DEST_ROOT}/${python_destination}) diff --git a/test/plovasp/atm/test_atm.py b/test/plovasp/atm/test_atm.py index 46736e87..3e22b3f5 100644 --- a/test/plovasp/atm/test_atm.py +++ b/test/plovasp/atm/test_atm.py @@ -2,7 +2,7 @@ import os import numpy as np -import pytriqs.applications.dft.converters.plovasp.atm as atm +from pytriqs.applications.dft.converters.plovasp.atm import dos_tetra_weights_3d import mytest ################################################################################ @@ -25,7 +25,7 @@ class TestProjectorShell(mytest.MyTestCase): en = -0.55 itt = np.array([[1, 0, 1, 2, 3]]).T - res = atm.dos_tetra_weights_3d(eigs, en, itt)[:, 0] + res = dos_tetra_weights_3d(eigs, en, itt)[:, 0] r_should = np.zeros(4) r_should[0] = 0.000309016992226;