We need a collection of files and filenames and expected mimetypes, in order to verify that the shared-mime-info actually works, and to prevent regressions. Once we have such a testsuite, every new addition to shared-mime-info should be accompagnied by additions to the the testsuite, IMO. I have begun work on such a testsuite, using the xdgmime reference implementation. I'll attach what I currently have. To try it, you need to compile test-mime-data against the xdgmime code. I'm not sure where this would best live. The testdata would ideally live close to the mime data, which would point to shared-mime-info. But the test app uses xdgmime, so that would point to xdgmime. Or maybe it should be a separate module.
Created attachment 3965 [details] test suite
In xdgmime: 2007-08-28 Bastien Nocera <hadess@hadess.net> * src/.cvsignore: * src/Makefile: * src/test-mime-data.c: Add test-mime-data test program from Matthias Clasen <mclasen@redhat.com> (Closes: #5210) And in shared-mime-info: 2007-08-28 Bastien Nocera <hadess@hadess.net> * configure.ac: Check for xmllint * Makefile.am: run test-mime-data from xdgmime if we're running in CVS and have xdgmime checked out and built in the parent * tests/*: add loads of test data and a test list from Matthias Clasen <mclasen@redhat.com> (Closes: #5210) * freedesktop.org.xml.in: - Remove "Microsoft Word 6.0 Document" matchlet at offset 2080, it's a localised string (ie. says "Dokument" in German, etc.) - Add better matchlets from file(1) for word documents - Add magic for StarWriter (tentative) and for glade files - Up the priority of the EPS matchlet so that EPS files are not recognised as postscript files The check target in the Makefile will update the mime database from the .xml in the builddir, and run the testsuite against it, making it easy to check for errors during build. Christian, please make sure to add test data to the CVS when you do commits.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.