Skip to content

Commit 9a813b2

Browse files
authored
v0.16.0 🎉 (#373)
2 parents 7b54a2f + ded0980 commit 9a813b2

File tree

184 files changed

+4170
-1320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+4170
-1320
lines changed

.github/workflows/test-EMULATOR.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ jobs:
3131
uses: nschloe/action-cached-lfs-checkout@v1.2.1
3232
with:
3333
submodules: recursive
34+
lfs: 'true'
3435
- name: Update packages
35-
run: sudo apt-get update && sudo apt-get upgrade -y
36+
run: sudo apt-get update
3637
- name: Install packages
37-
run: sudo apt-get -y install gcc g++ cmake libsdl2-dev libsdl2-image-dev
38+
run: sudo apt-get -y install gcc g++ cmake libsdl2-dev libsdl2-image-dev python3 python3-pip
39+
- name: Install python packages
40+
run: pip3 install --user -r scripts/requirements.txt
3841
- name: Create build directory
3942
run: mkdir build
4043
- name: CMake ${{ matrix.build-configuration }}

.github/workflows/test-FEATURE.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
uses: nschloe/action-cached-lfs-checkout@v1.2.1
2929
with:
3030
submodules: recursive
31+
lfs: 'true'
3132
- id: get-flag
3233
run: |
3334
echo "feature=$(python3 .github/getWorkflowMatrix.py all_flags)" >> $GITHUB_OUTPUT
@@ -56,6 +57,7 @@ jobs:
5657
uses: nschloe/action-cached-lfs-checkout@v1.2.1
5758
with:
5859
submodules: recursive
60+
lfs: 'true'
5961
- name: Cache pip
6062
uses: actions/cache@v3
6163
with:

.github/workflows/test-OS.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
uses: nschloe/action-cached-lfs-checkout@v1.2.1
1616
with:
1717
submodules: recursive
18+
lfs: 'true'
1819
- uses: dorny/paths-filter@v2.11.1
1920
id: filter
2021
with:
@@ -49,6 +50,7 @@ jobs:
4950
uses: nschloe/action-cached-lfs-checkout@v1.2.1
5051
with:
5152
submodules: recursive
53+
lfs: 'true'
5254
- name: Cache pip
5355
uses: actions/cache@v3
5456
with:

.github/workflows/test-OSW.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
uses: nschloe/action-cached-lfs-checkout@v1.2.1
3030
with:
3131
submodules: recursive
32+
lfs: 'true'
3233
- uses: dorny/paths-filter@v2.11.1
3334
id: filter
3435
with:
@@ -62,6 +63,7 @@ jobs:
6263
uses: nschloe/action-cached-lfs-checkout@v1.2.1
6364
with:
6465
submodules: recursive
66+
lfs: 'true'
6567
- name: Cache pip
6668
uses: actions/cache@v3
6769
with:

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@
3838
[submodule "lib/open-smartwatch-web"]
3939
path = lib/open-smartwatch-web
4040
url = https://github.com/Open-Smartwatch/open-smartwatch-web.git
41-
branch = dist
41+
branch = dist
42+
[submodule "emulator/lib/ImGUI_TestEngine"]
43+
path = emulator/lib/ImGUI_TestEngine
44+
url = https://github.com/ocornut/imgui_test_engine.git

CMakeLists.txt

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required (VERSION 3.10)
1+
cmake_minimum_required (VERSION 3.12)
22
project (OSW-OS-Emulator)
33

44
set(CMAKE_CXX_STANDARD 20)
@@ -46,8 +46,8 @@ add_library(ImGUI
4646
emulator/lib/ImGUI/imgui_draw.cpp
4747
emulator/lib/ImGUI/imgui_widgets.cpp
4848
emulator/lib/ImGUI/imgui_tables.cpp
49-
emulator/lib/ImGUI/backends/imgui_impl_sdl.cpp
50-
emulator/lib/ImGUI/backends/imgui_impl_sdlrenderer.cpp
49+
emulator/lib/ImGUI/backends/imgui_impl_sdl2.cpp
50+
emulator/lib/ImGUI/backends/imgui_impl_sdlrenderer2.cpp
5151
emulator/lib/ImGUI/misc/cpp/imgui_stdlib.cpp
5252
)
5353
target_include_directories(ImGUI PUBLIC
@@ -60,13 +60,50 @@ target_link_libraries(ImGUI LINK_PUBLIC
6060
${SDL2IMAGE_LIBRARIES}
6161
)
6262

63+
# ImGUI testing engine
64+
add_library(ImGUI_TestEngine
65+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/imgui_te_engine.cpp
66+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/imgui_capture_tool.cpp
67+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/imgui_te_context.cpp
68+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/imgui_te_coroutine.cpp
69+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/imgui_te_exporters.cpp
70+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/imgui_te_perftool.cpp
71+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/imgui_te_ui.cpp
72+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/imgui_te_utils.cpp
73+
74+
)
75+
target_include_directories(ImGUI_TestEngine PUBLIC
76+
emulator/lib/ImGUI_TestEngine/imgui_test_engine/
77+
)
78+
target_link_libraries(ImGUI_TestEngine LINK_PUBLIC
79+
ImGUI
80+
)
81+
add_compile_definitions(
82+
IMGUI_ENABLE_TEST_ENGINE=1
83+
IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=1
84+
)
85+
86+
# OSW custom prebuild-scripts
87+
find_package(Python3 REQUIRED COMPONENTS Interpreter)
88+
file(GLOB_RECURSE INCLUDE_OSW_ASSETS ./include/assets/img/** ./include/assets/www/**)
89+
add_custom_target(
90+
osw_script_prebuild_assets ALL
91+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
92+
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/build/prebuild_assets.py --output-asset-path ${CMAKE_CURRENT_SOURCE_DIR}/include/assets
93+
BYPRODUCTS ${INCLUDE_OSW_ASSETS}
94+
COMMENT "Generating OSW assets..."
95+
)
96+
6397
# Emulator
6498
file(GLOB_RECURSE SOURCES_OSW ./src/*.cpp)
6599
file(GLOB_RECURSE SOURCES_OSW_EMULATOR ./emulator/src/*.cpp)
66100
add_executable(emulator.run
67101
${SOURCES_OSW}
68102
${SOURCES_OSW_EMULATOR}
69103
)
104+
add_dependencies(emulator.run
105+
osw_script_prebuild_assets
106+
)
70107
target_include_directories(emulator.run PUBLIC
71108
./emulator/include
72109
./include
@@ -83,6 +120,7 @@ target_link_libraries(emulator.run LINK_PUBLIC
83120
${SDL2_LIBRARY}
84121
${SDL2IMAGE_LIBRARIES}
85122
ImGUI
123+
ImGUI_TestEngine
86124
cmdline
87125
utest
88126
)
@@ -99,8 +137,11 @@ target_compile_definitions(emulator.run PUBLIC
99137
$<$<CONFIG:Release>:
100138
NDEBUG=1
101139
>
140+
# Uncomment the following line to use a different locale (only for the emulator, for the whole OS use the config variable!)
141+
# LOCALE="locales/en-US.h"
102142
# Comment these as you wish...
103143
OSW_FEATURE_STATS_STEPS
144+
OSW_APPS_EXAMPLES=1
104145
GAME_SNAKE=1
105146
GAME_BRICK_BREAKER=1
106147
TOOL_FLASHLIGHT=1

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
# How to contribute to Open-smartwatch
22

3-
In case the `develop` branch is ahead of the `master` branch and the `develop` branch is stabile enough, we periodically merge it into the `master`.
3+
In case the `develop` branch is ahead of the `master` branch and the `develop` branch is stable enough, we periodically merge it into the `master`.
44

55
In order to contribute new or updated documentation, you must first create a GitHub account and fork the original repository to your own account. You can make changes, save them in your repository and then create a pull request against this repository.
66

77
Unless you are opening a pull request which only makes small corrections (for instance correcting a typo), you are more likely to get traction for your changes if you open an issue first to discuss the proposed changes.
88

9-
**IMPORTANT** If you want to create a pull request, please work based on the `develop` branch - so we don't have to rebase it...
9+
**IMPORTANT** If you want to create a pull request, please work based on the most recent `develop` branch - so we don't have to rebase it...
1010

1111
If you are reading this page, you are possibly interested in contributing to our project 😄 . We have an active (and friendly) developer group and would love to get your help! Some common ways you can support us are:
1212

1313
* Testing the code
14-
* Filing issues on GitHub, if you see a problem (or adding detail to existing issues that effect you)
14+
* Reporting issues on GitHub, if you see a problem (or adding detail to existing issues that also affect you)
1515
* Fixing issues 😁
1616
* Adding new features
17-
* Reviewing existing pull requests and possibly also contributing to them.
18-
* Translation. Always a good idea...
17+
* Reviewing existing pull requests and possibly also contributing to them
18+
* Translations are always a good idea...
1919

2020
## How to make a good bug report
2121

2222
Submit according to the bug report form. Attach the debug log if necessary. [Read more here!](https://open-smartwatch.github.io/howto/contribute/#how-to-open-an-issue)
2323

2424
## Submitting patches
2525

26-
Please also see our [wiki](https://open-smartwatch.github.io/howto/contribute/) article for that.
26+
Please also see our [wiki](https://open-smartwatch.github.io/howto/contribute/) article for that.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,28 @@ $ docker run --net=host -e DISPLAY -v /tmp/.X11-unix -d --name OSW -p 22:22 -it
147147
$ xauth add <'xauth list' command result>
148148
```
149149
150+
## Testing
151+
After making some changes to the code, you should test the application by running our unit and UI tests.
152+
153+
Note: our tests do not cover 100% of the application. If you want to see which parts are covered by tests take a look at `emulator/src/unitTests` and `emulator/src/uiTests`.
154+
155+
### Unit tests
156+
Run all unit tests:
157+
```bash
158+
$ ./emulator.run --unit_tests
159+
```
160+
List all unit tests, one per line:
161+
```bash
162+
$ ./emulator.run --list_tests
163+
```
164+
165+
### UI tests
166+
Run the emulator with UI tests window:
167+
```bash
168+
$ ./emulator.run --ui_tests
169+
```
170+
171+
***IMPORTANT**: If you add some new features, it is strongly recommended to write unit and UI tests for them.*
172+
150173
## License
151174
Everything in this repository is under a GPL-3.0 license, see [here](./LICENSE) for more details.

docs/firmware/getting_started.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This page describes which software you'll need and how to manually flash the firmware.
44

5+
!!! note "Tip"
6+
In case you won't or can't compile the (latest) firmware yourself, you can download the latest pre-compiled firmware from the [releases page](https://github.com/Open-Smartwatch/open-smartwatch-os/releases) (in case we did not forget to upload it there). In case you want to take a look into what is coming with the next release, checkout the [GitHub Actions](https://github.com/Open-Smartwatch/open-smartwatch-os/actions) (you have to login to download anything). To then flash the firmware to the watch use something like the [ESPHome Flasher](https://github.com/esphome/esphome-flasher), be aware that this flasher will also erase the watches memory every time! An alternative (although not tested) would be the [NodeMCU Flasher](https://github.com/marcelstoer/nodemcu-pyflasher).
7+
58
## Required Software
69

710
- [GIT](https://git-scm.com)
@@ -39,7 +42,10 @@ If you have cloned the repo without the recurse option, run `git submodule updat
3942

4043
!!! note "Tip"
4144
After changing or updating/pulling a branch, run the command again to also update dependencies:
42-
`git submodule update`
45+
```bash
46+
git pull
47+
git submodule update --init --recursive
48+
```
4349

4450
Then, open the directory with Visual Studio Code.
4551

docs/firmware/troubleshooting.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ Check the driver insertion.
1313
You did not clone the repository with the `--recursive-submodules` flag.
1414

1515
!!! note "Tip"
16-
After changing the branch, follow the command :
17-
`git submodule update`
16+
After changing or updating/pulling a branch, run the command again to also update dependencies:
17+
```bash
18+
git pull
19+
git submodule update --init --recursive
20+
```
1821

1922
## Failed to connect to ESP32: Timed out waiting for packet header
2023

0 commit comments

Comments
 (0)