GNOME Bugzilla – Bug 482319
Switch from PCRE to GRegex
Last modified: 2008-04-26 01:24:47 UTC
We should be able to drop the pcre dependency, but glib needs work.
What do we need in glib to make this feasible for 1.8 ?
s/1.8/1.10/
Get the fixed glib deployed, I guess. I would think that we can do "use glib if fixed" right now.
Created attachment 109736 [details] [review] proposed patch NOTE: Some error codes of go_regcomp() slightly changed since some error codes are dropped in GRegex. So application using GORegexp may receive different error messages.
Looks generally good, although I don't think we can require anything near glib 2.16 yet. Latest OpenSUSE comes with something like 2.12, give or take. I imagine RedHat is similar. Hence we should check for something like G_REGEX_ERROR_STRAY_BACKSLASH and use glib if it is present and pcre otherwise. I am not worried over adjusting error codes. What kinds of tests has this been through?
(In reply to comment #5) > Looks generally good, although I don't think we can require anything near > glib 2.16 yet. Latest OpenSUSE comes with something like 2.12, give or take. > I imagine RedHat is similar. Hence we should check for something like > G_REGEX_ERROR_STRAY_BACKSLASH and use glib if it is present and pcre > otherwise. OK. I will revise the patch tomorrow. > What kinds of tests has this been through? Loading samples/excel/datefuns.xls in gnumeric with Gnumeric. Yes, I would like to add more test cases for goffice. Can I use GTester in GLib? To tell the truth, I am a developer an Unit Testing Framework, Cutter[1] by name. I would like to use it if you'd like. Thank you, [1] http://cutter.sourceforge.net/
We certainly wouldn't frown on a unit testing framework. How does cutter compare with GTester ?
Just make sure the test environment doesn't add some new requirement, i.e., make sure it defaults to doing nothing if GTester/cutter/whatever is not available.
Created attachment 109873 [details] [review] revised patch Enclose huge ifdef blocks for readability.
(In reply to comment #7) > We certainly wouldn't frown on a unit testing framework. How does cutter > compare with GTester ? These are my perspective. :-) == Cutter * Easy to write (No need to register each test explicitly) * Fast (One process per test suite, each test case can be run on multithread) * Output stack trace when crashed == GTester * Supplied with GLib. * Relatively slow (One process per test case) I will post sample tests respectively.
(In reply to comment #8) > Just make sure the test environment doesn't add some new requirement, > i.e., make sure it defaults to doing nothing if GTester/cutter/whatever > is not available. Yes, I will do so.
I opened a new bug about test. BUG #529832. Sorry for redundant information.
Committed. There were a number of problems: 1. _STRA_ --> _STRAY_ 2. Leaked match_info in the no-match case. 3. Overwrote memory with extra matches. 4. Confused parentheses and multiple matches. The GUI test case is Gnumeric's search-and-replace.