Beroun is developed and tested on the simulator: the same shell, manifests and apps as a device, with the hardware interface replaced. This page covers how the system is tested, the conventions it keeps, and how to add the common things.
What tests the system
About a hundred scripts. Many need no running system at all; others drive the real shell and press the real buttons.
| Kind | Examples |
|---|---|
| Pure logic, no system needed | manifest_test, sysapi_test, extdisplay_test, clock_test, appinstall_test, agents_test, a2a_test, caroline_update_test, caroline_apps_test |
| Against the real shell | store_shell_test, store_e2e, agents_shell_test, notifications_test, shared_window_test, services_test, messaging_test |
| Through the buttons | A helper sends the console's buttons, so interface behaviour is tested the way a person drives it |
The store's tests are worth a look: appinstall_test installs packages signed by the arbiter's own code (74 checks), and store_e2e drives a private simulator with the arbiter's real code by pressing the console's buttons.
Conventions
One manifest format
Unknown fields are errors. Any new field extends the manifest test.
A tool for every route
A new /api/ route needs a Caroline tool or an explained exemption.
Every phrase is translated
Every visible phrase goes through Platform.t into all the language files. Caroline's tool answers stay English.
Buttons
Apps use the cursor, A and B. X, Y, R1, START and SELECT have no job in an app.
Save before leaving
A shared-window app saves its place before Platform.exit().
Caroline stays upstream
Her checkout is never changed from here: use configuration, the overlay, or a release of her own.
Secrets stay out
Service keys and the store's signing key never go into the repository.
Isolated instances
Parallel work runs on its own named simulator instance, never on someone else's.
Adding things
An app
See Writing a new app.
A system API route
Implement it in the shell, with the logic in a module that doesn't import the shell, so it can be tested alone.
Document it in the system API reference.
Add the Platform JavaScript for it.
Add a Caroline tool. The audit test fails without one.
A service
Declare it in the app's manifest. Pick priority and memory_mb honestly: the service manager enforces both. Use ports 49000–49999 if it will ship through the store.
A target interface
See Adding a target interface.
Debugging
- Logs:
shell.log,app-<id>.logand one per daemon. - WPE's remote inspector listens on port 9222; open any page's inspector from a browser.
GET /api/servicesshows each service's state and memory against the budget.- The shell page is served at
http://localhost:8765/for any browser.
