create and use new test-no-regression ant target in root build.xml

This commit is contained in:
Greg DiCristofaro 2020-11-02 13:51:40 -05:00
parent 40f35e713c
commit eee465f770
3 changed files with 63 additions and 45 deletions

View File

@ -44,4 +44,4 @@ build_script:
test_script:
- cd %APPVEYOR_BUILD_FOLDER%
- cmd: ant -q test
- cmd: ant -q test-no-regression

View File

@ -24,7 +24,7 @@
<!-- Verify that the java version running is . -->
<fail message="Unsupported Java version: ${ant.java.version}.
Make sure that the Java version is 1.8.0_66 or higher."
unless="supported-java-versions"/>
unless="supported-java-versions"/>
<!-- Determine platform and include specific file -->
<condition property="os.family" value="unix">
@ -68,22 +68,54 @@
</target>
<target name="clean" depends="suite.clean">
<delete includeEmptyDirs="true" failonerror="false">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="docs\doxygen-user\user-docs" includes="**/*"/>
</delete>
</delete>
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="docs\doxygen\doxygen_docs\api-docs" includes="**/*"/>
</delete>
</delete>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${basedir}/docs/doxygen-dev/build-docs" includes="**/*"/>
</delete>
</target>
<!-- This target is similar to the regular test target that calls test on all nbm's,
but this target excludes the Testing nbm which runs the regression tests -->
<target name="test-no-regression" depends="build" description="Runs tests for all modules in the suite excluding the regression tests of the Testing NBM.">
<!--taken from https://stackoverflow.com/a/10859103; remove "Testing" from the modules and provide 'modulesNoTesting' as result. -->
<property name="modulesBeforeChange" value="${modules}"/>
<script language="javascript">
<![CDATA[
var before = project.getProperty("modulesBeforeChange");
var separator = ":";
var testingNbm = "Testing";
var beforeSplit = before.split(separator);
var items = [];
for (var i = 0; i < beforeSplit.length; i++) {
if (beforeSplit[i].toUpperCase() !== testingNbm.toUpperCase()) {
items.push(beforeSplit[i]);
}
}
var itemsJoined = items.join(separator);
project.setNewProperty("modulesNoTesting", itemsJoined);
]]>
</script>
<sortsuitemodules unsortedmodules="${modulesNoTesting}" sortedmodulesproperty="modules.test.sorted" sorttests="true"/>
<!-- continue on fail -->
<property name="continue.after.failing.tests" value="true"/>
<subant target="test" buildpath="${modules.test.sorted}" inheritrefs="false" inheritall="false">
<property name="cluster.path.evaluated" value="${cluster.path.evaluated}"/> <!-- Just for speed of pre-7.0 projects -->
<property name="harness.taskdefs.done" value="${harness.taskdefs.done}"/> <!-- optimization -->
<property name="continue.after.failing.tests" value="${continue.after.failing.tests}"/>
</subant>
</target>
<!-- This target will create a custom ZIP file for us. It first uses the general
ZIP target and then opens it up and adds in any files that we want. This is where we customize the
version number. -->
ZIP target and then opens it up and adds in any files that we want. This is where we customize the
version number. -->
<target name="build-zip" depends="doxygen, suite.build-zip"> <!--,findJRE" -->
<property name="release.dir" value="${nbdist.dir}/${app.name}"/>
@ -128,15 +160,15 @@
<!-- for Japanese localized version add option: -Duser.language=ja -->
<if>
<equals arg1="${os.family}" arg2="mac"/>
<then>
<property name="jvm.options" value="&quot;${jvm-value} -J-Xdock:name=${app.title}&quot;"/>
</then>
<else>
<property name="jvm.options" value="&quot;${jvm-value}&quot;"/>
</else>
</if>
<if>
<equals arg1="${os.family}" arg2="mac"/>
<then>
<property name="jvm.options" value="&quot;${jvm-value} -J-Xdock:name=${app.title}&quot;"/>
</then>
<else>
<property name="jvm.options" value="&quot;${jvm-value}&quot;"/>
</else>
</if>
<propertyfile file="${app.property.file}">
<!-- Note: can be higher on 64 bit systems, should be in sync with project.properties -->
@ -146,9 +178,9 @@
<replace file="${app.property.file}" token="@JVM_OPTIONS" value="${jvm.options}" />
<!-- We want to remove the dlls in autopsy/modules/lib because they will
shadow the files in the autopsy/modules/lib/ARCHITECTURE folder in the JAR.
These files are legacy from when we used to copy the dlls to this location.
This check should do away in the future. Added Sept '13-->
shadow the files in the autopsy/modules/lib/ARCHITECTURE folder in the JAR.
These files are legacy from when we used to copy the dlls to this location.
This check should do away in the future. Added Sept '13-->
<delete failonerror="false">
<fileset dir="${zip-tmp}/${app.name}/autopsy/modules/lib">
<include name="libtsk_jni.dll" />
@ -188,9 +220,9 @@
<target name="input-build-type" unless="build.type">
<input addProperty="build.type"
message="Enter the desired build type:"
validargs="DEVELOPMENT,RELEASE"
defaultvalue="DEVELOPMENT"/>
message="Enter the desired build type:"
validargs="DEVELOPMENT,RELEASE"
defaultvalue="DEVELOPMENT"/>
</target>
<target name="input-version" unless="app.version">
@ -228,21 +260,21 @@
<echo>${app.name} branding</echo>
<propertyfile
file="${branding.dir}/core/core.jar/org/netbeans/core/startup/Bundle.properties"
comment="Updated by build script">
file="${branding.dir}/core/core.jar/org/netbeans/core/startup/Bundle.properties"
comment="Updated by build script">
<entry key="currentVersion" value="${app.title} ${app.version}" />
</propertyfile>
<propertyfile
file="${branding.dir}/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties"
comment="Updated by build script">
file="${branding.dir}/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties"
comment="Updated by build script">
<entry key="CTL_MainWindow_Title" value="${app.title} ${app.version}" />
<entry key="CTL_MainWindow_Title_No_Project" value="${app.title} ${app.version}" />
</propertyfile>
<propertyfile
file="${basedir}/Core/src/org/sleuthkit/autopsy/coreutils/Version.properties"
comment="Updated by build script">
file="${basedir}/Core/src/org/sleuthkit/autopsy/coreutils/Version.properties"
comment="Updated by build script">
<entry key="app.name" value="${app.title}" />
<entry key="app.version" value="${app.version}" />
<entry key="build.type" value="${build.type}" />
@ -329,7 +361,7 @@
<antcall target="build-installer-${os.family}" />
</target>
<target name="chmod_executables" >
<target name="chmod_executables" >
<chmod perm="a+x">
<fileset dir="${cluster}/markmckinnon" casesensitive="no" id="mm">
<include name="*_linux"/>

View File

@ -9,24 +9,10 @@ pushd bindings/java && ant -q dist && popd
echo "Building Autopsy..." && echo -en 'travis_fold:start:script.build\\r'
cd $TRAVIS_BUILD_DIR/
ant build
build_rc=$?
echo -en 'travis_fold:end:script.build\\r'
# don't continue to test if build failed.
if [[ $build_rc != 0 ]]; then
echo "Build failed. Not continuing to tests."
exit $build_rc
fi
echo "Testing Autopsy..." && echo -en 'travis_fold:start:script.tests\\r'
echo "Free Space:"
echo `df -h .`
xvfb-run ant -q test
test_rc=$?
xvfb-run ant -q test-no-regression
echo -en 'travis_fold:end:script.tests\\r'
exit $test_rc
if [[ $test_rc != 0 ]]; then
echo "There was a test failure."
exit $test_rc
fi