Commit f49fcd3d authored by Martin Beseda's avatar Martin Beseda

TMP (Uncompilable): Started writing neuron_m module, fixed Doxygen comments

parent 632282cb
......@@ -6,3 +6,4 @@
compilers.env
*TestRunner*
*_fun.f90
src/funit.tmp
......@@ -2375,7 +2375,7 @@ DOT_IMAGE_FORMAT = png
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
INTERACTIVE_SVG = YES
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
......
......@@ -11,7 +11,7 @@
BUILD_TYPE=Debug
# Turn of/off time profiling (1/0)
WITH_TIME_PROFILING=0
WITH_TIME_PROFILIN=1
#--------------#----------------------------------------------------------
# Library path #
......
echo "Generating documentation into folder 'docs'...";
doxygen >/dev/null && echo "Documenation was generated." || exit -1;
doxygen 2>&1 >/dev/null | grep -v 'normal_m.f90' && echo "Documenation was generated." || exit -1;
cd docs/latex;
echo "Building LaTeX documentation../";
make >/dev/null && echo "Documentation was built." || exit -1;
......
......@@ -4,3 +4,4 @@ rm -rf build
rm -rf docs/*
rm -f src/*TestRunner*
rm -f src/*.o src/*.mod
rm -f src/funit.tmp
......@@ -10,7 +10,13 @@ echo "#------------------#"
FUNIT_SCRIPTS=connection_m
cd src;
for F in ${FUNIT_SCRIPTS}; do
funit ${F};
funit ${F} 2>&1 |tee funit.tmp;
TEST_STATUS=`grep 'failed <<<<<' funit.tmp` | wc -l
if [[ TEST_STATUS -gt 0 ]]; then
echo "ERROR: Unit test failed!"
exit -1;
fi
done
echo "#---------------------#-------------------------------------------------------------------------------"
......
project(Modules)
enable_language(Fortran)
add_library(neuron_dummy_m SHARED neuron_dummy_m.f90)
set_target_properties(neuron_dummy_m PROPERTIES LINKER_LANGUAGE Fortran)
add_library(time_measurement_m SHARED time_measurement_m.f90)
set_target_properties(time_measurement_m PROPERTIES LINKER_LANGUAGE Fortran)
add_library(normal_m SHARED normal_m.f90)
set_target_properties(normal_m PROPERTIES LINKER_LANGUAGE Fortran)
add_library(neuron_m SHARED neuron_m.f90)
set_target_properties(neuron_m PROPERTIES LINKER_LANGUAGE Fortran)
target_link_libraries(neuron_m time_measurement_m)
add_library(connection_m SHARED connection_m.f90)
set_target_properties(connection_m PROPERTIES LINKER_LANGUAGE Fortran)
target_link_libraries(connection_m neuron_dummy_m time_measurement_m normal_m)
target_link_libraries(connection_m neuron_m time_measurement_m normal_m)
This diff is collapsed.
program connection_mem_leak_test
use connection_m
use neuron_dummy_m
use neuron_m
use normal_m
type(neuron_t), target :: n1
type(neuron_t), target :: n2
type(mock_neuron_t), target :: n1
type(mock_neuron_t), target :: n2
type(neuron_t), pointer :: n1_p
type(neuron_t), pointer :: n2_p
type(neuron_t), pointer :: dummy_p
type(mock_neuron_t), pointer :: n1_p
type(mock_neuron_t), pointer :: n2_p
type(mock_neuron_t), pointer :: dummy_p
type(interval_connection_t), pointer :: con1, con2
......@@ -17,14 +17,8 @@ program connection_mem_leak_test
print *, '+---------------------------------------------------------+'
print *, 'Creating instances of the class neuron_t...'
n1 = neuron_t(21.3)
n2 = neuron_t(13.7)
print *, 'neuron_t instances were created successfully.'
print *, 'Assigning instances to pointer...'
n1_p => n1
n2_p => n2
print *, 'Assignment was successful.'
n1_p => mock_neuron_t()
n2_p => mock_neuron_t()
print *, 'Creating an instance of the class interval_connection_t with 3-parameters constructor...'
con1 => interval_connection_t(input_neuron=n1_p, &
......
module neuron_dummy_m
implicit none
public
! TODO smazat
!> neuron class
type :: neuron_t
real :: state
contains
procedure :: get_state => get_state_impl
procedure :: set_state => set_state_impl
end type neuron_t
contains
!--------------!
! class neuron_t !
!--------------!
! TODO smazat
function get_state_impl(this) result(state)
class(neuron_t), intent(in) :: this
real :: state
state = this%state
end function get_state_impl
! TODO smazat
subroutine set_state_impl(this, new_state)
class(neuron_t), target :: this
real, intent(in) :: new_state
this%state = new_state
end subroutine set_state_impl
end module
This diff is collapsed.
......@@ -11,7 +11,7 @@ module time_measurement_m
contains
!> Subroutine for starting time profiling
!! @param[in,out] start_time Parameter, where current time will be saved (real number)
!! @param[out] start_time Parameter, where current time will be saved (real number)
subroutine time_profiling_start(start_time)
real, intent(inout) :: start_time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment