summaryrefslogtreecommitdiff
path: root/odb-tests/common/changelog/testscript
blob: 60eadaebf79a195b39f4bbb75cfa779f465a8287 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# file      : common/changelog/testscript
# license   : GNU GPL v2; see accompanying LICENSE file

headers = [paths] $path_search($src_base/*.hxx)

odb_options = --generate-schema-only \
              --schema-format sql \
              --suppress-migration \
              --options-file $out_base/odb.options

: mysql
:
if $mysql
{
  odb_options += --database 'mysql' --changelog-dir $~

  for h: $headers
    n = $base($leaf($h))

    $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql

    $* $odb_options -DBVER=1 -DCVER=2 $h
    diff $src_base/$n-mysql-diff.xml $(n).xml

    $* $odb_options -DBVER=2 -DCVER=3 $h
    diff $src_base/$n-mysql-patch.xml $(n).xml
  end
}

: sqlite
:
if $sqlite
{
  odb_options += --database 'sqlite' --changelog-dir $~

  for h: $headers
    n = $base($leaf($h))

    $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql

    $* $odb_options -DBVER=1 -DCVER=2 $h
    diff $src_base/$n-sqlite-diff.xml $(n).xml

    $* $odb_options -DBVER=2 -DCVER=3 $h
    diff $src_base/$n-sqlite-patch.xml $(n).xml
  end
}

: pgsql
:
if $pgsql
{
  odb_options += --database 'pgsql' --changelog-dir $~

  for h: $headers
    n = $base($leaf($h))

    $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql

    $* $odb_options -DBVER=1 -DCVER=2 $h
    diff $src_base/$n-pgsql-diff.xml $(n).xml

    $* $odb_options -DBVER=2 -DCVER=3 $h
    diff $src_base/$n-pgsql-patch.xml $(n).xml
  end
}

: oracle
:
if $oracle
{
  odb_options += --database 'oracle' --changelog-dir $~

  for h: $headers
    n = $base($leaf($h))

    $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql

    $* $odb_options -DBVER=1 -DCVER=2 $h
    diff $src_base/$n-oracle-diff.xml $(n).xml

    $* $odb_options -DBVER=2 -DCVER=3 $h
    diff $src_base/$n-oracle-patch.xml $(n).xml
  end
}

: mssql
:
if $mssql
{
  odb_options += --database 'mssql' --changelog-dir $~

  for h: $headers
    n = $base($leaf($h))

    $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql

    $* $odb_options -DBVER=1 -DCVER=2 $h
    diff $src_base/$n-mssql-diff.xml $(n).xml

    $* $odb_options -DBVER=2 -DCVER=3 $h
    diff $src_base/$n-mssql-patch.xml $(n).xml
  end
}