summaryrefslogtreecommitdiff
path: root/test/windows/odb/all
blob: e4a5532a3dc023fd69fa2bb8ae2781261dcdd561 (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
#! /usr/bin/env bash

trap 'exit 1' ERR

function error ()
{
  echo "$*" 1>&2
}

function usage ()
{
  error "usage: $0 vc-version database conf plat [action]"
  error "  valid configurations are: {Debug,Release}|all"
  error "  valid platforms are: {Win32,x64}|all"
  error "  valid actions are: /Build (default), /Clean, and /Rebuild"
}

if [ "$1" = "" ]; then
  error vc version expected
  usage
  exit 1
fi

if [ "$2" = "" ]; then
  error database expected
  usage
  exit 1
else
  if [ "$2" = "all" ]; then
    databases="mssql oracle pgsql sqlite mysql"
  else
    databases=$2
  fi
fi

if [ "$3" = "" ]; then
  error configuration expected
  usage
  exit 1
fi

if [ "$4" = "" ]; then
  error platform expected
  usage
  exit 1
fi

action=$5
if [ "$action" == "" ]; then
  action=/Build
fi

for d in $databases; do
  cmd.exe /C setenv.bat "$1" build.bat "$d" "$1" "$3" "$4" "$action"
  cd odb-tests-$d
  cmd.exe /C ..\\setenv.bat "$1" test.bat "$d"
  cd ..
  cd odb-examples-$d
  cmd.exe /C ..\\setenv.bat "$1" test.bat "$d"
  cd ..
done