From 987f981abfdd732fb5f6d300c83b0bda1cfac128 Mon Sep 17 00:00:00 2001 From: pallamidessi Date: Fri, 16 May 2014 17:19:48 +0200 Subject: [PATCH] Improve regression testing: done and functional --- examples/regression.sh | 76 ++++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/examples/regression.sh b/examples/regression.sh index 1a42e7f..b589571 100755 --- a/examples/regression.sh +++ b/examples/regression.sh @@ -3,7 +3,7 @@ #TODO color_echo clean(){ - rm -f $1 *.o *.cpp *.hpp *.png *.dat *.prm *.mak Makefile *.vcproj *.csv *.r *.plot *.pop 2> /dev/null; + rm -f $1 *.o *.cpp *.hpp *.png *.dat *.prm *.mak Makefile *.vcproj *.r *.plot *.pop 2> /dev/null; } @@ -26,29 +26,32 @@ test_case(){ fi echo"" + echo"" + echo "$(tput setaf 2)* $program_name *$(tput sgr 0)"; + echo "$(tput setaf 2)* --------------- *$(tput sgr 0)"; clean $program_name; - echo "$(tput setaf 6)Testing easea compilation of $program_name $(tput sgr 0)" + echo "$(tput setaf 6)Testing easea compilation of $easea_cflag $directory_name $(tput sgr 0)" easea $easea_cflag $program_name.ez > /dev/null; error_code=$?; if [[ $error_code != 0 ]] ; then - echo "$(tput setaf 1)Error, easea compilation case $easea_cflag $program_name $(tput sgr 0)" + echo "$(tput setaf 1)Error, easea compilation case $easea_cflag $directory_name $(tput sgr 0)" clean $program_name; #exit 1; else echo "$(tput setaf 2)Pass !!! $(tput sgr 0)" - echo "$(tput setaf 6)Testing compilation of $program_name generated source code$(tput sgr 0)" + echo "$(tput setaf 6)Testing compilation of $ $easea_cflag $directory_name generated source code$(tput sgr 0)" make > /dev/null; error_code=$?; if [[ $error_code != 0 ]] ; then - echo $(tput setaf 1)"Error, compilation case $easea_cflag $program_name $(tput sgr 0)" + echo $(tput setaf 1)"Error, compilation case $easea_cflag $directory_name $(tput sgr 0)" clean $program_name; #exit 2; else echo "$(tput setaf 2)Pass !!! $(tput sgr 0)" - echo "$(tput setaf 6)Testing runtime execution of $program_name$(tput sgr 0)" + echo "$(tput setaf 6)Testing runtime execution of $easea_cflag $directory_name $(tput sgr 0)" ./$program_name --plotStats 0 --remoteIslandModel 0 --nbGen $number_gen > /dev/null; error_code=$?; if [[ $error_code != 0 ]] ; then @@ -60,42 +63,57 @@ test_case(){ fi fi fi + clean $program_name; cd ..; } main(){ - echo"STD tests case" + echo "$(tput setaf 2)****************$(tput sgr 0)"; + echo "$(tput setaf 2)*STD tests case *$(tput sgr 0)"; + echo "$(tput setaf 2)****************$(tput sgr 0)"; test_case ant "" "" ""; test_case bbob2013 "" "" ""; test_case listsort "" "" ""; - test_case michalewicz "" "" ""; + test_case michalewicz "" "" "1"; test_case rastrigin "" "" ""; test_case sphere "" "" ""; - test_case weierstrass "" "" ""; + test_case weierstrass "" "" "1"; test_case cmaes_tests "" "cigtab" ""; - test_case memetic_std "" "memetic_weierstrass" ""; - test_case memetic_std_custom "" "memetic_weierstrass" ""; - - echo"CUDA tests case" + test_case memetic_std "" "memetic_weierstrass" "1"; + test_case memetic_std_custom "" "memetic_weierstrass" "1"; + + echo ""; + echo "$(tput setaf 2)******************$(tput sgr 0)"; + echo "$(tput setaf 2)*CUDA tests case *$(tput sgr 0)" + echo "$(tput setaf 2)******************$(tput sgr 0)"; test_case cmaes_cuda_test "cuda" "cigtabGPU" ""; - test_case memetic_cuda "cuda" "memetic_weierstrass" ""; - test_case memetic_cuda_custom "cuda" "memetic_weierstrass" ""; + test_case memetic_cuda "cuda_mem" "memetic_weierstrass" "1"; + test_case memetic_cuda_custom "cuda_mem" "memetic_weierstrass" "1"; test_case weierstrass "cuda" "" ""; + test_case michalewicz "cuda" "" ""; + test_case rastrigin "cuda" "" ""; - echo"GP tests case" - echo"CUDA GP tests case" - echo"CMAES tests case" -} + echo ""; + echo "$(tput setaf 2)****************$(tput sgr 0)"; + echo "$(tput setaf 2)*GP tests case *$(tput sgr 0)"; + echo "$(tput setaf 2)****************$(tput sgr 0)"; + test_case regression "gp" "" ""; + test_case regression-network "gp" "regression" ""; + test_case regression_okto_simulation "gp" "regression" "1"; -test_case ant "" "" ""; -test_case bbob2013 "" "" ""; -test_case listsort "" ""; -test_case michalewicz "" "" "1"; -test_case rastrigin "" "" ""; -test_case sphere "" "" ""; -test_case weierstrass "" "" "1"; -test_case cmaes_tests "" "cigtab" ""; -test_case memetic_std "" "memetic_weierstrass" ""; -test_case memetic_std_custom "" "memetic_weierstrass" ""; + echo ""; + echo "$(tput setaf 2)*********************$(tput sgr 0)"; + echo "$(tput setaf 2)*CUDA GP tests case *$(tput sgr 0)"; + echo "$(tput setaf 2)*********************$(tput sgr 0)"; + test_case regression "cuda_gp" "" ""; + test_case regression-network "cuda_gp" "regression" ""; + test_case regression_okto_simulation "cuda_gp" "regression" ""; + + echo "" + echo "$(tput setaf 2)*********************$(tput sgr 0)"; + echo "$(tput setaf 2)*CMAES tests case *$(tput sgr 0)" + echo "$(tput setaf 2)*********************$(tput sgr 0)"; +} +main ; -- GitLab