Skip to content

Commit 9cabc44

Browse files
committed
corrected for test data change
1 parent 0e77455 commit 9cabc44

2 files changed

Lines changed: 56 additions & 36 deletions

File tree

ant/bc+-build.xml

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<project name="crypto.bcbuild" default="build" basedir=".">
44

5+
<property file="bc-build.user.properties" />
56
<property file="bc-build.properties" />
67
<property environment="env" />
78

@@ -192,6 +193,7 @@
192193
<fileset dir="${artifacts.dir}/@{target}/src" includes="**/*.txt" />
193194
<fileset dir="${artifacts.dir}/@{target}/src" includes="**/*.rsp" />
194195
<fileset dir="${artifacts.dir}/@{target}/src" includes="**/*.gpg" />
196+
<fileset dir="${artifacts.dir}/@{target}/src" includes="**/*.pgp" />
195197
<fileset dir="${artifacts.dir}/@{target}/src" includes="**/*.pub" />
196198
<fileset dir="${artifacts.dir}/@{target}/src" includes="**/*.sec" />
197199
</copy>
@@ -224,6 +226,7 @@
224226
<include name="**/*.rsp" />
225227
<include name="**/*.key" />
226228
<include name="**/*.gpg" />
229+
<include name="**/*.pgp" />
227230
<include name="**/*.pub" />
228231
<include name="**/*.sec" />
229232
<include name="**/*.ers" />
@@ -298,6 +301,7 @@
298301
<include name="org/bouncycastle/util/**/*.java" />
299302
<include name="org/bouncycastle/asn1/**/*.java" />
300303
<include name="org/bouncycastle/internal/**/*.java" />
304+
<include name="org/bouncycastle/test/*.java" />
301305
<include name="org/bouncycastle/pqc/legacy/**/*.java" />
302306
<include name="org/bouncycastle/pqc/crypto/**/*.java" />
303307
<include name="org/bouncycastle/pqc/math/**/*.java" />
@@ -340,11 +344,13 @@
340344
<exclude name="rfc4134/**" />
341345
<exclude name="pgpdata/**" />
342346
<exclude name="org/bouncycastle/**/AllTests.java" />
347+
<exclude name="org/bouncycastle/test/*.java" />
343348
<exclude name="org/bouncycastle/**/test/**" />
344349
<exclude name="org/bouncycastle/crypto/*/*Test.java" />
345350
<exclude name="org/bouncycastle/asn1/*/*Test.java" />
346351
<exclude name="org/bouncycastle/util/*Test.java" />
347352
<exclude name="org/bouncycastle/pqc/**/*Tests.java" />
353+
<exclude name="org/bouncycastle/pqc/**/*Test.java" />
348354
<exclude name="org/bouncycastle/pqc/**/LMSVectorUtils.java" />
349355
<exclude name="**/*.crl" />
350356
<exclude name="org/bouncycastle/util/utiltest/**" />
@@ -908,6 +914,7 @@
908914
<copyStandardFiles toDir="${test.target.dir}" />
909915

910916
<copy todir="${test.target.src.dir}">
917+
<fileset dir="${src.dir}" includes="/org/bouncycastle/test/*.java" />
911918
<fileset dir="${src.dir}" includes="**/*AllTests.java" />
912919
<fileset dir="${src.dir}" includes="**/math/**/*Test.java" />
913920
<fileset dir="${src.dir}" includes="**/crypto/*/*Test.java" />
@@ -935,6 +942,7 @@
935942
<fileset dir="${src.dir}" includes="**/*.txt" />
936943
<fileset dir="${src.dir}" includes="**/*.rsp" />
937944
<fileset dir="${src.dir}" includes="**/*.gpg" />
945+
<fileset dir="${src.dir}" includes="**/*.pgp" />
938946
<fileset dir="${src.dir}" includes="**/*.pub" />
939947
<fileset dir="${src.dir}" includes="**/*.sec" />
940948
<fileset dir="${src.dir}" includes="**/*.cvcert" />
@@ -971,7 +979,7 @@
971979
<property name="test.target.src.dir" value="${test.target.dir}/src" />
972980

973981
<mkdir dir="${basedir}/${build.dir}/${target.prefix}" />
974-
<junit fork="yes" dir="${basedir}/${build.dir}/${target.prefix}" failureProperty="test.failed">
982+
<junit fork="yes" dir="${basedir}/${build.dir}/${target.prefix}" failureProperty="test.failed" printsummary="${junit.printsummary}">
975983
<classpath>
976984
<path refid="project.classpath" />
977985
<fileset dir="${artifacts.jars.dir}">
@@ -986,6 +994,7 @@
986994
<batchtest todir="${artifacts.reports.xml.dir}" unless="testcase">
987995
<fileset dir="${test.target.src.dir}">
988996
<include name="**/AllTests.java" />
997+
<exclude name="${env.JUNIT_EXCLUDE_TESTS}" if="env.JUNIT_EXCLUDE_TESTS" />
989998
</fileset>
990999
</batchtest>
9911000
</junit>
@@ -1035,14 +1044,6 @@
10351044
<target name="javadoc-provider" depends="initMacros">
10361045
<copy todir="${provider.target.src.dir}">
10371046
<fileset dir="${src.dir}">
1038-
<include name="org/bouncycastle/pqc/**/test/*.java" />
1039-
<include name="org/bouncycastle/jce/**/test/*.java" />
1040-
<include name="org/bouncycastle/jce/**/test/*/*.java" />
1041-
<include name="org/bouncycastle/x509/**/test/*.java" />
1042-
<include name="org/bouncycastle/ocsp/**/test/*.java" />
1043-
<include name="org/bouncycastle/crypto/**/test/*.java" />
1044-
<include name="org/bouncycastle/crypto/**/test/cavp/*.java" />
1045-
<include name="org/bouncycastle/asn1/test/*.java" />
10461047
<include name="org/bouncycastle/crypto/**/*.html" />
10471048
<include name="org/bouncycastle/math/**/*.html" />
10481049
<include name="org/bouncycastle/asn1/**/*.html" />
@@ -1082,10 +1083,11 @@
10821083
<target name="javadoc-jce" depends="initMacros">
10831084
<copy todir="${jce.target.src.dir}">
10841085
<fileset dir="${src.dir}">
1085-
<include name="org/bouncycastle/jce/**/test/*.java" />
1086-
<include name="org/bouncycastle/jce/**/test/*/*.java" />
1087-
<include name="org/bouncycastle/x509/**/test/*.java" />
1088-
<include name="org/bouncycastle/ocsp/**/test/*.java" />
1086+
<include name="org/bouncycastle/crypto/**/*.html" />
1087+
<include name="org/bouncycastle/math/**/*.html" />
1088+
<include name="org/bouncycastle/asn1/**/*.html" />
1089+
<include name="org/bouncycastle/pqc/**/*.html" />
1090+
<include name="org/bouncycastle/util/**/*.html" />
10891091
</fileset>
10901092
</copy>
10911093

@@ -1120,7 +1122,6 @@
11201122
<target name="javadoc-mail" depends="initMacros">
11211123
<copy todir="${mail.target.src.dir}">
11221124
<fileset dir="${src.dir}">
1123-
<include name="org/bouncycastle/mail/**/test/*.java" />
11241125
<include name="org/bouncycastle/mail/**/*.html" />
11251126
</fileset>
11261127
</copy>
@@ -1143,9 +1144,7 @@
11431144
<target name="javadoc-tls" depends="initMacros">
11441145
<copy todir="${tls.target.src.dir}">
11451146
<fileset dir="${src.dir}">
1146-
<include name="org/bouncycastle/jsse/**/test/*.java" />
11471147
<include name="org/bouncycastle/jsse/**/*.html" />
1148-
<include name="org/bouncycastle/tls/**/test/*.java" />
11491148
<include name="org/bouncycastle/tls/**/*.html" />
11501149
</fileset>
11511150
</copy>
@@ -1225,18 +1224,6 @@
12251224
<target name="javadoc-pkix" depends="initMacros">
12261225
<copy todir="${pkix.target.src.dir}">
12271226
<fileset dir="${src.dir}">
1228-
<include name="org/bouncycastle/cms/**/test/*.java" />
1229-
<include name="org/bouncycastle/pkix/**/test/*.java" />
1230-
<include name="org/bouncycastle/dvcs/**/test/*.java" />
1231-
<include name="org/bouncycastle/eac/**/test/*.java" />
1232-
<include name="org/bouncycastle/est/**/test/*.java" />
1233-
<include name="org/bouncycastle/cmc/**/test/*.java" />
1234-
<include name="org/bouncycastle/cert/**/test/*.java" />
1235-
<include name="org/bouncycastle/mime/**/test/*.java" />
1236-
<include name="org/bouncycastle/pkcs/**/test/*.java" />
1237-
<include name="org/bouncycastle/openssl/**/test/*.java" />
1238-
<include name="org/bouncycastle/mozilla/**/test/*.java" />
1239-
<include name="org/bouncycastle/operator/**/test/*.java" />
12401227
<include name="org/bouncycastle/mime/**/*.html" />
12411228
<include name="org/bouncycastle/cms/**/*.html" />
12421229
<include name="org/bouncycastle/pkix/**/*.html" />
@@ -1249,7 +1236,6 @@
12491236
<include name="org/bouncycastle/openssl/**/*.html" />
12501237
<include name="org/bouncycastle/operator/**/*.html" />
12511238
<include name="org/bouncycastle/mozilla/**/*.html" />
1252-
<include name="org/bouncycastle/tsp/**/test/*.java" />
12531239
<include name="org/bouncycastle/tsp/**/*.html" />
12541240
</fileset>
12551241
</copy>
@@ -1277,7 +1263,6 @@
12771263
<group title="MIME Packages" packages="org.bouncycastle.mime*" />
12781264
<group title="OpenSSL and PEM Support Packages" packages="org.bouncycastle.openssl*" />
12791265
<group title="TSP Packages" packages="org.bouncycastle.tsp*" />
1280-
<group title="Test and Example Packages" packages="org.bouncycastle.openssl.test*,org.bouncycastle.mozilla.test*,org.bouncycastle.pkcs.test*,org.bouncycastle.cert.test*,org.bouncycastle.cert.path.test*,org.bouncycastle.cert.ocsp.test*,org.bouncycastle.cert.crmf.test*,org.bouncycastle.cert.cmp.test*,org.bouncycastle.eac.test*,org.bouncycastle.dvcs.test*,org.bouncycastle.est.test*,org.bouncycastle.cms.test*,org.bouncycastle.mime.test*,org.bouncycastle.tsp.test*,org.bouncycastle.operator.test*" />
12811266
</docElements>
12821267
</compile-doc>
12831268

@@ -1292,7 +1277,6 @@
12921277
<target name="javadoc-pg" depends="initMacros">
12931278
<copy todir="${pg.target.src.dir}">
12941279
<fileset dir="${src.dir}">
1295-
<include name="org/bouncycastle/openpgp/**/test/*.java" />
12961280
<include name="org/bouncycastle/gpg/**/test/*.java" />
12971281
<include name="org/bouncycastle/bcpg/**/test/*.java" />
12981282
<include name="org/bouncycastle/apache/**/*.html" />
@@ -1309,7 +1293,7 @@
13091293
<package name="org.bouncycastle.bcpg.*" />
13101294
<group title="BCPG Support Packages" packages="org.bouncycastle.bcpg*" />
13111295
<group title="OpenPGP Packages" packages="org.bouncycastle.gpg,org.bouncycastle.gpg.keybox,org.bouncycastle.openpgp*" />
1312-
<group title="OpenPGP Test and Example Packages" packages="org.bouncycastle.gpg.test,org.bouncycastle.openpgp.test*,org.bouncycastle.openpgp.examples*" />
1296+
<group title="OpenPGP Test and Example Packages" packages="org.bouncycastle.openpgp.examples*" />
13131297
</docElements>
13141298
</compile-doc>
13151299

@@ -1324,9 +1308,6 @@
13241308
<target name="javadoc-lw" depends="initMacros">
13251309
<copy todir="${lcrypto.target.src.dir}">
13261310
<fileset dir="${src.dir}">
1327-
<include name="org/bouncycastle/crypto/**/test/*.java" />
1328-
<include name="org/bouncycastle/crypto/**/test/cavp/*.java" />
1329-
<include name="org/bouncycastle/asn1/**/test/*.java" />
13301311
<include name="org/bouncycastle/crypto/**/*.html" />
13311312
<include name="org/bouncycastle/math/**/*.html" />
13321313
<include name="org/bouncycastle/asn1/**/*.html" />
@@ -1347,7 +1328,6 @@
13471328
<group title="Lightweight Crypto Packages" packages="org.bouncycastle.crypto*" />
13481329
<group title="ASN.1 Support Packages" packages="org.bouncycastle.asn1*" />
13491330
<group title="Utility Packages" packages="org.bouncycastle.util*:org.bouncycastle.math*" />
1350-
<group title="Test Packages" packages="org.bouncycastle.crypto.test*,org.bouncycastle.util.utiltest,org.bouncycastle.asn1.test*,org.bouncycastle.util.encoders.test*,org.bouncycastle.util.io.test*,org.bouncycastle.util.io.pem.test*,org.bouncycastle.math.ec.test*,org.bouncycastle.crypto.ec.test*,org.bouncycastle.crypto.prng.test*,org.bouncycastle.crypto.tls.test*,org.bouncycastle.crypto.agreement.test*" />
13511331
<group title="Post-Quantum Lightweight Crypto Packages" packages="org.bouncycastle.pqc.crypto*" />
13521332
<group title="Post-Quantum Lightweight Math Packages" packages="org.bouncycastle.pqc.math*" />
13531333
<group title="Post-Quantum ASN.1 Packages" packages="org.bouncycastle.pqc.asn1*" />
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package org.bouncycastle.test;
2+
3+
import java.io.File;
4+
import java.io.FileInputStream;
5+
import java.io.FileNotFoundException;
6+
import java.io.InputStream;
7+
8+
public class TestResourceFinder
9+
{
10+
private static final String dataDirName = "bc-test-data";
11+
12+
/**
13+
* We search starting at the working directory looking for the bc-test-data directory.
14+
*
15+
* @throws FileNotFoundException
16+
*/
17+
public static InputStream findTestResource(String homeDir, String fileName)
18+
throws FileNotFoundException
19+
{
20+
String wrkDirName = System.getProperty("user.dir");
21+
String separator = System.getProperty("file.separator");
22+
File wrkDir = new File(wrkDirName);
23+
File dataDir = new File(wrkDir, dataDirName);
24+
while (!dataDir.exists() && wrkDirName.length() > 1)
25+
{
26+
wrkDirName = wrkDirName.substring(0, wrkDirName.lastIndexOf(separator));
27+
wrkDir = new File(wrkDirName);
28+
dataDir = new File(wrkDir, dataDirName);
29+
}
30+
31+
if (!dataDir.exists())
32+
{
33+
String ln = System.getProperty("line.separator");
34+
throw new FileNotFoundException("Test data directory " + dataDirName + " not found." + ln + "Test data available from: https://github.com/bcgit/bc-test-data.git");
35+
}
36+
37+
homeDir = homeDir.replaceAll("/", separator);
38+
return new FileInputStream(new File(dataDir, homeDir + separator + fileName));
39+
}
40+
}

0 commit comments

Comments
 (0)