Skip to content

Commit

Permalink
make prettydiff available via parameter
Browse files Browse the repository at this point in the history
instead of trying to install when necessary
  • Loading branch information
peterstadler committed Jan 3, 2022
1 parent 6a98c47 commit a3d7d14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- name: Setup
run: sudo apt-get install libsaxonhe-java && npm install prettydiff
run: sudo apt-get install libsaxonhe-java && npm install -g prettydiff
- name: Checkout code
uses: actions/checkout@v2
- name: Build and run Docker image
run: ant docker_run
- name: Run tests
run: ant -lib /usr/share/java test
run: ant -lib /usr/share/java -Dprettydiff.cmd=`which prettydiff` test
3 changes: 2 additions & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ dist.dir=dist
tmp.dir=tmp
frontend_libs.dir=libs
dev_libs.dir=node_modules
sass.cmd=node_modules/sass/sass.js
sass.cmd=${dev_libs.dir}/sass/sass.js
yarn.cmd=yarn
prettydiff.cmd=${dev_libs.dir}/prettydiff/bin/prettydiff
bash.command=/bin/bash
wega.fonts.dir=/opt/wega-non-free/fonts
wega.img.dir=/opt/wega-non-free/img
Expand Down
14 changes: 2 additions & 12 deletions testing/ant-testing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,13 @@
</exec>
</target>

<target name="check-prettydiff">
<condition property="prettydiff.available" value="true">
<length file="${dev_libs.dir}/prettydiff/bin/prettydiff" when="ne" length="0" />
</condition>
</target>

<target name="update-prettydiff" depends="check-prettydiff" unless="prettydiff.available">
<antcall target="yarn"/>
</target>

<target name="diff" depends="update-prettydiff">
<target name="diff">
<xslt processor="trax" style="testing/flatten.xsl" basedir="${expected.results.dir}/${docType}" destdir="${tmp.dir}/expected.results.processed/${docType}"/>
<xslt processor="trax" style="testing/flatten.xsl" basedir="${tmp.dir}/results.raw/${docType}" destdir="${tmp.dir}/results.processed/${docType}"/>
<tempfile property="diff.out" destdir="${tmp.dir}" suffix=".txt" deleteonexit="false"/>
<exec executable="${bash.command}" output="${diff.out}">
<arg value="-c"/>
<arg value="for i in ${tmp.dir}/expected.results.processed/${docType}/* ; do echo &quot;File: $i&quot;; ${dev_libs.dir}/prettydiff/bin/prettydiff source:&quot;$i&quot; diff:&quot;${tmp.dir}/results.processed/${docType}/`basename $i`&quot; diffcli:&quot;true&quot; mode:&quot;diff&quot; ; done"/>
<arg value="for i in ${tmp.dir}/expected.results.processed/${docType}/* ; do echo &quot;File: $i&quot;; ${prettydiff.cmd} source:&quot;$i&quot; diff:&quot;${tmp.dir}/results.processed/${docType}/`basename $i`&quot; diffcli:&quot;true&quot; mode:&quot;diff&quot; ; done"/>
<!-- <arg value="for i in ${expected.results.dir}/${docType}/* ; do echo -e '******************\nPROCESSING' `basename $i`'\n******************' ; diff -B &lt;(saxon -s:$i -xsl:flatten.xsl) &lt;(saxon -s:${results.dir}/${docType}/`basename $i` -xsl:flatten.xsl) ; done"/>-->
<env key="LANG" value="C"/>
</exec>
Expand Down

0 comments on commit a3d7d14

Please sign in to comment.