Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable macos-13 tests on CI build #275

Merged
merged 4 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }})
Expand Down
33 changes: 13 additions & 20 deletions app/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 test-sheet-8
@(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 "tmux-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}/[email protected] && \
tmux -v send-keys -t $@ "q" && \
Expand Down Expand Up @@ -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 "tmux-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}/[email protected] && \
Expand All @@ -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 "tmux-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" && \
Expand All @@ -646,29 +651,18 @@ 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
@(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}/[email protected] && \
tmux send-keys -t $@ "q" && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})

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 "${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}/[email protected] && \
tmux send-keys -t $@ "q" && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || (echo 'Incorrect output:' && cat ${TMP_DIR}/[email protected] && ${TEST_FAIL}))

test-sheet-8: ${BUILD_DIR}/bin/zsv_sheet${EXE}
@${TEST_INIT}
@echo 'set-option default-terminal "tmux-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 send-keys -t $@ "f" "e" "Enter" && \
Expand All @@ -677,5 +671,4 @@ test-sheet-8: ${BUILD_DIR}/bin/zsv_sheet${EXE}
sleep 0.5 && \
tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/[email protected] && \
tmux send-keys -t $@ "q" && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})

${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || (echo 'Incorrect output:' && cat ${TMP_DIR}/[email protected] && ${TEST_FAIL}))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff command may be used instead of cmp.
In case of any differences, diff will dump the diff of files with non-zero exit status.