Closed massich closed 4 years ago
Sorry, I have no clue what this is about.
https://github.com/Homebrew/homebrew-core/pull/38454
To sum up, I would like to build some projects to have CIs that test the package shipping through brew, conda, whatever. By the end they would be a bunch of almost empty projects that run CIs to capture early failure.
I could do that on my own account but I think it would be better if we build an organization. It's way cleaner.
What is wrong with reusing or adapting test_mat.c for your tests?
test_mat.c
builds a main parsing args and everything. The only thing that is needed here is a tiny test making sure that it can link. Sure we can also add it to matio testsuit and build it from there.
The only thing that is needed here is a tiny test making sure that it can link.
Here it is:
#include <stdlib.h>
#include <matio.h>
int main(int argc, char **argv) {
int a = -1, b = -1, c = -1;
Mat_GetLibraryVersion(&a, &b, &c);
return (a >= 0 && b >= 0 && c >= 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
Does this help you to fix the issue?
I used this one:
#include <stdlib.h>
#include <matio.h>
size_t dims[2] = {5, 5};
double data[25] = {0.0, };
mat_t *mat;
matvar_t *matvar;
int main(int argc, char **argv) {
if (!(mat = Mat_Open(argv[1], MAT_ACC_RDONLY)))
abort();
Mat_Close(mat);
mat = Mat_CreateVer("test_writenan.mat", NULL, MAT_FT_DEFAULT);
if (mat) {
matvar = Mat_VarCreate("foo", MAT_C_DOUBLE, MAT_T_DOUBLE, 2,
dims, data, MAT_F_DONT_COPY_DATA);
Mat_VarWrite(mat, matvar, MAT_COMPRESSION_NONE);
Mat_VarFree(matvar);
Mat_Close(mat);
} else {
abort();
}
mat = Mat_CreateVer("foo", NULL, MAT_FT_MAT73);
return EXIT_SUCCESS;
}
So, can we close this issue then as resolved?
I'm updating the Homebrew's matio tests. The tests that check that the precompiled packages they ship are actually fine.
IMHO it would be good that all shipping platforms share the same tests. A tiny test that makes sure that what is shipped is proper and make it common across platform.
I put it in this gist: https://gist.github.com/massich/7709ac62edd86047293f01c79f8cf819
Feel free to submit PRs to make it better. I do not know the minimum test that would ensure that the binary libraries are properly shipped.
IMHO we should put some infrastructure around matio. Many software packages depend on it, and sometimes the resources are disseminated. @tbeu if you create a github group to gather all the efforts I'll gladly transfer you the gist.