Commit graph

27 commits

Author SHA1 Message Date
Christophe de Dinechin
fa62f3f275 tests: Add three 30 second demo of DB48X features
Separated the demo in three sections of 30 seconds each:
- Basics of RPL and user interface (RPL, function keys, online help, catalog,
  unicode, text editor)
- Mathematics (complex, vector, matrix, symbolic, based)
- Programming

Fixes: #1104

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-08-14 12:00:05 +02:00
Christophe de Dinechin
4ddbd8e862 simulator: Add tweak to show RPL object details
Showing the address, type and size of RPL objects is not often useful.
It is generally sufficient to just show the object rendering.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-07-28 14:20:54 +02:00
Christophe de Dinechin
18b22ce7f4 simulator: Separator color and dm32 support
Make it possible to run the DM42 configuration with color and the DM32
configuration in black-and-white.

Fixes: #907

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-04-17 00:23:47 +02:00
Christophe de Dinechin
0df86b131f simulator: Avoid crash rendering %t in recorder
If we print a really large value, we need to cut off what we print.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-28 23:51:08 +01:00
Christophe de Dinechin
3bdafe49b5 tests: Increase memory size to avoid failing tests
Some tests fail running out of memory:

```
../src/tests.cc:2669:  Test #21: highp: High-precision computations (60 digits)
../src/tests.cc:2669:  21:045.001: cbrt
../src/tests.cc:2669:    Expected output [0.68470 21277 57224 16184 09277 32646 81496 28057 14749 53139 45950 35873 52977 73009 35191 71304 84396 28932 73625 07589 02266 77954 73690 2353], got error [Out of memory] instead
```

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-23 10:23:15 +01:00
Christophe de Dinechin
1f6f148634 tests: Reorganize synchronization between RPL thread and tests
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>
2024-03-23 10:23:15 +01:00
Christophe de Dinechin
eb4757bb69 tests: Run command-line tests silently
Do not simulate sound while running tests from the command-line.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-22 14:34:42 +01:00
Christophe de Dinechin
cfe94ca0e0 linux: Add -s option for screen scaling
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.
2024-03-14 01:08:53 +01:00
Christophe de Dinechin
483a591986 linux: Remove warning about fall-through switch statement
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
2024-03-13 23:25:15 +01:00
Christophe de Dinechin
f06d17afab linux: Remove warnings about unused arguments
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
2024-03-13 21:23:55 +01:00
Christophe de Dinechin
784f07b2c7 tests: Add extra delay in the wait for update
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>
2024-03-11 01:49:10 +01:00
Christophe de Dinechin
2782e32e42 expressions: Graphics rendering
Graphics rendering of expressions

Fixes: #47

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2024-03-02 01:11:00 +01:00
Christophe de Dinechin
ae1b04c2be tests: Make it possible to individually run tests.
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>
2024-01-18 22:50:47 +01:00
Christophe de Dinechin
84b2c1bca6 simulator: Display DB48X keyboard by default
We now have a sufficiently advanced keyboard to use that as the default.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-10-15 22:13:49 +02:00
Christophe de Dinechin
52bec2063a Default memory size to something more usable
The demo does not fit in 2K, and I keep forgetting about setting
the memory size when running e.g. in the debugger

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-09-30 19:23:02 +02:00
Christophe de Dinechin
81eb1cb897 simulator: Add -m option for memory size
Passing the -m option to the simulator makes it possible to specify
amount of memory allocated initially.

Fixes: #367

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-08-28 02:43:03 +02:00
Christophe de Dinechin
e6030369ad simulator: Print version and first two-byte opcode on startup
This will help figure out how to prioritize opcode in the opcodes table.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-07-17 23:16:10 +02:00
Christophe de Dinechin
b001d7e47b Some repair work on the test suite
Better synchronization mechanism between RPL thread stack
output and test thread. Also added some settings at beginning
of output, and a different delay for waiting and delaying.

Also rendering the output of the stack at full length, because
otherwise we truncate large numbers in a non-sensible place.
For example, displaying 64! would show digits 80 and lower,
but the number has more digits than that, so we don't show the
more significant ones.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-07-06 23:35:14 +02:00
Christophe de Dinechin
7d6b6e6e6c Add object->debug() function for debugger use
This makes it easier to inspect RPL objects from debugger

For example, in `lldb`, you can use:

```
p obj->debug()
```

And this will show the content of the object as rendererd by the runtime.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-29 23:21:55 +02:00
Christophe de Dinechin
3cfa86fbd5 Add support for %t to print RPL objects in the recorder
To ease debugging, add a %t format turning RPL object pointers into their text
rendering while tracing.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-27 06:25:32 +02:00
Christophe de Dinechin
bb983d1ac5 Add option to slow-down automated tests
The `-w` command-line option takes a delay in millisecond between keystrokes.
Running slower minimizes the chances of a sync issue between the RPL thread and
the test thread. However, this mechanism is still not robust. I need to find a
reliable way to identify when the RPL thread is done processing the input from
the test thread.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-24 12:31:22 +02:00
Christophe de Dinechin
ca9fcbe3a6 Switch to using QT File dialog and settings to save state
The `QSettings` class is only used to store the path to the actual state.
The use of the file dialog seems to cause some trouble with the current working
directory, and this impacts the display of the help file.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-23 22:53:37 +02:00
Christophe de Dinechin
1d58abd64c Add the ability to use the DB48X keyboard mapping
This makes it possible to check on simulator what things would look like.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-22 18:30:38 +02:00
Christophe de Dinechin
70a919ec4f Testing framework
A simple testing framework that enters keys and observes the calculator

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-19 21:56:31 +02:00
Christophe de Dinechin
1b1e2c7ec7 Enable traces for all warnings and errors
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-19 21:56:31 +02:00
Christophe de Dinechin
d6ccfcaf83 Integrate the recorder into object operations
Record information about run, parse and render

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-19 21:56:31 +02:00
Christophe de Dinechin
6399a1556a Prototype simulator for the DM42
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2023-06-19 21:56:30 +02:00