summaryrefslogtreecommitdiff
path: root/odb-tests/evolution/version/testscript
blob: 1a41b2d0ce3c3a76ed8046eb0b5cddb8da8f48f8 (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
# file      : evolution/version/testscript
# license   : GNU GPL v2; see accompanying LICENSE file

.include ../../database-options.testscript
.include ../../$db-schema.testscript

test.arguments += $($(db)_options)

: basics
:
if! $sqlite
{
  ss =; # Schema modification base file names.

  # Drop everything.
  #
  for s: $schemas
    ss =+ $s
  end;

  # Add base schema.
  #
  ss += test3-002-pre test3-002-post;

  # Add migration.
  #
  ss += test3-003-pre test3-003-post;

  # Run tests.
  #
  for s: $ss
    f = $out_base/"$s".sql

    if $mysql
      cat $f | $create_schema_cmd
    elif $pgsql
      $create_schema_cmd -f $f
    end

    if ($s == 'test3-002-post')
      $* 1
    elif ($s == 'test3-003-pre')
      $* 2
    elif ($s == 'test3-003-post')
      $* 3
    end
  end
}
else
{
  $* 1 &odb-test.db;
  $* 2;
  $* 3
}