Bug 5210 - needs a testsuite
Summary: needs a testsuite
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Jonathan Blandford
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-02 03:22 UTC by Matthias Clasen
Modified: 2007-08-28 06:46 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
test suite (214.28 KB, application/postscript)
2005-12-02 03:23 UTC, Matthias Clasen
Details

Description Matthias Clasen 2005-12-02 03:22:43 UTC
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.
Comment 1 Matthias Clasen 2005-12-02 03:23:21 UTC
Created attachment 3965 [details]
test suite
Comment 2 Bastien Nocera 2007-08-28 06:46:05 UTC
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.