@@ -218,6 +218,43 @@ jobs:
218218 - name : Check MSRV for core with Rust ${{ env.rust_minver }}
219219 run : cargo +${{ env.rust_minver }} check --locked --all-features --verbose
220220
221+ test-native-linux :
222+ strategy :
223+ fail-fast : false
224+ runs-on : ' ubuntu-latest'
225+ steps :
226+ - name : Checkout repository
227+ uses : actions/checkout@v4
228+ - name : Disable bench dependencies
229+ run : ./.github/workflows/disable-bench-deps.sh
230+ - name : Install dependencies
231+ run : sudo bash ./.github/workflows/install-deps.sh
232+ - name : Restore cargo caches
233+ uses : Swatinem/rust-cache@v2
234+ - name : Build example
235+ run : |
236+ cargo build --example native_linux --features native,libsystemd,source-location --verbose
237+ mv ./target/debug/examples/native_linux ./target/debug/examples/native_linux_srcloc
238+ cargo build --example native_linux --features native,libsystemd --verbose
239+ - name : Run and test
240+ run : |
241+ set -x
242+ ./target/debug/examples/native_linux
243+ ./target/debug/examples/native_linux_srcloc
244+
245+ journalctl --no-pager -o verbose -t native_linux
246+ journalctl --no-pager -o verbose -t native_linux_srcloc
247+
248+ journalctl --no-pager -o json -t native_linux | jq -e -s $'.[0].MESSAGE == "[demo] [info] info message from spdlog-rs\'s JournaldSink\n"'
249+ journalctl --no-pager -o json -t native_linux | jq -e -s $'.[0].PRIORITY == "6" and .[0].CODE_FILE == null and .[0].CODE_LINE == null'
250+ journalctl --no-pager -o json -t native_linux | jq -e -s $'.[1].MESSAGE == "[demo] [error] error message from spdlog-rs\'s JournaldSink { error_code=114514 }\n"'
251+ journalctl --no-pager -o json -t native_linux | jq -e -s $'.[1].PRIORITY == "3" and .[1].CODE_FILE == null and .[1].CODE_LINE == null'
252+
253+ journalctl --no-pager -o json -t native_linux_srcloc | jq -e -s $'.[0].MESSAGE == "[demo] [info] info message from spdlog-rs\'s JournaldSink\n"'
254+ journalctl --no-pager -o json -t native_linux_srcloc | jq -e -s $'.[0].PRIORITY == "6" and .[0].CODE_FILE == "linux.rs" and .[0].CODE_LINE == "15"'
255+ 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"'
256+ 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"'
257+
221258 test-native-android :
222259 strategy :
223260 fail-fast : false
0 commit comments