Optimization of tests

parent 8482a782
......@@ -211,7 +211,12 @@ destroy_file_env() {
rm -rf ${FSPACE1} ${FSPACE2}
}
COPY_MADE=FALSE
create_category_env() {
if [[ $COPY_MADE == TRUE ]]; then
restore_copy_of_category_env
return 0
fi
vitis="$PWD/vitis"
OPTCONF="--conf $PWD/vitis.1.conf"
cd $FILESDIR
......@@ -232,8 +237,22 @@ create_category_env() {
cd - > /dev/null
vitis=./vitis
OPTCONF="--conf vitis.1.conf"
make_copy_of_category_env
COPY_MADE=TRUE
}
make_copy_of_category_env() {
cp -R ${VTS} ${VTS}.1
}
restore_copy_of_category_env() {
rm -rf ${VTS}
cp -R ${VTS}.1 ${VTS}
}
delete_copy_of_category_env() {
rm -rf ${VTS}.1
}
################################################################################
# BASE TESTS
......@@ -1127,7 +1146,7 @@ case_2_3_7() {
}
case_2_3_8() {
subtitle "Repeated copying in file space"
subtitle "Case 8: repeated copying in file space"
create_file_env
$vitis create Category $OPTCONF_AUTOSAVE
CMD="$vitis assign Category -f ${FILE1}"
......@@ -1408,7 +1427,6 @@ procedure_2_4() {
case_2_4_3
case_2_4_4
case_2_4_5
case_2_4_5
case_2_4_6
case_2_4_7
case_2_4_8
......@@ -1530,7 +1548,7 @@ using the '--number' flag."
}
case_2_5_7() {
subtitle "Case 6: no repeated names and --number (wrong using)"
subtitle "Case 7: no repeated names and --number (wrong using)"
create_file_env
$vitis assign -c Category -f $FILE1 --yes $OPTCONF
$vitis create -c Category2 $OPTCONF
......@@ -2695,7 +2713,6 @@ case_3_2_3() {
output=$($CMD $OPTCONF 2>&1)
expected="Category/file99.txt: file in Vitis is not found. \
The request is skipped."
echo "$output"
if [[ "${output}" == "${expected}" ]]; then
pass "${CMD}"
else
......@@ -3314,8 +3331,10 @@ case_4_3_3() {
}
case_4_3_4() {
subtitle "Case 4: autocategories"
create_file_env && create_category_env
create_file_env
create_category_env
CMD="$vitis show --all-categories --auto"
output=$($CMD $OPTCONF 2>&1)
expected="\
......@@ -3349,6 +3368,7 @@ tests_show() {
procedure_4_1
procedure_4_2
procedure_4_3
delete_copy_of_category_env
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment