Commit Graph

5 Commits (7a881de9bbc940e9fab4e46c086baac06aa00ef8)

Author SHA1 Message Date
Peter Hutterer 7a881de9bb test: switch the stroke tests to use pytest
We're already running the meson test through pytest anyway and pytest is more
powerful than unittest. So let's switch, it's just a search/replace away.

Plus, this way the approach to dynamically create the tests based on the test
logs in the user's home directory is a lot saner.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-08 10:39:45 +01:00
Peter Hutterer 8690e305cf test: ignore empty files
Some raw log files may be empty if we cancelled tuhi at the wrong time. Skip
over those while testing

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 09:50:40 +10:00
Peter Hutterer 6c94898458 test: print the file name that triggered an exception on error
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 09:50:40 +10:00
Peter Hutterer 31d352bb1f test: remove unused idx variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 09:50:40 +10:00
Peter Hutterer e420b04fda protocol: add stroke parsing
This is a slightly different model as the messages, primarily because it's not
quite as model-specific. So there's only one parse function and it can handle
both file types that we currently support (intuos pro and the spark/slate
bits).

All wrapped into their own classes to make future extensions a bit easier.
It's not a 1:1 implementation of the tuhi/wacom.py bits either because we now
know about a few extra bits like the flags in stroke headers.

Most importantly though, this can be easily tested now, with one test case
searching for raw logs in $XDG_DATA_HOME/tuhi/raw and parsing all of those. So
the more files are sitting in there (i.e. the more the tablet is used), the
better the test suite becomes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-21 09:31:52 +02:00