forked from bcgit/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_test_prov.sh
94 lines (69 loc) · 2.79 KB
/
mod_test_prov.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
if ! [ -x "$(command -v openjdk_11)" ]; then
JAVA_11=/usr/lib/jvm/java-11-openjdk-amd64
else
JAVA_11=`openjdk_11`
fi
export JAVA_HOME=$JAVA_11
artifactsHome=build/artifacts/jdk1.8/jars
tj=( $artifactsHome/bctest-jdk18on-*.jar )
testJar="${tj[0]}";
rm -rf mtest
mkdir mtest
cp $artifactsHome/*.jar mtest/
rm mtest/bcjmail-*
rm mtest/bcprov-ext-*
rm mtest/bctest-*
for j in mtest/*.jar; do
jar -tf $j | grep module-info\.class >> /dev/null
if [[ $? != 0 ]]; then
echo "$j is missing module-info"
exit 1;
else
echo "$j is has module-info"
fi
done
a=(`$JAVA_HOME/bin/jar -tf "$testJar" | grep -E "AllTests\.class" | sed -e 's!.class!!' | sed -e 's|/|.|g'`);
echo $testJar
for i in "${a[@]}"
do
echo $i
case $i in org\.bouncycastle\.pqc\.legacy\.*)
echo "skipping $i"
continue
esac
$JAVA_HOME/bin/java --module-path ./mtest/ \
--add-modules org.bouncycastle.mail \
--add-modules org.bouncycastle.pg \
--add-modules org.bouncycastle.pkix \
--add-modules org.bouncycastle.provider \
--add-modules org.bouncycastle.tls \
--add-modules org.bouncycastle.util \
--add-opens org.bouncycastle.provider/org.bouncycastle.jcajce.provider.symmetric=ALL-UNNAMED \
--add-opens org.bouncycastle.provider/org.bouncycastle.jcajce.provider.digest=ALL-UNNAMED \
--add-opens org.bouncycastle.util/org.bouncycastle.asn1.cmc=ALL-UNNAMED \
--add-opens org.bouncycastle.util/org.bouncycastle.oer.its.etsi102941.basetypes=ALL-UNNAMED \
--add-opens org.bouncycastle.util/org.bouncycastle.oer.its.etsi102941=ALL-UNNAMED \
--add-opens org.bouncycastle.util/org.bouncycastle.oer.its.ieee1609dot2dot1=ALL-UNNAMED \
--add-opens org.bouncycastle.util/org.bouncycastle.oer.its.etsi103097.extension=ALL-UNNAMED \
--add-opens org.bouncycastle.util/org.bouncycastle.oer.its.etsi103097=ALL-UNNAMED \
--add-opens org.bouncycastle.util/org.bouncycastle.oer.its.ieee1609dot2.basetypes=ALL-UNNAMED \
--add-opens org.bouncycastle.util/org.bouncycastle.oer.its.ieee1609dot2=ALL-UNNAMED \
--add-opens org.bouncycastle.pkix/org.bouncycastle.tsp=ALL-UNNAMED \
--add-reads org.bouncycastle.mail=ALL-UNNAMED \
--add-reads org.bouncycastle.provider=ALL-UNNAMED \
--add-exports org.bouncycastle.provider/org.bouncycastle.internal.asn1.cms=ALL-UNNAMED \
--add-exports org.bouncycastle.provider/org.bouncycastle.internal.asn1.bsi=ALL-UNNAMED \
--add-exports org.bouncycastle.provider/org.bouncycastle.internal.asn1.eac=ALL-UNNAMED \
-cp "$testJar:libs/junit.jar:libs/mail.jar:libs/activation.jar" \
-Dbc.test.data.home=core/src/test/data \
$i
if [[ $? != 0 ]]; then
echo ""
echo "--------------------------------!!!"
echo "$i failed"
exit 1;
fi
echo "-------------------------------------"
echo ""
done