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

[CUBRIDQA-1242] Add sort option on compare_result_between_files method #692

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
19 changes: 18 additions & 1 deletion CTP/shell/init_path/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function diff_ignore_lineno

# After comparing two files, This function write the result int result files.
# Usage:
# compare_result_between_files file1 file2 [error]
# compare_result_between_files file1 file2 [error|sort]

function compare_result_between_files
{
Expand Down Expand Up @@ -386,6 +386,23 @@ function compare_result_between_files
write_ok
fi
let "answer_no = answer_no + 1"
elif [ "$3" = "sort" ]
then
sorted_left="${left}_sorted"
sorted_right="${right}_sorted"
sort $left > $sorted_left
sort $right > $sorted_right

if diff_ignore_lineno $sorted_left $sorted_right -b
then
write_ok
else
write_nok
echo "diff $sorted_left $sorted_right failed" >> $result_file
diff_ignore_lineno $sorted_left $sorted_right -y |tee -a $result_file
fi

rm -f $sorted_left $sorted_right
else
if diff_ignore_lineno $left $right -b
then
Expand Down
Loading