Skip to content
Permalink
Browse files

Shellcheck

  • Loading branch information
elpaso committed Nov 13, 2018
1 parent 99f7236 commit b7e555684444e8d745677ec5eb1b334b2a21360d
@@ -51,32 +51,35 @@ cp /usr/bin/qgis_startup.py ${STARTUP_MASTER_FOLDER}/startup.py
printf "[Qgis]\n" >> $CONF_FILE
# !!!! Note that on master it is lowercase !!!!
printf "[qgis]\n" >> $CONF_MASTER_FILE
SHOW_TIPS=`qgis --help 2>&1 | head -2 | grep 'QGIS - ' | perl -npe 'chomp; s/QGIS - (\d+)\.(\d+).*/showTips\1\2=false/'`
printf "$SHOW_TIPS\n\n" >> $CONF_FILE
printf "$SHOW_TIPS\n\n" >> $CONF_MASTER_FILE
SHOW_TIPS=$(qgis --help 2>&1 | head -2 | grep 'QGIS - ' | perl -npe 'chomp; s/QGIS - (\d+)\.(\d+).*/showTips\1\2=false/')
printf "%s\n\n" "$SHOW_TIPS" >> $CONF_FILE
printf "%s\n\n" "$SHOW_TIPS" >> $CONF_MASTER_FILE

if [ -n "$PLUGIN_NAME" ]; then
# Enable plugin
printf '[PythonPlugins]\n' >> $CONF_FILE
printf "${PLUGIN_NAME}=true\n\n" >> $CONF_FILE
printf "%s=true\n\n" "$PLUGIN_NAME" >> $CONF_FILE

printf '[PythonPlugins]\n' >> $CONF_MASTER_FILE
printf "${PLUGIN_NAME}=true\n\n" >> $CONF_MASTER_FILE
printf "%s=true\n\n" "$PLUGIN_NAME" >> $CONF_MASTER_FILE
fi

# Disable firstRunVersionFlag for master
printf "\n[migration]\n" >> $CONF_MASTER_FILE
printf "fileVersion=2\n" >> $CONF_MASTER_FILE
printf "firstRunVersionFlag=29900\n" >> $CONF_MASTER_FILE
printf "settings=true\n\n" >> $CONF_MASTER_FILE
{
printf
"\n[migration]\n"
"fileVersion=2\n"
"firstRunVersionFlag=29900\n"
"settings=true\n\n"
} >> $CONF_MASTER_FILE


# Install the plugin
if [ ! -L "${PLUGIN_FOLDER}/${PLUGIN_NAME}" ]; then
ln -s /tests_directory/${PLUGIN_NAME} ${PLUGIN_FOLDER}
ln -s "/tests_directory/${PLUGIN_NAME}" "${PLUGIN_FOLDER}"
echo "Plugin folder linked in ${PLUGIN_FOLDER}/${PLUGIN_NAME}"
fi
if [ ! -d "${PLUGIN_MASTER_FOLDER}/${PLUGIN_NAME}" ]; then
ln -s /tests_directory/${PLUGIN_NAME} ${PLUGIN_MASTER_FOLDER}
ln -s "/tests_directory/${PLUGIN_NAME}" "${PLUGIN_MASTER_FOLDER}"
echo "Plugin master folder linked in ${PLUGIN_MASTER_FOLDER}/${PLUGIN_NAME}"
fi
@@ -7,17 +7,17 @@ TEST_NAME=$1

cd /tests_directory
echo "Running test $1 ..."
OUTPUT=$(QGIS_TEST_MODULE=${TEST_NAME} unbuffer qgis --version-migration --nologo --code /usr/bin/qgis_testrunner.py $TEST_NAME 2>/dev/null | tee /dev/tty)
OUTPUT=$(QGIS_TEST_MODULE=${TEST_NAME} unbuffer qgis --version-migration --nologo --code /usr/bin/qgis_testrunner.py "$TEST_NAME" 2>/dev/null | tee /dev/tty)
EXIT_CODE="$?"
if [ -z "$OUTPUT" ]; then
echo "ERROR: no output from the test runner! (exit code: ${EXIT_CODE})"
exit 1
fi
echo $OUTPUT | grep -q FAILED
echo "$OUTPUT" | grep -q FAILED
IS_FAILED="$?"
echo $OUTPUT | grep OK | grep -q 'Ran'
echo "$OUTPUT" | grep OK | grep -q 'Ran'
IS_PASSED="$?"
echo $OUTPUT | grep "QGIS died on signal"
echo "$OUTPUT" | grep "QGIS died on signal"
IS_DEAD="$?"
echo "Finished running test $1."
if [ "$IS_PASSED" -eq "0" ] && [ "$IS_FAILED" -eq "1" ] && [ "$IS_DEAD" -eq "1" ]; then

0 comments on commit b7e5556

Please sign in to comment.
You can’t perform that action at this time.