Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- if: ${{ matrix.arch == 'x86_64' }}
run: |
# Only run tests on same arch
ant testng
sudo out/qz-tray-*.run
/opt/qz-tray/qz-tray --version
sudo apt-get install nsis
Expand All @@ -53,6 +54,7 @@ jobs:
- if: ${{ matrix.arch == 'aarch64' }}
run: |
# Only run tests on same arch
ant testng
sudo installer -pkg out/qz-tray-*.pkg -target /
"/Applications/QZ Tray.app/Contents/MacOS/QZ Tray" --version
brew install nsis makeself
Expand Down Expand Up @@ -80,6 +82,7 @@ jobs:
- if: ${{ matrix.arch == 'x86_64' }}
run: |
# Only run tests on same arch
ant testng
Start-Process -Wait ./out/qz-tray-*.exe -ArgumentList "/S"
"&'C:/Program Files/QZ Tray/qz-tray.exe' --wait --version|Out-Null"

Expand Down
1 change: 1 addition & 0 deletions ant/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ launch.overrides=QZ_OPTS

src.dir=${basedir}/src
out.dir=${basedir}/out
test.dir=${basedir}/test
build.dir=${out.dir}/build
dist.dir=${out.dir}/dist

Expand Down
30 changes: 30 additions & 0 deletions ant/testng.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<project name="testing-helpers" basedir="../">

<!-- find the testng jars -->
<path id="testng.found">
<first>
<fileset dir="lib/">
<include name="testng*.jar"/>
</fileset>
</first>
</path>
<pathconvert property="testng.path" refid="testng.found"/>
<path id="jcommander.found">
<first>
<fileset dir="lib/">
<include name="jcommander*.jar"/>
</fileset>
</first>
</path>
<pathconvert property="jcommander.path" refid="jcommander.found"/>

<path id="testng.classpath">
<pathelement location="${testng.path}" />
<pathelement location="${jcommander.path}" />
</path>

<echo level="info">testng.path: ${testng.path}</echo>
<echo level="info">jcommander.path: ${jcommander.path}</echo>

<taskdef name="testng" classpathref="testng.classpath" classname="org.testng.TestNGAntTask"/>
</project>
46 changes: 45 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<import file="ant/apple/installer.xml"/>
<import file="ant/linux/installer.xml"/>
<import file="ant/windows/installer.xml"/>
<import file="ant/testng.xml"/>

<!-- Fixes some odd empty directory issues -->
<defaultexcludes remove="**/.DS_Store"/>
Expand Down Expand Up @@ -76,6 +77,27 @@
</copy>
</target>

<target name="compile-tests" depends="compile-socket">
<echo level="info">test.dir: ${test.dir}</echo>

<javac destdir="${build.dir}/${project.filename}" source="${javac.source}" target="${javac.target}" includeantruntime="false" encoding="UTF-8" debug="true">
<src path="${test.dir}"/>
<classpath>
<!-- prefer bouncycastle from pdfbox over others -->
<path id="plugin.override">
<pathelement path="${pdfbox.path}"/>
</path>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${java.home}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<compilerarg value="-Xlint:-options"/>
</javac>
</target>

<target name="build-jar" depends="download-javafx,compile-socket,copy-libs,externalize-libs">
<echo level="info">Building jar</echo>

Expand Down Expand Up @@ -311,5 +333,27 @@
<target name="dmg" depends="get-target-arch,target-os-mac,distribute,provision,download-jre,build-dmg"/>
<target name="makeself" depends="get-target-arch,target-os-linux,distribute,provision,download-jre,build-run"/>


<target name="testng" depends="compile-tests">
<testng classpathref="testng.classpath" haltOnFailure="true" verbose="2">
<classpath>
<pathelement location="${build.dir}/${project.filename}"/>
<!-- prefer bouncycastle from pdfbox over others -->
<path id="plugin.override">
<pathelement path="${pdfbox.path}"/>
</path>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${java.home}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<classfileset dir="out/build/qz-tray" includes="**/*Tests.class">
<!-- FIXME: Convert all classes to leverage @Test annotation -->
<exclude name="**/InstallerTests.class"/>
<exclude name="**/AppFinderTests.class"/>
<exclude name="**/ProvisionerInstallerTests.class"/>
</classfileset>
</testng>
</target>
</project>
Loading