-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Smaller optimizations to test cases #195
base: master
Are you sure you want to change the base?
Conversation
It looks like, case 49 fails. $ bash ./test/test_generator.sh 49 > ./test/case49.sh
//////// FOLLOWING TEST CASES WILL BE EXECUTED ////////
# @case: 49
# @skip: 1.8,2.3
test_log_option() {
$ bash ./test/case49.sh
Testing for bash 4.2.46(2)-release
tmux path: /home/linuxbrew/.linuxbrew/bin/tmux
tmux 3.3a
[detached (from session 0)]
>>>>>>>>>>
TMUX_XPANES_EXEC ... '/home/linuxbrew/.linuxbrew/bin/tmux'
test_log_option
$ TMUX_XPANES_LOG_DIRECTORY="/tmp/shunit.CpyQKF/tmp/logs" ./xpanes --log -I@ -S /tmp/shunit.CpyQKF/tmp/.xpanes-shunit -c"echo HOGE_@_ | sed s/HOGE/GEGE/ && touch /tmp/shunit.CpyQKF/tmp/fin/@ && /home/linuxbrew/.linuxbrew/bin/tmux detach-client" AAAA AAAA BBBB
[xpanes:info] /tmp/shunit.CpyQKF/tmp/logs is created.
[detached (from session xpanes-14266)]
wait_panes_separation: 1 sec...
AAAA-14405 @1
_window_id:[@1]
0: [181x39] [history 0/2000, 2603 bytes] %1 (active)
1: [180x39] [history 0/2000, 2823 bytes] %3
2: [362x38] [history 0/2000, 3471 bytes] %2
/tmp/shunit.CpyQKF/tmp/logs/AAAA-1.log.2023-04-29_16-31-14
/tmp/shunit.CpyQKF/tmp/logs/AAAA-2.log.2023-04-29_16-31-14
/tmp/shunit.CpyQKF/tmp/logs/BBBB-1.log.2023-04-29_16-31-14
TMUX(TMUX_XPANES_LOG_DIRECTORY="/tmp/shunit.CpyQKF/tmp/logs" ./xpanes --log -I@ -S /tmp/shunit.CpyQKF/tmp/.xpanes-shunit -c"echo HOGE_@_ | sed s/HOGE/GEGE/ && touch /tmp/shunit.CpyQKF/tmp/fin/@ && /home/linuxbrew/.linuxbrew/bin/tmux detach-client" AAAA AAAA BBBB)
[detached (from session 0)]
[detached (from session 0)]
wait_panes_separation: 1 sec...
bash @0
AAAA-14821 @1
_window_id:[@1]
0: [181x39] [history 0/2000, 2603 bytes] %1 (active)
1: [180x39] [history 0/2000, 2823 bytes] %3
2: [362x38] [history 0/2000, 3471 bytes] %2
/tmp/shunit.CpyQKF/tmp/logs/AAAA-1.log.2023-04-29_16-31-14
/tmp/shunit.CpyQKF/tmp/logs/AAAA-1.log.2023-04-29_16-31-24
./test/case49.sh: line 651: /tmp/shunit.CpyQKF/tmp/logs/AAAA-1.log.2023-04-29_16-31-14
/tmp/shunit.CpyQKF/tmp/logs/AAAA-1.log.2023-04-29_16-31-24: No such file or directory
ASSERT:expected:<1> but was:<>
/tmp/shunit.CpyQKF/tmp/logs/AAAA-2.log.2023-04-29_16-31-14
/tmp/shunit.CpyQKF/tmp/logs/AAAA-2.log.2023-04-29_16-31-24
./test/case49.sh: line 656: /tmp/shunit.CpyQKF/tmp/logs/AAAA-2.log.2023-04-29_16-31-14
/tmp/shunit.CpyQKF/tmp/logs/AAAA-2.log.2023-04-29_16-31-24: No such file or directory
ASSERT:expected:<1> but was:<>
/tmp/shunit.CpyQKF/tmp/logs/BBBB-1.log.2023-04-29_16-31-14
/tmp/shunit.CpyQKF/tmp/logs/BBBB-1.log.2023-04-29_16-31-24
./test/case49.sh: line 661: /tmp/shunit.CpyQKF/tmp/logs/BBBB-1.log.2023-04-29_16-31-14
/tmp/shunit.CpyQKF/tmp/logs/BBBB-1.log.2023-04-29_16-31-24: No such file or directory
ASSERT:expected:<1> but was:<>
<<<<<<<<<<
in oneTimeTearDown
Ran 1 test.
FAILED (failures=3)
<<<<<<<<<< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes have unnecessarily removed directories and it may cause the test failures.
test/cases_all.sh
Outdated
rmdir "${_tmpdir}"/logs | ||
rm -f "${_tmpdir}"/fin/* | ||
rmdir "${_tmpdir}"/fin | ||
rm -rf "${_logdir}" "${_tmpdir}"/fin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm -rf "${_logdir}" "${_tmpdir}"/fin | |
rm -rf "${_tmpdir}"/{fin,logs} |
test/cases_all.sh
Outdated
@@ -3016,8 +2971,7 @@ test_x_option_with_pipe() { | |||
assertEquals "CCCC" "$(cat "${_tmpdir}/fin/CCCC")" | |||
|
|||
close_tmux_session "$_socket_file" | |||
rm -f "${_tmpdir}"/fin/* | |||
rmdir "${_tmpdir}"/fin | |||
rm -rf "${_tmpdir}"/fin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set indentation
rm -rf "${_tmpdir}"/fin | |
rm -rf "${_tmpdir}"/fin |
test/cases_all.sh
Outdated
@@ -3081,8 +3035,7 @@ test_x_option_with_cols_rows() { | |||
assertEquals "CCCC" "$(cat "${_tmpdir}/fin/CCCC")" | |||
|
|||
close_tmux_session "$_socket_file" | |||
rm -f "${_tmpdir}"/fin/* | |||
rmdir "${_tmpdir}"/fin | |||
rm -rf "${_tmpdir}"/fin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set indentation
rm -rf "${_tmpdir}"/fin | |
rm -rf "${_tmpdir}"/fin |
test/cases_all.sh
Outdated
@@ -3149,8 +3102,7 @@ test_t_and_x_option() { | |||
assertEquals "AAAA@BBBB@CCCC@DDDD@" "$(eval "${TMUX_EXEC} -S ${_socket_file} list-panes -F '#{pane_title}'" | tr '\n' '@')" | |||
|
|||
close_tmux_session "$_socket_file" | |||
rm -f "${_tmpdir}"/fin/* | |||
rmdir "${_tmpdir}"/fin | |||
rm -rf "${_tmpdir}"/fin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm -rf "${_tmpdir}"/fin | |
rm -rf "${_tmpdir}"/fin |
test/cases_all.sh
Outdated
@@ -3184,8 +3136,7 @@ test_t_option_pipe() { | |||
assertEquals "AAAA@BBBB@" "$(eval "${TMUX_EXEC} -S ${_socket_file} list-panes -F '#{pane_title}'" | tr '\n' '@')" | |||
|
|||
close_tmux_session "$_socket_file" | |||
rm -f "${_tmpdir}"/fin/* | |||
rmdir "${_tmpdir}"/fin | |||
rm -rf "${_tmpdir}"/fin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm -rf "${_tmpdir}"/fin | |
rm -rf "${_tmpdir}"/fin |
Co-authored-by: Yasuhiro Yamada <[email protected]>
Co-authored-by: Yasuhiro Yamada <[email protected]>
Hello Greymd, thank your for your review. I managed to send it just before I got sick and was not able to look over the merge at that time. I will fix all the required changes over the upcoming next week. I will mark this as draft for now. |
smaller optimization to sed.
removed excessive rm usage.
It should look good but please make sure I havent made any mistake.
Cheers