aboutsummaryrefslogtreecommitdiff
path: root/database-options.testscript
blob: 2c0ee82c7483a7178aeff84a9f205aef2c6bc3d4 (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
# file      : database-options.testscript
# license   : GNU GPL v2; see accompanying LICENSE file

# For the enabled databases create the test driver option lists (*_options)
# for subsequent use in the tests. Also create the database-specific client
# option lists (*_client_options) and command lines (*_client_cmd) which can
# be used as a base for the data manipulation commands.
#
+if $mysql
   mysql_options = --user $config.odb_tests.pgsql.user \
                   --database $config.odb_tests.pgsql.database

   mysql_client_options = --user $config.odb_tests.pgsql.user \
                          --database $config.odb_tests.pgsql.database

   if $defined(config.odb_tests.mysql.passwd)
      mysql_options        += --password $config.odb_tests.mysql.passwd
      mysql_client_options += --password=$config.odb_tests.mysql.passwd
   end

   if $defined(config.odb_tests.mysql.host)
      mysql_options        += --host $config.odb_tests.mysql.host
      mysql_client_options += --host $config.odb_tests.mysql.host
   end

   if $defined(config.odb_tests.mysql.port)
      mysql_options        += --port $config.odb_tests.mysql.port
      mysql_client_options += --port $config.odb_tests.mysql.port
   end

   if $defined(config.odb_tests.mysql.socket)
      mysql_options        += --socket $config.odb_tests.mysql.socket
      mysql_client_options += --socket $config.odb_tests.mysql.socket
   end

   mysql_client_cmd = $path($mysql_client) $mysql_client_options
end

+if $sqlite
  sqlite_options = --database odb-test.db

  # Note that we currently don't manipulate the data using the sqlite3
  # utility. Thus, we don't create the sqlite client option list and command
  # line.
  #
end

+if $pgsql
   pgsql_options = --user $config.odb_tests.pgsql.user \
                   --database $config.odb_tests.pgsql.database

   pgsql_client_options = --quiet \
                          --set ON_ERROR_STOP=1 \
                          --username $config.odb_tests.pgsql.user \
                          --dbname $config.odb_tests.pgsql.database

  if $defined(config.odb_tests.pgsql.host)
    pgsql_options        += --host $config.odb_tests.pgsql.host
    pgsql_client_options += --host $config.odb_tests.pgsql.host
  end

  if $defined(config.odb_tests.pgsql.port)
    pgsql_options        += --port $config.odb_tests.pgsql.port
    pgsql_client_options += --port $config.odb_tests.pgsql.port
  end

  pgsql_client_cmd = $path($pgsql_client) $pgsql_client_options

  export PGOPTIONS=--client-min-messages=warning
end

# Set the default schema file name, which can be overridden by the subsequent
# tests in their own scopes.
#
schema = test