From 25193c0ef8cecc37c474ba476c5345d226a4a715 Mon Sep 17 00:00:00 2001 From: liquidaty Date: Sat, 9 Nov 2024 11:06:11 -0800 Subject: [PATCH 1/3] enable macos-13 tests on CI build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d33298f..500bfe35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -176,7 +176,7 @@ jobs: PREFIX: ${{ env.AMD64_MACOSX_GCC }} CC: gcc-13 MAKE: make - RUN_TESTS: false + RUN_TESTS: true run: ./scripts/ci-build.sh - name: Build on macOS (${{ env.ARM64_MACOSX_GCC }}) From 1c4b02489d188e98fb00c0a9cb7a934a3d217858 Mon Sep 17 00:00:00 2001 From: liquidaty Date: Sat, 9 Nov 2024 13:45:42 -0800 Subject: [PATCH 2/3] test-sheet: change term from tmux-256color to xterm-256color --- app/test/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/test/Makefile b/app/test/Makefile index 2be835ba..020e7f9d 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -589,7 +589,7 @@ test-sheet-all: test-sheet-1 test-sheet-2 test-sheet-3 test-sheet-4 test-sheet-5 test-sheet-1: ${BUILD_DIR}/bin/zsv_sheet${EXE} @${TEST_INIT} - @echo 'set-option default-terminal "tmux-256color"' > ~/.tmux.conf + @echo 'set-option default-terminal "xterm-256color"' > ~/.tmux.conf @(tmux -v new-session -x 80 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \ sleep 0.5 && \ tmux -v capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/$@.out && \ @@ -626,7 +626,7 @@ test-sheet-4: ${BUILD_DIR}/bin/zsv_sheet${EXE} test-sheet-5: ${BUILD_DIR}/bin/zsv_sheet${EXE} @${TEST_INIT} - @echo 'set-option default-terminal "tmux-256color"' > ~/.tmux.conf + @echo 'set-option default-terminal "xterm-256color"' > ~/.tmux.conf @(tmux new-session -x 160 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \ sleep 0.5 && \ tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/$@.out && \ @@ -635,7 +635,7 @@ test-sheet-5: ${BUILD_DIR}/bin/zsv_sheet${EXE} test-sheet-6: ${BUILD_DIR}/bin/zsv_sheet${EXE} @${TEST_INIT} - @echo 'set-option default-terminal "tmux-256color"' > ~/.tmux.conf + @echo 'set-option default-terminal "xterm-256color"' > ~/.tmux.conf @(tmux new-session -x 80 -y 50 -d -s $@ "${PREFIX} $< -d 3 ${TEST_DATA_DIR}/test/mixed-line-endings.csv" && \ sleep 0.5 && \ tmux send-keys -t $@ "G" "C-u" "C-u" "C-u" && \ @@ -646,7 +646,7 @@ test-sheet-6: ${BUILD_DIR}/bin/zsv_sheet${EXE} test-sheet-7: ${BUILD_DIR}/bin/zsv_sheet${EXE} @${TEST_INIT} - @echo 'set-option default-terminal "tmux-256color"' > ~/.tmux.conf + @echo 'set-option default-terminal "xterm-256color"' > ~/.tmux.conf @(tmux new-session -x 80 -y 5 -d -s $@ "${PREFIX} $< -d 3 ${TEST_DATA_DIR}/test/mixed-line-endings.csv" && \ sleep 0.5 && \ tmux send-keys -t $@ "G" "g" "g" "C-u" "/" "1234" "Enter" && \ From aa7869ab9d410e715fce07f23efdfc127ec87df3 Mon Sep 17 00:00:00 2001 From: liquidaty Date: Sat, 9 Nov 2024 14:10:16 -0800 Subject: [PATCH 3/3] test-sheet: more failure logging --- app/test/Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/test/Makefile b/app/test/Makefile index 020e7f9d..01e7aeaa 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -587,10 +587,15 @@ test-sheet-cleanup: test-sheet-all: test-sheet-1 test-sheet-2 test-sheet-3 test-sheet-4 test-sheet-5 test-sheet-6 test-sheet-7 @(for SESSION in $^; do ! tmux kill-session -t "$$SESSION" 2>/dev/null; done && ${TEST_PASS} || ${TEST_FAIL}) +TMUX_TERM=xterm-256color test-sheet-1: ${BUILD_DIR}/bin/zsv_sheet${EXE} +# For this first sheet test, separate new-session from the command so that if it fails we get better logging @${TEST_INIT} - @echo 'set-option default-terminal "xterm-256color"' > ~/.tmux.conf - @(tmux -v new-session -x 80 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \ + @tmux kill-session 2>/dev/null >/dev/null || printf '' + @echo 'set-option default-terminal "${TMUX_TERM}"' > ~/.tmux.conf + @(tmux -v new-session -x 80 -y 5 -d -s $@ && \ + sleep 0.5 && \ + tmux send-keys -t $@ "${PREFIX} $< worldcitiespop_mil.csv" ENTER && \ sleep 0.5 && \ tmux -v capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/$@.out && \ tmux -v send-keys -t $@ "q" && \ @@ -626,7 +631,7 @@ test-sheet-4: ${BUILD_DIR}/bin/zsv_sheet${EXE} test-sheet-5: ${BUILD_DIR}/bin/zsv_sheet${EXE} @${TEST_INIT} - @echo 'set-option default-terminal "xterm-256color"' > ~/.tmux.conf + @echo 'set-option default-terminal "${TMUX_TERM}"' > ~/.tmux.conf @(tmux new-session -x 160 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \ sleep 0.5 && \ tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/$@.out && \ @@ -635,7 +640,7 @@ test-sheet-5: ${BUILD_DIR}/bin/zsv_sheet${EXE} test-sheet-6: ${BUILD_DIR}/bin/zsv_sheet${EXE} @${TEST_INIT} - @echo 'set-option default-terminal "xterm-256color"' > ~/.tmux.conf + @echo 'set-option default-terminal "${TMUX_TERM}"' > ~/.tmux.conf @(tmux new-session -x 80 -y 50 -d -s $@ "${PREFIX} $< -d 3 ${TEST_DATA_DIR}/test/mixed-line-endings.csv" && \ sleep 0.5 && \ tmux send-keys -t $@ "G" "C-u" "C-u" "C-u" && \ @@ -646,11 +651,11 @@ test-sheet-6: ${BUILD_DIR}/bin/zsv_sheet${EXE} test-sheet-7: ${BUILD_DIR}/bin/zsv_sheet${EXE} @${TEST_INIT} - @echo 'set-option default-terminal "xterm-256color"' > ~/.tmux.conf + @echo 'set-option default-terminal "${TMUX_TERM}"' > ~/.tmux.conf @(tmux new-session -x 80 -y 5 -d -s $@ "${PREFIX} $< -d 3 ${TEST_DATA_DIR}/test/mixed-line-endings.csv" && \ sleep 0.5 && \ tmux send-keys -t $@ "G" "g" "g" "C-u" "/" "1234" "Enter" && \ sleep 0.5 && \ tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/$@.out && \ tmux send-keys -t $@ "q" && \ - ${CMP} ${TMP_DIR}/$@.out expected/$@.out && ${TEST_PASS} || ${TEST_FAIL}) + ${CMP} ${TMP_DIR}/$@.out expected/$@.out && ${TEST_PASS} || (echo 'Incorrect output:' && cat ${TMP_DIR}/$@.out && ${TEST_FAIL}))