Error 'Permission denied' is handled now. Closed #6

parent 117d153c
......@@ -15,7 +15,7 @@ else
endif
ifeq ($(PLANG),D)
DC=gdc #dmd, gdc or ldc2
DC=ldc2 #dmd, gdc or ldc2
PHOBOS_LINKING=static #static or dynamic
RELEASE_ARGS=release $(DC) $(PHOBOS_LINKING)
DEBUG_ARGS=debug $(DC) $(PHOBOS_LINKING)
......
......@@ -15,5 +15,5 @@ fi
cp ${BINPATH} testing/
cd testing
./testing.sh
cd -
cd - > /dev/null
rm testing/${APP}
......@@ -116,3 +116,4 @@
"Original: ","Оригинал: ","Originalo: "
"Fragments","Фрагменты","Fragmentoj"
"Replace the file? y/n >: ","Заменить файл? д/н >: ","Anstataŭigi la dosieron?"
": this path is not available.",": этот путь недоступен.",": ĉi tiu vojo estas neatingebla."
......@@ -62,7 +62,16 @@ string getVitisPath() {
auto msg = "(Error)"._s ~ " " ~ "file 'Vitis' blocks work."._s;
throw new FileException(msg);
} else if (!vitisPath.exists) {
mkdirRecurse(vitisPath);
try {
mkdirRecurse(vitisPath);
} catch(std.file.FileException e) {
if (e.msg.canFind("Permission denied")) {
auto err = vitisPath ~ ": this path is not available."._s;
throw new FileWarning(err);
} else {
throw new FileWarning(e.msg);
}
}
}
return vitisPath;
}
......
......@@ -312,10 +312,25 @@ start_of_use() {
} # REQ 3.1
bad_vitis_path() {
$vitis service set path /Vitis $OPTCONF
CMD="$vitis show D"
output=$($CMD $OPTCONF 2>&1)
expected="(Error) /Vitis/: this path is not available."
if [[ "$output" == "$expected" ]]; then
pass "${CMD}"
else
fail "${CMD}"
echo -n "${output}"
fi
$vitis service set path /tmp/Vitis $OPTCONF # back to default
}
procedure_base_tests() {
procedure_title "Base tests"
version
start_of_use
bad_vitis_path
}
......
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