summaryrefslogtreecommitdiff
path: root/test/rules-file.c
AgeCommit message (Collapse)AuthorFilesLines
2012-09-24API: add _context prefix to log-related functionsRan Benita1-6/+6
This is to follow the general scheme set by all of the other API functions. Since no one is using these functions yet, we don't (actually better not) add the old names to xkbcommon-compat.h. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-16Organize src/ and test/ headersRan Benita1-5/+1
- Add context.h and move context-related functions from xkb-priv.h to it. - Move xkb_context definition back to context.c. - Add keysym.h and move keysym upper/lower/keypad from xkb-priv.h to it. - Rename xkb-priv.h to map.h since it only contains keymap-related definitions and declarations now. - Remove unnecessary includes and some and some other small cleanups. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-03test/rules-file: add benchmarkRan Benita1-7/+48
Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-03rules: fix check for appending '|' character when applyingRan Benita1-1/+1
There are two ways to separate multiple files in XKB include statements: '+' will cause the later file to override the first in case of conflict, while '|' will cause it augment it (this is done by xkbcomp). '!' is unrelated here. Since '|' is practically never used, this wasn't noticed. In the modified test, the '|some_compat' previously was just ignored. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-01Organize xkbcomp/ header filesRan Benita1-2/+2
Various non-functional changes: - Re-add keycodes.h and move some stuff there. - Add parser-priv.h for internal bison/flex stuff. - Don't include headers from other headers, such that file dependencies are immediate in each file. - Rename xkbcomp.h -> ast.h, parseutils.{c,h} -> ast-build.{c,h} - Rename path.{c,h} -> include.{c,h} - Rename keytypes.c -> types.c - Make the naming of XkbFile-related functions more consistent. - Move xkb_map_{new,ref,unref} to map.c. - Remove most extern keyword from function declarations, it's just noise (XKB_EXPORT is what's important here). - Append XKBCOMP_ to include guards. - Shuffle some code around to make all of this work. Splitting this would be a headache.. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-09-01Allocate xkb_component_names on stackRan Benita1-17/+15
Instead of malloc'ing it as well. Also improve the error handling. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-27utils: add/replace string equality macrosRan Benita1-8/+0
It's more tidy and less error prone, since we use strcasecmp == 0 a lot. We replace strcmp == 0 by streq, strcasecmp == 0 by istreq, uStrCasePrefix by istreq_prefix and uDupString by strdup_safe. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-12Add a library of common test functionsDaniel Stone1-1/+2
Including creating a context (will come in useful soon), opening and reading files, and compiling keymaps. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-12rules: fix parsing of multiple optionsRan Benita1-0/+12
This was broken by commit 18d331b86b4942ba54fe087ca07e47c9383d768b (where only the first option out of a comma-separated string was matched). Do it correctly this time and add a test. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-01rules: remove support for keymap ruleRan Benita1-6/+3
This commit removes the ability to specify a keymap *in a rules file*, e.g. in /usr/share/X11/xkb/rules/evdev or somesuch. This is unused in xkeyboard-data, and the current code has never even supported it, because xkb_map_new_from_kccgst (which is no longer exposed in the API) checks to see that one of the usual components (e.g. symbols, types, ..) has been filled, while the rules parser, on the other hand, doesn't allow to specify a keymap and other stuff at the same time. ( The idea was to remove xkb_map_new_from_kccgst entirely, but it's used by a test so it can stay. ) tl;dr: dead code. Of course passing a keymap file to xkb_map_new_from_file still works. Signed-off-by: Ran Benita <ran234@gmail.com>
2012-05-20rules: add testRan Benita1-0/+184
Add a non-extensive test to check that some basic things (e.g. rule matching, var substitution, indexes and groups) work as expected. Signed-off-by: Ran Benita <ran234@gmail.com>