summaryrefslogtreecommitdiff
path: root/test/context.c
Commit message (Collapse)AuthorAgeFilesLines
* Add asprintf_safe helper functionPeter Hutterer2020-07-131-2/+2
| | | | | | | We only ever care about whether we error out or not, so let's wrap this into something more sane. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* MSVC: Use <io.h> as an alternative for <unistd.h>Adrian Perez de Castro2019-12-281-1/+9
| | | | | | | | | Only the input/output functions from <unistd.h> options are used, so using <io.h> when building with MSVC should be enough. The inclusion of the header in context-priv.c does not seem to be needed (tested on GNU/Linux) and so it is removed. Signed-off-by: Ran Benita <ran@unusedvar.com>
* test/context: use a more portable directory-exists checkRan Benita2019-12-271-6/+7
| | | | | | MSVC doesn't have opendir/closedir. Signed-off-by: Ran Benita <ran@unusedvar.com>
* build: include config.h manuallyRan Benita2019-12-271-0/+2
| | | | | | | | | Previously we included it with an `-include` compiler directive. But that's not portable. And it's better to be explicit anyway. Every .c file should have `include "config.h"` first thing. Signed-off-by: Ran Benita <ran@unusedvar.com>
* test: add test for the various default include pathsPeter Hutterer2019-10-311-0/+280
| | | | | | | | All tests create a temporary directory, set up the environment for that directory and then check the include paths for the presence of that directory, ideally in the right position of the list. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* atom: really work with non-NUL-terminated stringsRan Benita2013-07-221-0/+9
| | | | Signed-off-by: Ran Benita <ran234@gmail.com>
* test: Add flags argument to test_get_context()Daniel Stone2013-03-191-1/+1
| | | | | | Allowing overriding of environment suppression, at first. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Organize src/ and test/ headersRan Benita2012-09-161-3/+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>
* test: Add extremely rudimentary include path testDaniel Stone2012-08-081-1/+3
| | | | Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* context test: Use test_get_context()Daniel Stone2012-07-271-1/+2
| | | | | | So we don't die if we haven't got a valid global include path. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Rename 'ctx' back to 'context' in external APIDaniel Stone2012-05-111-3/+3
| | | | | | | | | | Still keep things as 'ctx' internally so we don't have to worry about typing it too often, but rename the user-visible API back as it was kinda ugly. This partially reverts e7bb1e5f. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Shorten context to ctxRan Benita2012-05-091-3/+3
| | | | | | | | | | | | (This breaks the API.) "context" is really annoying to type all the time (and we're going to type it a lot more :). "ctx" is clear, concise and common in many other libraries. Use it! Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Fix for xkb -> keymap change.]
* Add flags to context creationDaniel Stone2012-05-081-1/+1
| | | | | | None defined as yet, but why not. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
* Overhaul test suiteRan Benita2012-04-091-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite all of the current tests in the following ways: - Instead of the current mix of C and shell, just use single-process pure C file per test. All of the .sh files are removed, but everything that was tested is ported. - Instead of handling the test logs ourselves, use Automake's "parallel-test" mechanism. This will create a single log file for each test with it's stdout+stderr, and a top level "test-suite.log" file for all the failed tests. - The "parallel-tests" directive also makes the test run in parallel, so "make check" runs faster. - Also use the "color-tests" directive to have the "make check" output colorized. Who doesn't like to see PASS in green? - All of the test data files are moved into the test/data subdirectory. That way we can just put the directory in EXTRA_DIST and forget about it. - The test/Makefile.am file is consolidated into the main Makefile.am, for a completely non-recursive build. Right now the tests are completely independent and just use simple assert()'s. More sophistication can be added as needed. It should also be noted that it's still possible to use shell, python, etc. if a test wants more flexibility than C can provide, just do as before. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb_keymap changes.]
* Add new context APIDaniel Stone2012-03-271-0/+47
Signed-off-by: Daniel Stone <daniel@fooishbar.org>