CI for the three apps; a configurator's end found after a long screen

- .github/workflows/build.yml: Linux (with the tests, and again with
  ASan and UBSan), Windows 95 and later with Open Watcom, Windows with
  MSVC, and macOS with XcodeGen and xcodebuild.
- libdmodemctl: a line over 4 KiB keeps its end, not its start.  AT!CF
  sends its screens with no line ends and its OK after the last one, so
  the OK was lost and the app stayed in the configurator after Alt-X.
- Windows: the pages without WS_CLIPCHILDREN, so that the page paints
  inside its group boxes.
- Screenshots of the Windows app, run under Wine against dmodemd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVTPinTtLUajudobBC
This commit is contained in:
Claude committed 2026-11-06 13:56:38 +00:00
1 parent f62777b994
commit feb8e66d11
7 files changed
+110 -4

No files matched your search

+92
View File
@@ -0,0 +1,92 @@
# Builds and tests the three apps and the library they share
name: Build
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
linux:
name: Linux (GTK 4)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake ninja-build pkg-config libgtk-4-dev libadwaita-1-dev \
libvte-2.91-gtk4-dev
- name: Build
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Test with the sanitizers
run: |
cmake -S . -B build-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all"
cmake --build build-asan --target dmodemctl_test
ctest --test-dir build-asan --output-on-failure
windows-9x:
name: Windows 95 and later (Open Watcom)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: open-watcom/setup-watcom@v0
with:
version: "2.0"
- name: Build
run: sh windows/build-watcom.sh build/watcom
- uses: actions/upload-artifact@v4
with:
name: dmodem-windows-9x
path: build/watcom/dmodem.exe
windows:
name: Windows (MSVC)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cmake -S . -B build -A Win32
cmake --build build --config Release
- name: Test
run: ctest --test-dir build -C Release --output-on-failure
- uses: actions/upload-artifact@v4
with:
name: dmodem-windows
path: build/windows/Release/dmodem.exe
macos:
name: macOS (SwiftUI)
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Library tests
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
ctest --test-dir build --output-on-failure
- name: Project
run: |
brew install xcodegen
cd macos && xcodegen
- name: Build
run: |
cd macos
xcodebuild -project DModem.xcodeproj -scheme DModem \
-configuration Release -derivedDataPath ../build/xcode \
CODE_SIGN_IDENTITY=- build
- uses: actions/upload-artifact@v4
with:
name: dmodem-macos
path: build/xcode/Build/Products/Release/D-Modem.app
+5 -3
View File
@@ -32,7 +32,8 @@
#define ESCAPE_OK_MS 3000
/* RINGs are this far apart at most (a ring cadence is 6 s) */
#define RING_GAP_MS 8000
/* a line longer than this is cut (a configurator's screen has none) */
/* a line longer than this keeps only its end (a configurator's
screens come with no line ends, and its OK after the last one) */
#define LINE_MAX 4096
struct command {
@@ -602,8 +603,9 @@ void dmc_feed(dmc_session *s, const char *data, int n)
}
if (c == '\r')
continue;
if (s->line.n < LINE_MAX)
buf_addc(&s->line, c);
if (s->line.n >= LINE_MAX)
buf_drop(&s->line, s->line.n - LINE_MAX / 2);
buf_addc(&s->line, c);
}
}
+10
View File
@@ -243,6 +243,16 @@ static void test_typed(void)
CHECK(dmc_state(s) == DMC_CONFIGURATOR);
feed(s, "\x1b[0m\x1b[2J\x1b[H\x1b[?25h\r\nOK\r\n");
CHECK(dmc_state(s) == DMC_IDLE);
/* its screens as one line longer than a line is kept, the OK at the
end of it (as AT!CF's Alt-X sends it) */
dmc_type(s, "AT!CF\r", 6);
out(s);
CHECK(dmc_state(s) == DMC_CONFIGURATOR);
for (int i = 0; i < 1000; i++)
feed(s, "\x1b[0;30;47m\xe2\x96\x91");
CHECK(dmc_state(s) == DMC_CONFIGURATOR);
feed(s, "\x1b[0m\x1b[2J\x1b[H\x1b[?25hOK\r\n");
CHECK(dmc_state(s) == DMC_IDLE);
/* refused (off hook) */
dmc_type(s, "AT!CT\r", 6);
CHECK(dmc_state(s) == DMC_CONFIGURATOR);
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

+3 -1
View File
@@ -38,8 +38,10 @@ HWND page_new(HWND parent, CommandFn fn)
RegisterClass(&wc);
registered = true;
}
/* (no WS_CLIPCHILDREN: a group box paints only its frame, so the
page paints behind it) */
HWND w = CreateWindowEx(WS_EX_CONTROLPARENT, "DModemPage", "",
WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, parent,
WS_CHILD, 0, 0, 10, 10, parent,
NULL, app.inst, NULL);
SetWindowLongPtr(w, GWLP_USERDATA, (LONG_PTR)fn);
return w;