File: run-all

package info (click to toggle)
elixir-lang 1.18.3.dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,436 kB
  • sloc: erlang: 11,996; sh: 324; makefile: 277
file content (73 lines) | stat: -rwxr-xr-x 1,577 bytes parent folder | download
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
#!/bin/bash

exec 2>&1
set -eE

banner() {
  echo
  echo "$@"
  echo "$@" | sed -e 's/./-/g'
  echo
}

cleanup() {
  rm  -f /usr/lib/elixir/{CHANGELOG.md,VERSION}
  rm  -f /usr/lib/elixir/lib/iex/mix.exs
  rm -rf /usr/lib/elixir/lib/elixir/src

  for lib in $(ls lib); do
    rm -rf "/usr/lib/elixir/lib/${lib}/lib" \
           "/usr/lib/elixir/lib/${lib}/test" \
           "/usr/lib/elixir/lib/${lib}/tmp"
  done

  epmd -kill || true
}

export HOME=/usr/lib/elixir/lib/elixir

# Calls the cleanup function on the following signals: SIGHUP, SIGINT, SIGQUIT
# and SIGABRT.
trap "cleanup && exit 130" 2
trap "cleanup" 1 3 6 ERR

epmd -daemon

failed=0

# The Elixir tests are very sensitive to the place they are located relatively
# to the elixir executable via which they are invoked. Moreover, the tests
# depend on some files which are parts of the source tree.

cp {CHANGELOG.md,VERSION} /usr/lib/elixir

cp lib/iex/mix.exs /usr/lib/elixir/lib/iex

cp -r lib/elixir/src /usr/lib/elixir/lib/elixir

mkdir -p /usr/lib/elixir/lib/mix/test/fixtures
cp /usr/bin/rebar3 /usr/lib/elixir/lib/mix/test/fixtures/rebar3

for lib in $(ls lib); do
  cp -r "lib/${lib}/lib" "lib/${lib}/test" "/usr/lib/elixir/lib/${lib}"
done

(
  banner stdlib
  cd /usr/lib/elixir/lib/elixir
  elixir -r "test/elixir/test_helper.exs" -pr "test/elixir/**/*_test.exs"
) || failed=1

for lib in $(ls -1 lib | grep -v elixir); do
  (
    banner $lib
    set -x
    cd "/usr/lib/elixir/lib/${lib}"
    elixir -r "test/test_helper.exs" -pr "test/**/*_test.exs"
  ) || failed=1
done

cleanup

exit $failed