Commit 6a5c8be8 authored by Martin Beseda's avatar Martin Beseda

FIX: Fixed run_tests.sh

parent 6e4094a6
#!/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 "#---------------------------#"
#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;
......
......@@ -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);
};
......
......@@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE(neuron_saturation_test) {
/**
* Test of potencial methods
*/
BOOST_AUTO_TEST_CASE(neuron_potencial_test) {
BOOST_AUTO_TEST_CASE(neuron_potential_test) {
NeuronLinear neuron(0, 0);
BOOST_CHECK_EQUAL(neuron.get_potential(), 0);
......
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