@@ -241,28 +241,9 @@ jobs:
241241 - name : Restore cargo caches
242242 uses : Swatinem/rust-cache@v2
243243 - name : Build example
244- run : |
245- cargo build --example native_linux --features native,libsystemd,source-location --verbose
246- mv ./target/debug/examples/native_linux ./target/debug/examples/native_linux_srcloc
247- cargo build --example native_linux --features native,libsystemd --verbose
244+ run : bash ./spdlog/tests/native/linux.sh build
248245 - name : Run and test
249- run : |
250- set -x
251- ./target/debug/examples/native_linux
252- ./target/debug/examples/native_linux_srcloc
253-
254- journalctl --no-pager -o verbose -t native_linux
255- journalctl --no-pager -o verbose -t native_linux_srcloc
256-
257- journalctl --no-pager -o json -t native_linux | jq -e -s $'.[0].MESSAGE == "[demo] [info] info message from spdlog-rs\'s JournaldSink\n"'
258- journalctl --no-pager -o json -t native_linux | jq -e -s $'.[0].PRIORITY == "6" and .[0].CODE_FILE == null and .[0].CODE_LINE == null and .[0].TID != null'
259- 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"'
260- journalctl --no-pager -o json -t native_linux | jq -e -s $'.[1].PRIORITY == "3" and .[1].CODE_FILE == null and .[1].CODE_LINE == null and .[1].TID != null'
261-
262- journalctl --no-pager -o json -t native_linux_srcloc | jq -e -s $'.[0].MESSAGE == "[demo] [info] info message from spdlog-rs\'s JournaldSink\n"'
263- 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 != null and .[0].TID != null'
264- 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"'
265- 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 != null and .[1].TID != null'
246+ run : bash ./spdlog/tests/native/linux.sh run
266247
267248 test-native-windows :
268249 strategy :
@@ -278,32 +259,9 @@ jobs:
278259 - name : Restore cargo caches
279260 uses : Swatinem/rust-cache@v2
280261 - name : Build example
281- run : |
282- cargo build --example native_windows --features native,source-location --verbose
283- mv ./target/debug/examples/native_windows ./target/debug/examples/native_windows_srcloc
284- cargo build --example native_windows --features native --verbose
262+ run : bash ./spdlog/tests/native/windows.sh build
285263 - name : Run and test
286- run : |
287- set -x
288-
289- # Microsoft styled CLI options start with `/` and need to be doubled to escape in bash.
290- dbgview //l ./dbgview.log
291- # Wait for dbgview to start up and create the log file
292- while [ ! -f ./dbgview.log ]; do sleep 1; done
293-
294- ./target/debug/examples/native_windows
295- ./target/debug/examples/native_windows_srcloc
296-
297- # Wait for dbgview to flush the log file
298- while [ ! -s ./dbgview.log ]; do sleep 1; done
299- sleep 3
300- dbgview //q
301-
302- cat ./dbgview.log
303- cat ./dbgview.log | grep "\[demo] \[info] info message from spdlog-rs's WinDebugSink"
304- cat ./dbgview.log | grep "\[demo] \[error] error message from spdlog-rs's WinDebugSink { error_code=114514 }"
305- cat ./dbgview.log | grep -E "\[demo] \[info] \[native_windows, .+.rs:[0-9]+] info message from spdlog-rs's WinDebugSink"
306- cat ./dbgview.log | grep -E "\[demo] \[error] \[native_windows, .+.rs:[0-9]+] error message from spdlog-rs's WinDebugSink { error_code=114514 }"
264+ run : bash ./spdlog/tests/native/windows.sh run
307265
308266 test-native-android :
309267 strategy :
@@ -319,10 +277,7 @@ jobs:
319277 - name : Install cross
320278 run : cargo install cross --git https://github.com/cross-rs/cross --verbose
321279 - name : Build example
322- run : |
323- cross build --target x86_64-linux-android --example native_android --features native,android-ndk,source-location --verbose
324- mv ./target/x86_64-linux-android/debug/examples/native_android ./target/x86_64-linux-android/debug/examples/native_android_srcloc
325- cross build --target x86_64-linux-android --example native_android --features native,android-ndk --verbose
280+ run : bash ./spdlog/tests/native/android.sh build
326281 - name : Enable KVM
327282 run : |
328283 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
@@ -333,20 +288,7 @@ jobs:
333288 with :
334289 api-level : 29
335290 arch : x86_64
336- script : |
337- adb root
338- adb push ./target/x86_64-linux-android/debug/examples/native_android /data
339- adb push ./target/x86_64-linux-android/debug/examples/native_android_srcloc /data
340-
341- adb logcat -b all -c
342- adb shell /data/native_android
343- adb shell /data/native_android_srcloc
344- adb logcat -s "spdlog-rs-example" -d > ./logcat.log
345- cat ./logcat.log
346- cat ./logcat.log | grep "I spdlog-rs-example: \[demo] info message from spdlog-rs's AndroidSink"
347- cat ./logcat.log | grep "E spdlog-rs-example: \[demo] error message from spdlog-rs's AndroidSink { error_code=114514 }"
348- cat ./logcat.log | grep -E "I spdlog-rs-example: \[demo] \[native_android, .+.rs:[0-9]+] info message from spdlog-rs's AndroidSink"
349- cat ./logcat.log | grep -E "E spdlog-rs-example: \[demo] \[native_android, .+.rs:[0-9]+] error message from spdlog-rs's AndroidSink { error_code=114514 }"
291+ script : bash ./spdlog/tests/native/android.sh run
350292
351293 bench :
352294 needs : [test, check]
0 commit comments