Washington-University / CiftiLib

C++ Library for reading and writing CIFTI-2 and CIFTI-1 files
BSD 2-Clause "Simplified" License
14 stars 10 forks source link

Enable building the testsuite as a standalone project #13

Closed ghisvail closed 7 years ago

ghisvail commented 7 years ago

Right now, the testsuite configured under example/CMakeLists.txt is declared as a separate project but cannot be built nor run standlone. It would be great if the latter were possible to ease CI-testing against existing build of the project, such as in Debian packages.

coalsont commented 7 years ago

The subdirectories were not intended to function as separate projects. For now, I have removed the project statements from all but the top-level CMakeLists.txt.

I'm not really following what you mean by "standalone", the examples obviously have to depend on the library itself, and since they are in the CiftiLib source tree, they should explicitly use the version built from the source tree they are in. The example source files themselves should be trivial to build against an installed version of CiftiLib, if you want them as a separate project, but I don't think the build/test scripts in the CiftiLib source tree should set it up that way. The travis CI setup just runs the tests after building the library (which is when you'd generally want to run the tests anyway).

As an additional wrinkle, changes to the library may result in different defaults in the otherwise unimportant fields of the header (to deal with programs that have different ideas about what a nifti header shouldn't do), which means the checksums in the test script also need to change, though the source code in the examples didn't change (this has happened at least twice already). So, if you want a separated testsuite that will get used against multiple CiftiLib versions, you should probably skip the md5sum tests entirely.

ghisvail commented 7 years ago

I'm not really following what you mean by "standalone"

By "standalone", I mean take an arbitrary deployment of CiftiLib, either from a built or installed tree, and run the test suite against it.

The travis CI setup just runs the tests after building the library (which is when you'd generally want to run the tests anyway).

I run the tests at build time too, like you do with Travis. It was more the integration tests on Debian that I had in mind.

which means the checksums in the test script also need to change, though the source code in the examples didn't change [...] you should probably skip the md5sum tests entirely.

Thanks for the suggestion, I'll update the integrations tests to avoid the checksum part. Considering the comments in your last paragraph, a standalone test suite may not be feasible after-all. Closing.