aboutsummaryrefslogtreecommitdiff
path: root/test/run.sh
blob: 7da9443eceb423c17df400cecae3f8279d931a38 (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
#!/bin/bash

set -e

usage() {
  cat <<USAGE
Usage: $0 [pattern] [args]
Examples 
$0 pyls
$0 "pyls|kotlin"
$0 bash start
USAGE
}

if [ $# == 0 ]; then
  usage
  exit 1
fi

test_installer() {
  set -e
  "./installer/install-$1.sh"
  ./test/send.py | "./servers/$1/$1" $2
  ret="$?"
  printf "\n\nresult=%s" $ret
}
export -f test_installer

jq ".[][].command" -r -c <./settings.json | sort | uniq |
  grep -E "$1" |
  xargs -I% bash -c "test_installer % $2"