Remove the `DataMenu`.
Replace `PrintMenu` with `ListMenu` as keyboard-accessible menu
(we can tuck the rarely used `PrintMenu` under `I/O`)
Add list product, sum, etc to `ListMenu`
Modify `ProgramMenu` to add special program entry characters.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The new sync between tests and RPL theads was not working correctly in
the case of `Wait` and `Show` commands because they were popping keys
without correctly updating `last_key`.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Split the recorders between `tests` and `tests_rpl`.
Separate the handling of commands into `process_test_commands` and
`process_test_key`, with the key handling happening before we actually
run the code.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This significantly improves the performance of tests by avoiding
delays waiting to process keys.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Use a separate channel for the communication of test commands with
the RPL thread, in order to make it simpler to deal with corner cases
such as an error being displayed.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This delay is necessary to avoid an occasional crash at startup when
running with `-Tall` and loading a large demo file.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This is a shortcut to save the current state.
Note that you can also get that with RSHIFT-EXIT.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
If two mouse clicks are issued quickly, the second one has the type
QEvent::MouseButtonDblClick. This leads to the event being ignored.
This is now fixed.
Signed-off-by: Kjell Christenson <kjell.christenson@gmail.com>
Reviewed-by: Christophe de Dinechin <christophe@dinechin.org>
The `qApp->primaryScreen()->devicePixelRatio()` method no longer
returns the correct pixel ratio at least on X11 over the network.
Add the `-s` option as a workaround to be able to auto-scale the
window for testing purpose.
It looks like gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4) thinks it's a good
idea to complain about every single zero-initialized C structure.
This is widely acknowledged as a (rather annoying)
[GCC bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119)
Add a constructor to silence the warning where possible.
For DMCP C structures where this is not possible, well, add ugly code.
With gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4), there is a message about
fall-through switch statements. Add comment to silence the warning when the
fall-through is intentional.
There was one case where the fall-through was not intentional.
Missing `break` added.
Fixes: #853
On Fedora 38, GCC incorrectly warns about unused arguments despite the
`__attribute__((unused)))` that should silence the warning.
Observed with gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4).
Fixes: #853
This is just to avoid setting `errno` when we are just trying to
make sure that the directory exists.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
These are two catalogs that behave much like the constants catalog,
and inherit most of the code.
The equations library is intended to store standard equations.
The library is for standard objects and various useful objects or
programs.
Both can be organized by topics.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Instead of proactively wait, add a wait loop checking for the result.
This allows the tests to run significantly faster.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Make sure that we capture consistent pixmaps, which we can do on the
RPL thread, and only defer the transfer of the pixmap to the main
thread, which is fast.
Additionally, optimize updates by doing a byte-by-byte xor comparison
in order to see which bytes actually changed. This minimizes the cost
on the RPL thread to update the pixmap.
This makes it possible to have a much better screen behaviour for the
`CBench` benchmark, where it updates it regularly on the screen while
not slowing things down too much.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add a callback to explicitly refresh the screen instead of relying on
a volatile counter indicating that the screen is dirty.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
By convention, 0 is Monday for DMCP, but Sunday for Unix.
I managed to not notice until now...
Fixes: #838
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
When hitting the F9 key, take a partial screen snapshot directly
(partial meaning no header).
When hitting the F8 key, take a screen snapshot using the `Screenshot`
command, which is now implemented on the simulator.
Also reduce the size of the window a little so that we can take video
snapshots that are 720 x 400 pixels and capture the keyboard.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The DMCP convention is for the month field to start at 1.
Integrate that in our emulation.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Refactor the code to put all date and time related functions into the
`datetime.h` and `datetime.cc` files.
Also added Julian day number calculations, which enable the
computation of the day of the week in the date format rendering, and
will make it easier to implement future commands such as `DDAYS`.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add the `→Date` command to set the system date,
and the `→Time` command to set the system time.
Fixes: #823
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Dynamic constants menu, similar to units menu, which is populated
either from an internal table, or from `config/constants.csv`
Fixes: #497
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
The hardware-accelerated floating-point support in the ARM chip is
about 2000 faster than the variable-precision decimal floating point
implementation. It makes sense to use it.
See numbers recorded in `doc/6-Performance.md` for details.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Add image checking from saved image references as a way to check that
the generated pixmaps are consistent from run to run.
Fixes: #732
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Each test is controlled by a specific recorder tweak.
The `-T` option can now take a test name, e.g. `-Tkeyboard` to run
only that test in an automated way.
The `-O` option can select a single test for interactive testing with
the F12 key.
In both cases, the name follows the recorder syntax.
Fixes: #728
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
We use `-1` to mark the termination of the RPL thread and request the
state to be saved on disk.
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
A call to `wait_for_key()` would prevent the key sync counters from
being updated, and as a result, the test suite would stop.
Fixes: #731
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>