Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lib4neuro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MolDyn
lib4neuro
Commits
6a5c8be8
Commit
6a5c8be8
authored
6 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Fixed run_tests.sh
parent
6e4094a6
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
run_tests.sh
+2
-40
2 additions, 40 deletions
run_tests.sh
src/Neuron/Neuron.cpp
+2
-0
2 additions, 0 deletions
src/Neuron/Neuron.cpp
src/tests/NeuronLinear_test.cpp
+1
-1
1 addition, 1 deletion
src/tests/NeuronLinear_test.cpp
src/tests/neuron_test.cpp
+1
-1
1 addition, 1 deletion
src/tests/neuron_test.cpp
with
6 additions
and
42 deletions
run_tests.sh
+
2
−
40
View file @
6a5c8be8
#!/bin/bash
.
compilers.env
export
FSFLAG
=
'-cpp -I'
echo
"#------------------#----------------------------------------------------------------------------------"
echo
"# FUnit testing... #"
echo
"#------------------#"
FUNIT_SCRIPTS
=
connection_m
cd
src
;
for
F
in
${
FUNIT_SCRIPTS
}
;
do
TEST_STATUS
=
0
;
funit
${
F
}
||
TEST_STATUS
=
1
;
if
[[
TEST_STATUS
-gt
0
]]
;
then
echo
"ERROR: Unit test failed!"
exit
-1
;
fi
done
echo
"#---------------------#-------------------------------------------------------------------------------"
echo
"# Memcheck testing... #"
echo
"#---------------------#"
MEM_TEST_SCRIPTS
=
connection_m_mem_leak_test.out net_m_mem_leak_test.out
cd
../build
;
for
F
in
${
MEM_TEST_SCRIPTS
}
;
do
echo
"Running
${
F
}
..."
TEST1_MEM_STATUS
=
`
valgrind
--leak-check
=
yes
build/
${
F
}
2>&1 |
grep
'LEAK SUMMARY'
|
wc
-l
`
if
[[
TEST1_MEM_STATUS
-gt
0
]]
;
then
echo
"ERROR: Memory leaks detected in
${
F
}
!"
exit
-1
fi
echo
"
${
F
}
OK"
for
f
in
build/bin/
*
_test
;
do
${
f
}
done
echo
"#---------------------------#"
echo
"# No memory leaks detected. #"
echo
"#---------------------------#"
This diff is collapsed.
Click to expand it.
src/Neuron/Neuron.cpp
+
2
−
0
View file @
6a5c8be8
#include
"Neuron.h"
//TODO write INIT method to allocate edges_in and edges_out, so
// it doesn't have to be written in every inherited class
Neuron
::~
Neuron
()
{
if
(
this
->
activation_function_parameters
){
delete
[]
this
->
activation_function_parameters
;
...
...
This diff is collapsed.
Click to expand it.
src/tests/NeuronLinear_test.cpp
+
1
−
1
View file @
6a5c8be8
...
...
@@ -18,7 +18,7 @@ BOOST_AUTO_TEST_SUITE(neuronLinear_test)
NeuronLinear
neuron
(
1.745
,
784.4547
);
BOOST_CHECK_EQUAL
(
neuron
.
activation_function_get_parameter
(
0
),
1.745
);
BOOST_CHECK_EQUAL
(
neuron
.
activation_function_get_parameter
(
0
),
784.4547
);
BOOST_CHECK_EQUAL
(
neuron
.
activation_function_get_parameter
(
1
),
784.4547
);
};
...
...
This diff is collapsed.
Click to expand it.
src/tests/neuron_test.cpp
+
1
−
1
View file @
6a5c8be8
...
...
@@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE(neuron_saturation_test) {
/**
* Test of potencial methods
*/
BOOST_AUTO_TEST_CASE
(
neuron_poten
c
ial_test
)
{
BOOST_AUTO_TEST_CASE
(
neuron_poten
t
ial_test
)
{
NeuronLinear
neuron
(
0
,
0
);
BOOST_CHECK_EQUAL
(
neuron
.
get_potential
(),
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment