Skip to content

Commit

Permalink
moved extension tests to ext example
Browse files Browse the repository at this point in the history
  • Loading branch information
br1tney5pear5 committed Jan 2, 2025
1 parent bd2604c commit 2a0c9e7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 27 deletions.
24 changes: 23 additions & 1 deletion app/ext_example/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ ${BUILD_DIR}/bin/cli:
${BUILD_DIR}/objs/utils/%.o:
(cd .. && ${MAKE} CONFIGFILE=${CONFIGFILEPATH} CC=${CC} DEBUG=${DEBUG} $@ )

TESTS=test-1 test-2 test-3 test-4 test-5 test-thirdparty
TESTS=test-1 test-2 test-3 test-4 test-5 test-thirdparty test-sheet-extension-context-menu test-sheet-extension-drill-down
ifeq ($(ZSVSHEET_BUILD),1)
TESTS+=test-sheet-extension-1 test-sheet-extension-2
endif
Expand Down Expand Up @@ -198,6 +198,28 @@ test-thirdparty: test-%: ${CLI} ${TARGET}
@${RUN_CLI} thirdparty >> /tmp/zsvext-$@.out
@cmp /tmp/zsvext-$@.out test/expected/zsvext-$@.out && ${TEST_PASS} || ${TEST_FAIL}

test-sheet-extension-context-menu: ${CLI} ${TARGET}
${TEST_INIT}
@echo 'set-option default-terminal "${TMUX_TERM}"' > ~/.tmux.conf
@${RUN_CLI} unregister mysheet 1>/dev/null || true
@${RUN_CLI} register mysheet 2>/dev/null
@tmux new-session -x 80 -y 25 -d -s "$@" "${RUN_CLI} sheet ../test/worldcitiespop_mil.csv"
@${RUN_CLI} unregister mysheet 1>/dev/null || true # unregister regardless of whether the test succeeds or not
@tmux send-keys -t $@ "v" "country" "Enter"
@tmux send-keys -t $@ "jjjj" "Enter" # go down a few rows and open menu
@${EXPECT} $@ && ${TEST_PASS} || ${TEST_FAIL}

test-sheet-extension-drill-down: ${CLI} ${TARGET}
${TEST_INIT}
@echo 'set-option default-terminal "${TMUX_TERM}"' > ~/.tmux.conf
@${RUN_CLI} unregister mysheet 1>/dev/null || true
@${RUN_CLI} register mysheet 2>/dev/null
@tmux new-session -x 80 -y 25 -d -s "$@" "${RUN_CLI} sheet ../test/worldcitiespop_mil.csv"
@${RUN_CLI} unregister mysheet 1>/dev/null || true # unregister regardless of whether the test succeeds or not
@tmux send-keys -t $@ "v" "country" "Enter"
@tmux send-keys -t $@ "jjjj" "Enter" "Enter" # go down a few rows and open menu and drill down
@${EXPECT} $@ && ${TEST_PASS} || ${TEST_FAIL}

clean:
@rm -f ${TARGET} ${TARGET_SHEET} /tmp/zsvext-test*.out

Expand Down
27 changes: 1 addition & 26 deletions app/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ test-sheet-cleanup:
@rm -f tmux-*.log
@tmux kill-server || printf ''

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 test-sheet-9 test-sheet-10 test-sheet-11 test-sheet-12 test-sheet-13 test-sheet-14 test-sheet-subcommand test-sheet-prop-cmd-opt test-sheet-example-extension
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 test-sheet-9 test-sheet-10 test-sheet-11 test-sheet-12 test-sheet-13 test-sheet-14 test-sheet-subcommand test-sheet-prop-cmd-opt
@(for SESSION in $^; do ! tmux kill-session -t "$$SESSION" 2>/dev/null; done && ${TEST_PASS} || ${TEST_FAIL})

TMUX_TERM=xterm-256color
Expand Down Expand Up @@ -825,28 +825,3 @@ benchmark-sheet-index: ${BUILD_DIR}/bin/zsv_sheet${EXE} ${TIMINGS_CSV}
${EXPECT} $@ indexed && \
tmux send-keys -t $@ "G" && \
${EXPECT} $@ && ${TEST_PASS} || ${TEST_FAIL})

test-sheet-example-extension:\
test-sheet-example-extension-context-menu test-sheet-example-extension-drill-down

test-sheet-example-extension-context-menu: ${BUILD_DIR}/bin/zsv_sheet${EXE}
${TEST_INIT}
@echo 'set-option default-terminal "${TMUX_TERM}"' > ~/.tmux.conf
@${PREFIX} ${BUILD_DIR}/bin/cli unregister mysheet || true
@${PREFIX} ${BUILD_DIR}/bin/cli register mysheet
@tmux new-session -x 80 -y 25 -d -s "$@" "${PREFIX} ${BUILD_DIR}/bin/cli sheet worldcitiespop_mil.csv"
@${PREFIX} ${BUILD_DIR}/bin/cli unregister mysheet || true # unregister regardless of whether the test succeeds or not
@tmux send-keys -t $@ "v" "country" "Enter"
@tmux send-keys -t $@ "jjjj" "Enter" # go down a few rows and open menu
@${EXPECT} $@ && ${TEST_PASS} || ${TEST_FAIL}

test-sheet-example-extension-drill-down: ${BUILD_DIR}/bin/zsv_sheet${EXE}
${TEST_INIT}
@echo 'set-option default-terminal "${TMUX_TERM}"' > ~/.tmux.conf
@${PREFIX} ${BUILD_DIR}/bin/cli unregister mysheet || true
@${PREFIX} ${BUILD_DIR}/bin/cli register mysheet
@tmux new-session -x 80 -y 25 -d -s "$@" "${PREFIX} ${BUILD_DIR}/bin/cli sheet worldcitiespop_mil.csv"
@${PREFIX} ${BUILD_DIR}/bin/cli unregister mysheet || true # unregister regardless of whether the test succeeds or not
@tmux send-keys -t $@ "v" "country" "Enter"
@tmux send-keys -t $@ "jjjj" "Enter" "Enter" # go down a few rows and open menu and drill down
@${EXPECT} $@ && ${TEST_PASS} || ${TEST_FAIL}

0 comments on commit 2a0c9e7

Please sign in to comment.