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

Added code to handle more oddities in file naming. #328

Merged
merged 12 commits into from
Apr 5, 2019
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Each branch on this repository should correspond to the matching branch (i.e.
the one with the same name) in the
[main repository](https://github.com/gregorio-project/gregorio). That is, all
the tests should pass when run against that branch with TeXLive 2015. Thus all
the tests should pass when run against that branch with TeX Live 2018. Thus all
new development in the main repository should create a corresponding branch
here. The exception to this is a branch which should not break any existing
test and requires no new tests. In this instance, it's acceptable to simply
indicate that all tests on the develop (or master) branch here should pass.

### TeXLive 2014
### Supplemental Fonts

When testing with TeXLive 2014 the following tests are known to fail due to
The `gabc-output/bar-substitution.gabc` test makes use of gregorio.ttf and thus
will fail if the supplemental fonts are not installed.

### TeX Live 2014

When testing with TeX Live 2014 the following tests are known to fail due to
differences between its line breaking algorithms and those in TeXLive 2015 and later:
-`gabc-output/double-clef.gabc`

Expand Down
10 changes: 5 additions & 5 deletions example.gregorio-test.rc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# this is a shell script fragment
COLOR=true
VIEW_TEXT="less {file}"
DIFF_TEXT="vi -d {expect} {output}"
VIEW_TEXT=( less {file} )
DIFF_TEXT=( vi -d {expect} {output} )
if [ "$DISPLAY" != "" ]
then
VIEW_PDF="zathura {file}"
VIEW_IMAGES="pqiv {files}"
#DIFF_PDF="evince {expect} {output}"
VIEW_PDF=( zathura {file} )
VIEW_IMAGES=( imv {files} )
#DIFF_PDF=( evince {expect} {output} )
fi
55 changes: 33 additions & 22 deletions gregorio-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ IMAGE_COMPARE_THRESHOLD
float level of strictness for image comparison;
values between 0 and 1 with 1 being perfect match;
defaults to 0.9985
CLEAR_EOL string control sequence to clear from the cursor position to
the end of the line; defaults to the output of "tput el"
EOT
exit 2
fi
Expand Down Expand Up @@ -346,11 +348,12 @@ then
esac

function filter {
while read line
while IFS= read -r -d '' line
do
if [ "${tests_to_skip[$line]}" != "1" ]
then
echo $line
echo -n "$line"
echo -ne '\0'
fi
done
}
Expand All @@ -367,11 +370,12 @@ else
esac

function filter {
while read line
while IFS= read -r -d '' line
do
if [ "${tests_to_run[$line]}" = "1" -a "${tests_to_skip[$line]}" != "1" ]
then
echo $line
echo -n "$line"
echo -ne '\0'
fi
done
}
Expand Down Expand Up @@ -455,27 +459,35 @@ test|retest)
cd output
if $progress_bar
then
total=$(
for group in ${groups}
do
${group}_find | filter
done | wc -l
)
function progress {
# adapted from http://stackoverflow.com/questions/238073
let percent=$(((${1}*100/$total*100)/100))
let completed=$(((${percent}*5)/10))
let remaining=$((50-$completed))
fill=$(printf "%${completed}s")
empty=$(printf "%${remaining}s")
printf "Processed %3d%% [%s%s] %d/%d\r" $percent "${fill// /#}" "${empty// /_}" $count $total
}
total=0
for group in ${groups}
do
IFS= readarray -d '' counter < <( ${group}_find | filter )
total=$(( total + ${#counter[@]} ))
done

if [ "$total" = "0" ]
then
function progress {
:
}
else
function progress {
# adapted from http://stackoverflow.com/questions/238073
let percent=$(((${1}*100/$total*100)/100))
let completed=$(((${percent}*5)/10))
let remaining=$((50-$completed))
fill=$(printf "%${completed}s")
empty=$(printf "%${remaining}s")
printf "Processed %3d%% [%s%s] %d/%d\r" $percent "${fill// /#}" "${empty// /_}" $count $total
}
fi
fi
(
overall_result=0
time for group in ${groups}
do
if ! ${group}_find | filter | $XARGS -P $NPROCESSORS -n 1 -I{} bash -c "${group}_test"' "$@"' _ {} \;
if ! ${group}_find | filter | $XARGS -0 -P $NPROCESSORS -n 1 -I{} bash -c "${group}_test"' "$@"' _ {} \;
then
overall_result=1
fi
Expand Down Expand Up @@ -534,8 +546,7 @@ accept|view_*)
cd output
for group in ${groups}
do
# this silliness is so that the command gets the tty of this script
IFS=$'\r\n' GLOBIGNORE='*' :; filenames=( $(${group}_find | filter) )
IFS= readarray -d '' filenames < <( ${group}_find | filter )
if [ "${#filenames[@]}" -gt 0 ]
then
for filename in "${filenames[@]}"
Expand Down
Loading