blob: 482666d757b6b7c24373a72233ade5608b43aa69 (
plain)
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
|
#!/usr/bin/env bash
action() {
local OPTIND
local raku
while getopts ":p:" opt
do
case "$opt" in
p) RSTAR_PREFIX=$OPTARG ;;
*) emerg "Invalid option specified: $opt" ;;
esac
done
shift $(( OPTIND - 1 ))
raku="$RSTAR_PREFIX/bin/raku"
# Ensure raku is available
if [[ ! -f $raku ]]
then
emerg "No Raku executable available at $raku."
emerg "Make sure you ran the install command."
emerg "Also, if you installed with -p, you must specify it for test as well"
fi
# If no specific targets are specified, set all targets
if (( $# < 1 ))
then
set -- spectest modules
fi
# Run each test target
for target in "$@"
do
if [[ $(type -t "action_test_$target") != "function" ]]
then
crit "Test target '$target' is invalid"
continue
fi
"action_test_$target"
done
}
action_test_modules() {
local modules
local prove
modules="$(tmpfile)"
prove="$RSTAR_PREFIX/share/perl6/vendor/bin/prove6"
awk '/^[^#]/ {print $1}' "$BASEDIR/etc/modules.txt" > "$modules"
while read -r module
do
chgdir "$BASEDIR/src/rakudo-star-modules/$module"
"$prove" -v .
done < "$modules"
}
action_test_spectest() {
local destination
local source
destination="$(tmpdir)"
source="$BASEDIR/src/rakudo-$(config_etc_kv "dist_rakudo.txt" "version")"
notice "Using $destination as working directory"
# Grab the source files
cp -R -- "$source/." "$destination"
chgdir "$destination"
# Run the spectest
perl Configure.pl --prefix="$RSTAR_PREFIX"
make spectest
}
|