tbeu / matio

MATLAB MAT File I/O Library
https://matio.sourceforge.io
BSD 2-Clause "Simplified" License
334 stars 97 forks source link

Many tests cases erroneously reported as FAILED #67

Closed jfilo closed 7 years ago

jfilo commented 7 years ago

The following tests are reported as failed even though they really pass:

2665-2680
2684-2754
2758-2828
2834-2904
2911-2980

It looks like the generated 'testsuite' script is adding an extra newline to the Matlab output, causing the script to think the test failed.

Editing the generated testsuite with the following sed script fixes the problem and all the above tests pass.

sed -i '/^echo >>"\$at_stdout"; \$as_echo "PASSED"/s/^echo/echo -n/' testsuite

Maybe there is an issue with my version of autoconf (version 2.69 on a RHEL 7 system)?

tbeu commented 7 years ago

Thanks for reporting. As these tests are all the write tests, does it fail in the writing check or in the subsequent reading check?

jfilo commented 7 years ago

They fail in last step; the Matlab portion of the read test. The 'echo >>$"at_stdout"; ' seems unnecessary since there is already a "\n" in the final fprintf that reports the results in each of the Matlab test scripts. So the test driver ends up comparing "PASSED\n\n" to "PASSED\n" and reports a failure. My simple sed hack was really the wrong approach. I added a '-n' to the echo. It would have made more sense to just remove the echo all together. I didn't see anything in the call to AC_CHECK (e.g. test/mat5_compressed_write.at:299) that would result in the extra echo, but I've never really used that package before.

tbeu commented 7 years ago

Do you also see the error when you use the Ubuntu generatd testsuite from the latest matio-1.5.10.tar.gz?

tbeu commented 7 years ago

I am aware of the MATLAB part of the write tests success from https://github.com/tbeu/matio/pull/31#issuecomment-204542466 when @papadop reorganized the test suite.

jfilo commented 7 years ago

I just spot checked a few tests using testsuite from matio-1.5.10.tar.gz, and they're failing the same way. That version of testsuite still has what appears to be an unnecessary newline added to the Matlab output. For example, test #2664, at testsuite:92564. If you remove the echo >> "$at_stdout"; at the beginning of the line, the test passes.

jfilo commented 7 years ago

The commit in the above comment works around the problem by adding a newline to the expected output (i.e. [PASSED]) in the Matlab read portion of each of the write tests. There is a subsequent commit that removes a stray newline that was introduced in that commit. It seems like there has to be a better way to do this though.

tbeu commented 7 years ago

Thanks. I'll consider it later.

tbeu commented 7 years ago

Thanks. Fix applied.

There is a subsequent commit that removes a stray newline that was introduced in that commit. It seems like there has to be a better way to do this though.

You can do have git commit --ammend and the git push --force to your branch,

tbeu commented 6 years ago

@jfilo I'd like to mention you in the README.md and README files acknowledgements section for you valuable contribution. Is is alright for you? Thanky you again!

jfilo commented 6 years ago

no problem

On 10/15/2017 3:16 PM, tbeu wrote:

@jfilo https://github.com/jfilo I'd like to mention you in the README.md and README files acknowledgements section for you valuable contribution. Is is alright for you? Thanky you again!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tbeu/matio/issues/67#issuecomment-336738295, or mute the thread https://github.com/notifications/unsubscribe-auth/AXX5sEwWU1B10EX7O_pSDcmzjs8G6KEEks5ssmgLgaJpZM4ODI9E.