summaryrefslogtreecommitdiffstats
path: root/lang/erlang/test-version.sh
blob: 5e739f52c392269c26cb74b9b0cd14d640141ffb (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
# erl -version prints ERTS version, not OTP release — use system_info instead
case "$1" in
erlang)
	otp_major="${2%%.*}"
	timeout 60s erl -noshell \
		-eval "V = erlang:system_info(otp_release), io:format(\"OTP ~s~n\", [V])" \
		-s init stop 2>&1 | \
		grep -qF "OTP ${otp_major}"
	;;
esac