File: update_fixtures.sh

package info (click to toggle)
python-plugwise 1.7.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,072 kB
  • sloc: xml: 90,058; python: 5,265; sh: 324; makefile: 2
file content (22 lines) | stat: -rwxr-xr-x 909 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
set -eu

# Fixtures consumed by plugwise-beta
test_fixtures="adam_multiple_devices_per_zone m_adam_cooling m_adam_jip m_anna_heatpump_cooling p1v3_full_option stretch_v31 anna_heatpump_heating m_adam_heating m_anna_heatpump_idle p1v4_442_triple"

target="../plugwise-beta"
if [ $# -eq 1 ]; then
  target="${1}"
fi

# If plugwise-beta is relative to this repository, check if files differ and update accordingly
if [ -d "${target}" ]; then
  for fixture in ${test_fixtures}; do
    echo "Checking fixture ${fixture}: "
    diff -qr "fixtures/${fixture}" "${target}/tests/components/plugwise/fixtures/${fixture}" > /dev/null && continue
    echo " - Out-of-date ... updating fixture in ${target}"
    if [ -d "${target}/tests/components/plugwise/fixtures/${fixture}" ]; then
      cp -pfr fixtures/"${fixture}"/* "${target}"/tests/components/plugwise/fixtures/"${fixture}"/
    fi
  done
fi