diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index ac3d0667d..2c6557347 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -74,8 +74,8 @@ jobs: - run: pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config make mingw-w64-x86_64-python3 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng - run: make -j2 PLATFORM=simulator - run: make -j2 PLATFORM=simulator epsilon.official.exe - - run: make -j2 PLATFORM=simulator test.headless.exe - - run: output/release/simulator/windows/test.headless.exe + - run: make -j2 PLATFORM=simulator test.exe + - run: cmd /c output\release\simulator\windows\test.exe --headless - uses: actions/upload-artifact@master with: name: epsilon-windows.exe @@ -89,8 +89,8 @@ jobs: - uses: actions/checkout@v2 - run: make -j2 PLATFORM=simulator TARGET=web - run: make -j2 PLATFORM=simulator TARGET=web epsilon.official.zip - - run: make -j2 PLATFORM=simulator TARGET=web test.headless.js - - run: node output/release/simulator/web/test.headless.js + - run: make -j2 PLATFORM=simulator TARGET=web test.js + - run: node output/release/simulator/web/test.js --headless - uses: actions/upload-artifact@master with: name: epsilon-web.zip @@ -102,8 +102,8 @@ jobs: - uses: actions/checkout@v2 - run: make -j2 PLATFORM=simulator - run: make -j2 PLATFORM=simulator epsilon.official.bin - - run: make -j2 PLATFORM=simulator test.headless.bin - - run: output/release/simulator/linux/test.headless.bin + - run: make -j2 PLATFORM=simulator test.bin + - run: output/release/simulator/linux/test.bin --headless - uses: actions/upload-artifact@master with: name: epsilon-linux.bin @@ -116,8 +116,8 @@ jobs: - uses: actions/checkout@v2 - run: make -j2 PLATFORM=simulator - run: make -j2 PLATFORM=simulator epsilon.official.app - - run: make -j2 PLATFORM=simulator ARCH=x86_64 test.headless.bin - - run: output/release/simulator/macos/x86_64/test.headless.bin + - run: make -j2 PLATFORM=simulator ARCH=x86_64 test.bin + - run: output/release/simulator/macos/x86_64/test.bin --headless - uses: actions/upload-artifact@master with: name: epsilon-macos.zip diff --git a/build/targets.simulator.mak b/build/targets.simulator.mak index 6e6ed0fe6..55101ffc2 100644 --- a/build/targets.simulator.mak +++ b/build/targets.simulator.mak @@ -1,8 +1 @@ -# Headless targets -$(eval $(call rule_for_epsilon_flavor,headless)) -HANDY_TARGETS += epsilon.headless - -$(BUILD_DIR)/test.headless.$(EXE): $(call flavored_object_for,$(test_runner_src),headless) -HANDY_TARGETS += test.headless - -include build/targets.simulator.$(TARGET).mak diff --git a/build/targets.simulator.web.mak b/build/targets.simulator.web.mak index ead0b515e..396ec7056 100644 --- a/build/targets.simulator.web.mak +++ b/build/targets.simulator.web.mak @@ -1 +1 @@ -$(BUILD_DIR)/test.headless.js: EMSCRIPTEN_MODULARIZE = 0 +$(BUILD_DIR)/test.js: EMSCRIPTEN_MODULARIZE = 0 diff --git a/ion/src/shared/dummy/events_platform.cpp b/ion/src/shared/dummy/events_platform.cpp deleted file mode 100644 index a0b1c6cd8..000000000 --- a/ion/src/shared/dummy/events_platform.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include - -namespace Ion { -namespace Events { - -Event getPlatformEvent() { - return None; -} - -} -} diff --git a/ion/src/shared/dummy/keyboard.cpp b/ion/src/shared/dummy/keyboard.cpp deleted file mode 100644 index 914ce0dcf..000000000 --- a/ion/src/shared/dummy/keyboard.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include - -namespace Ion { -namespace Keyboard { - -State scan() { - return State(); -} - -} -} diff --git a/ion/src/shared/dummy/timing_msleep.cpp b/ion/src/shared/dummy/timing_msleep.cpp deleted file mode 100644 index 131e5abfd..000000000 --- a/ion/src/shared/dummy/timing_msleep.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include - -void Ion::Timing::msleep(uint32_t ms) { -} diff --git a/ion/src/simulator/Makefile b/ion/src/simulator/Makefile index 059bc3381..862742bd7 100644 --- a/ion/src/simulator/Makefile +++ b/ion/src/simulator/Makefile @@ -3,35 +3,28 @@ ion_src += $(addprefix ion/src/shared/dummy/, \ battery.cpp \ display.cpp \ exam_mode.cpp \ - events_platform.cpp:+headless \ fcc_id.cpp \ - keyboard.cpp:+headless \ led.cpp \ power.cpp \ serial_number.cpp \ stack.cpp \ - timing_msleep.cpp:+headless \ usb.cpp \ ) ion_src += $(addprefix ion/src/simulator/shared/, \ - dummy/keyboard.cpp:+headless \ - dummy/window.cpp:+headless \ clipboard.cpp \ - console_stdio.cpp:-consoledisplay \ + console.cpp \ crc32.cpp \ - display.cpp:-headless \ + display.cpp \ events.cpp \ - events_platform.cpp:-headless \ + events_platform.cpp \ framebuffer.cpp \ - framebuffer_png.cpp:+headless \ - keyboard.cpp:-headless \ - layout.cpp:-headless \ + keyboard.cpp \ + layout.cpp \ main.cpp \ random.cpp \ timing.cpp \ - timing_msleep.cpp:-headless \ - window.cpp:-headless \ + window.cpp \ ) ion_simulator_assets = background.jpg horizontal_arrow.png vertical_arrow.png round.png small_squircle.png large_squircle.png diff --git a/ion/src/simulator/shared/dummy/keyboard.cpp b/ion/src/simulator/shared/dummy/keyboard.cpp deleted file mode 100644 index d2b2a8819..000000000 --- a/ion/src/simulator/shared/dummy/keyboard.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "../keyboard.h" - -namespace Ion { -namespace Simulator { -namespace Keyboard { - -void keyDown(Ion::Keyboard::Key k) { -} - -void keyUp(Ion::Keyboard::Key k) { -} - -bool scanHandlesSDLKey(SDL_Scancode key) { - return false; -} - -} -} -} diff --git a/ion/src/simulator/shared/dummy/window.cpp b/ion/src/simulator/shared/dummy/window.cpp deleted file mode 100644 index 1ab131edf..000000000 --- a/ion/src/simulator/shared/dummy/window.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "../window.h" - -namespace Ion { -namespace Simulator { -namespace Window { - -void init() { - Ion::Simulator::Framebuffer::setActive(false); -} - -void quit() { -} - -void setNeedsRefresh() { -} - -void relayout() { -} - -void refresh() { -} -} -} -} diff --git a/ion/src/simulator/shared/timing.cpp b/ion/src/simulator/shared/timing.cpp index cd11dcf61..9997bbcf4 100644 --- a/ion/src/simulator/shared/timing.cpp +++ b/ion/src/simulator/shared/timing.cpp @@ -1,9 +1,24 @@ #include +#include "window.h" #include +#include static auto start = std::chrono::steady_clock::now(); -uint64_t Ion::Timing::millis() { +namespace Ion { +namespace Timing { + +uint64_t millis() { auto elapsed = std::chrono::steady_clock::now() - start; return std::chrono::duration_cast(elapsed).count(); } + +void msleep(uint32_t ms) { + if (Simulator::Window::isHeadless()) { + return; + } + SDL_Delay(ms); +} + +} +} diff --git a/ion/src/simulator/shared/timing_msleep.cpp b/ion/src/simulator/shared/timing_msleep.cpp deleted file mode 100644 index 128330a0a..000000000 --- a/ion/src/simulator/shared/timing_msleep.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include "window.h" -#include - -void Ion::Timing::msleep(uint32_t ms) { - if (Ion::Simulator::Window::isHeadless()) { - return; - } - SDL_Delay(ms); -}