From 2a0c9e7b0cc7dbcfa280e375d560f4e74fa87325 Mon Sep 17 00:00:00 2001 From: br1tney5pear5 Date: Thu, 2 Jan 2025 10:40:36 +0000 Subject: [PATCH] moved extension tests to ext example --- app/ext_example/Makefile | 24 ++++++++++++++++- .../test-sheet-extension-context-menu.out} | 0 .../test-sheet-extension-drill-down.out} | 0 app/test/Makefile | 27 +------------------ 4 files changed, 24 insertions(+), 27 deletions(-) rename app/{test/expected/test-sheet-example-extension-context-menu.out => ext_example/test/expected/test-sheet-extension-context-menu.out} (100%) rename app/{test/expected/test-sheet-example-extension-drill-down.out => ext_example/test/expected/test-sheet-extension-drill-down.out} (100%) diff --git a/app/ext_example/Makefile b/app/ext_example/Makefile index ec7eb8fe..82e1e355 100644 --- a/app/ext_example/Makefile +++ b/app/ext_example/Makefile @@ -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 @@ -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 diff --git a/app/test/expected/test-sheet-example-extension-context-menu.out b/app/ext_example/test/expected/test-sheet-extension-context-menu.out similarity index 100% rename from app/test/expected/test-sheet-example-extension-context-menu.out rename to app/ext_example/test/expected/test-sheet-extension-context-menu.out diff --git a/app/test/expected/test-sheet-example-extension-drill-down.out b/app/ext_example/test/expected/test-sheet-extension-drill-down.out similarity index 100% rename from app/test/expected/test-sheet-example-extension-drill-down.out rename to app/ext_example/test/expected/test-sheet-extension-drill-down.out diff --git a/app/test/Makefile b/app/test/Makefile index 43b85a28..225c6aaa 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -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 @@ -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}