diff --git a/matlab/cycle_reduction.m b/matlab/cycle_reduction.m index 019c39a190dc6e25d8455e4f678441881fb92b84..59cdc5717d3d1db42ac3cb8d8ad4ac2b37a0050a 100644 --- a/matlab/cycle_reduction.m +++ b/matlab/cycle_reduction.m @@ -125,8 +125,8 @@ end %$ %$ % Solve the equation with the cycle reduction algorithm %$ try -%$ t=cputime; X1 = cycle_reduction(C,B,A,1e-7); elapsedtime = cputime-t; -%$ disp(['cputime for cycle reduction algorithm is: ' num2str(elapsedtime) ' (n=' int2str(n) ').']) +%$ tic; X1 = cycle_reduction(C,B,A,1e-7); elapsedtime = toc; +%$ disp(['Elapsed time for cycle reduction algorithm is: ' num2str(elapsedtime) ' (n=' int2str(n) ').']) %$ t(1) = 1; %$ catch %$ % nothing to do here. @@ -134,8 +134,8 @@ end %$ %$ % Solve the equation with the logarithmic reduction algorithm %$ try -%$ t=cputime; X2 = logarithmic_reduction(A,B,C,1e-16,100); elapsedtime = cputime-t; -%$ disp(['cputime for logarithmic reduction algorithm is: ' num2str(elapsedtime) ' (n=' int2str(n) ').']) +%$ tic; X2 = logarithmic_reduction(A,B,C,1e-16,100); elapsedtime = toc; +%$ disp(['Elapsed time for logarithmic reduction algorithm is: ' num2str(elapsedtime) ' (n=' int2str(n) ').']) %$ t(2) = 1; %$ catch %$ % nothing to do here. diff --git a/matlab/utilities/tests b/matlab/utilities/tests index b2a8b9c059b1e2cb119e8d5fa92b4388fd93c9dd..9e1c32322ff46c661068fbb1f0a1e4ebb83d136f 160000 --- a/matlab/utilities/tests +++ b/matlab/utilities/tests @@ -1 +1 @@ -Subproject commit b2a8b9c059b1e2cb119e8d5fa92b4388fd93c9dd +Subproject commit 9e1c32322ff46c661068fbb1f0a1e4ebb83d136f diff --git a/tests/Makefile.am b/tests/Makefile.am index 6692641575db4b0594eb67d6a6a42214548b74b2..874d44a3ba89246b51ffc7087a361047a3db1538 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -834,7 +834,7 @@ check-octave: $(O_XFAIL_TRS_FILES) $(O_TRS_FILES) @echo "`tput bold``tput setaf 8`MATLAB: $(PWD)/$*... `tput sgr0`" @DYNARE_VERSION="$(PACKAGE_VERSION)" TOP_TEST_DIR="$(PWD)" FILESTEM="$*" \ $(MATLAB)/bin/matlab -nosplash -nodisplay -r run_test_matlab > $*.m.log 2> /dev/null || \ - printf ":test-result: FAIL\n:number-tests: 1\n:number-failed-tests: 1\n:list-of-failed-tests: $*.mod\n:cputime: 0.0\n" > $*.m.trs + printf ":test-result: FAIL\n:number-tests: 1\n:number-failed-tests: 1\n:list-of-failed-tests: $*.mod\n:elapsed-time: 0.0\n" > $*.m.trs @if grep -q ":test-result: PASS" $*.m.trs; then \ echo "`tput bold``tput setaf 2`MATLAB: $(PWD)/$* PASSED!`tput sgr0`" ; \ else \ @@ -854,7 +854,7 @@ check-octave: $(O_XFAIL_TRS_FILES) $(O_TRS_FILES) @echo "`tput bold``tput setaf 8`OCTAVE: $(PWD)/$*... `tput sgr0`" @DYNARE_VERSION="$(PACKAGE_VERSION)" TOP_TEST_DIR="$(PWD)" FILESTEM="$*" \ $(OCTAVE) --no-init-file --silent --no-history --path "$*.mod" run_test_octave.m > $*.o.log 2>&1 || \ - printf ":test-result: FAIL\n:number-tests: 1\n:number-failed-tests: 1\n:list-of-failed-tests: $*.mod\n:cputime: 0.0\n" > $*.o.trs + printf ":test-result: FAIL\n:number-tests: 1\n:number-failed-tests: 1\n:list-of-failed-tests: $*.mod\n:elapsed-time: 0.0\n" > $*.o.trs @if grep -q ":test-result: PASS" $*.o.trs; then \ echo "`tput bold``tput setaf 2`OCTAVE: $(PWD)/$* PASSED!`tput sgr0`" ; \ else \ diff --git a/tests/run_all_unitary_tests.m b/tests/run_all_unitary_tests.m index 34ab08a211f96d3248e54b920fbdaed1afc92135..b31f9d8adabc51673eaf518e67d53f95fe96f0e2 100644 --- a/tests/run_all_unitary_tests.m +++ b/tests/run_all_unitary_tests.m @@ -82,7 +82,7 @@ else fprintf(fid,':number-tests: %d\n', counter); fprintf(fid,':number-failed-tests: 0\n'); end -fprintf(fid,':cputime: %f\n',0.0); +fprintf(fid,':elapsed-time: %f\n',0.0); fclose(fid); if ~isoctave exit diff --git a/tests/run_block_byte_tests_matlab.m b/tests/run_block_byte_tests_matlab.m index 530d2f7a8c87b98aac7fce7e6ccde2b49aa2425e..846beadecf1403dcc6cfdd82aa7819c669757db1 100644 --- a/tests/run_block_byte_tests_matlab.m +++ b/tests/run_block_byte_tests_matlab.m @@ -38,7 +38,7 @@ failedBlock = {}; num_block_tests = 0; cd([top_test_dir filesep 'block_bytecode']); has_optimization_toolbox = user_has_matlab_license('optimization_toolbox'); -cput = cputime; +tic; for blockFlag = 0:1 for bytecodeFlag = 0:1 default_solve_algo = 2; @@ -129,7 +129,7 @@ for blockFlag = 0:1 end end end -ecput = cputime - cput; +ecput = toc; delete('wsMat.mat') cd(getenv('TOP_TEST_DIR')); fid = fopen('run_block_byte_tests_matlab.m.trs', 'w+'); @@ -143,6 +143,6 @@ else fprintf(fid,':number-tests: %d\n', num_block_tests); fprintf(fid,':number-failed-tests: 0\n'); end -fprintf(fid,':cputime: %f\n', ecput); +fprintf(fid,':elapsed-time: %f\n', ecput); fclose(fid); exit; diff --git a/tests/run_block_byte_tests_octave.m b/tests/run_block_byte_tests_octave.m index a915e9752679ab5ecd43b82679d16ea94d4a974f..288a17e9428d44164c28c79861fd050f3fd13b35 100644 --- a/tests/run_block_byte_tests_octave.m +++ b/tests/run_block_byte_tests_octave.m @@ -40,7 +40,7 @@ putenv("GNUTERM", "dumb") failedBlock = {}; num_block_tests = 0; cd([top_test_dir filesep 'block_bytecode']); -cput = cputime; +tic; for blockFlag = 0:1 for bytecodeFlag = 0:1 ## Recall that solve_algo=7 and stack_solve_algo=2 are not supported @@ -131,7 +131,7 @@ for blockFlag = 0:1 endfor endfor endfor -ecput = cputime - cput; +ecput = toc; delete('wsOct'); cd(getenv('TOP_TEST_DIR')); fid = fopen('run_block_byte_tests_octave.o.trs', 'w+'); @@ -145,7 +145,7 @@ else fprintf(fid,':number-tests: %d\n', num_block_tests); fprintf(fid,':number-failed-tests: 0\n'); end -fprintf(fid,':cputime: %f\n', ecput); +fprintf(fid,':elapsed-time: %f\n', ecput); fclose(fid); ## Local variables: ## mode: Octave diff --git a/tests/run_reporting_test_matlab.m b/tests/run_reporting_test_matlab.m index e5729c7321ea03b46ad306762bc7808022f1ff5c..3c5ccb95deae5d07f2c3814e856cf109034af2e4 100644 --- a/tests/run_reporting_test_matlab.m +++ b/tests/run_reporting_test_matlab.m @@ -54,6 +54,6 @@ else fprintf(fid,':number-failed-tests: 0\n'); fprintf(fid,':list-of-passed-tests: run_reporting_test_matlab.m\n'); end -fprintf(fid,':cputime: %f\n',0.0); +fprintf(fid,':elapsed-time: %f\n',0.0); fclose(fid); exit; diff --git a/tests/run_reporting_test_octave.m b/tests/run_reporting_test_octave.m index 43c6067fcfe62d372876e2369d153762a7e3b333..32edcfb630f147e4bb2b2388f3be38e7d0035bf2 100644 --- a/tests/run_reporting_test_octave.m +++ b/tests/run_reporting_test_octave.m @@ -60,7 +60,7 @@ else fprintf(fid,':number-failed-tests: 0\n'); fprintf(fid,':list-of-passed-tests: run_reporting_test_octave.m\n'); end -fprintf(fid,':cputime: %f\n',0.0); +fprintf(fid,':elapsed-time: %f\n',0.0); fclose(fid); ## Local variables: