@@ -255,6 +255,46 @@ jobs:
255255 journalctl --no-pager -o json -t native_linux_srcloc | jq -e -s $'.[1].MESSAGE == "[demo] [error] error message from spdlog-rs\'s JournaldSink { error_code=114514 }\n"'
256256 journalctl --no-pager -o json -t native_linux_srcloc | jq -e -s $'.[1].PRIORITY == "3" and .[1].CODE_FILE == "linux.rs" and .[1].CODE_LINE == "16" and .[1].TID != null'
257257
258+ test-native-windows :
259+ strategy :
260+ fail-fast : false
261+ runs-on : ' windows-latest'
262+ steps :
263+ - name : Checkout repository
264+ uses : actions/checkout@v4
265+ - name : Disable bench dependencies
266+ run : ./.github/workflows/disable-bench-deps.sh
267+ - name : Install DebugView
268+ run : choco install dbgview
269+ - name : Restore cargo caches
270+ uses : Swatinem/rust-cache@v2
271+ - name : Build example
272+ run : |
273+ cargo build --example native_windows --features native,source-location --verbose
274+ mv ./target/debug/examples/native_windows ./target/debug/examples/native_windows_srcloc
275+ cargo build --example native_windows --features native --verbose
276+ - name : Run and test
277+ run : |
278+ set -x
279+
280+ # Microsoft styled CLI options start with `/` and need to be doubled to escape in bash.
281+ dbgview //l ./dbgview.log
282+ # Wait for dbgview to start up and create the log file
283+ while [ ! -f ./dbgview.log ]; do sleep 1; done
284+
285+ ./target/debug/examples/native_windows
286+ ./target/debug/examples/native_windows_srcloc
287+
288+ # Wait for dbgview to flush the log file
289+ while [ ! -s ./dbgview.log ]; do sleep 1; done
290+ dbgview //q
291+
292+ cat ./dbgview.log
293+ cat ./dbgview.log | grep "\[demo] \[info] info message from spdlog-rs's WinDebugSink"
294+ cat ./dbgview.log | grep "\[demo] \[error] error message from spdlog-rs's WinDebugSink { error_code=114514 }"
295+ cat ./dbgview.log | grep -E "\[demo] \[info] \[native_windows, .+.rs:[0-9]+] info message from spdlog-rs's WinDebugSink"
296+ cat ./dbgview.log | grep -E "\[demo] \[error] \[native_windows, .+.rs:[0-9]+] error message from spdlog-rs's WinDebugSink { error_code=114514 }"
297+
258298 test-native-android :
259299 strategy :
260300 fail-fast : false
0 commit comments