forked from jhthorsen/json-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
36 lines (31 loc) · 847 Bytes
/
test.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
#!/bin/sh
# Usage:
# sh test.sh -j8
# PROJECT=json-validator sh test.sh -j8
# HASH_ITERATIONS=10 PROJECT=swagger2 sh test.sh -v t/plugin-yaml.t
# PERL_HASH_SEED=8 PROJECT=swagger2 sh test.sh -v t/plugin-yaml.t
export PERL5LIB=$PWD/lib;
# export SWAGGER2_DEBUG=1;
t () {
echo "\$ cd ../$PROJECT && prove -l $@";
cd ../$PROJECT && prove -l $@ || exit $?;
}
if [ -n "$PERL_HASH_SEED" ]; then
export PERL_PERTURB_KEYS=NO;
fi
HASH_ITERATIONS=${HASH_ITERATIONS:-0}
if [ $HASH_ITERATIONS -gt 0 ]; then
for i in $(seq 1 $HASH_ITERATIONS); do
export HASH_ITERATIONS=0;
export PERL_HASH_SEED=$i;
echo "\$ export PERL_HASH_SEED=$PERL_HASH_SEED";
sh $0 $@ || break
done
elif [ "x$PROJECT" != "x" ]; then
t $@;
else
PROJECT=json-validator t $@;
PROJECT=swagger2 t $@;
PROJECT=mojolicious-plugin-openapi t $@;
fi
exit $?;