Skip to content

Commit

Permalink
Improve postgresql-odbc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Oct 14, 2023
1 parent e0539f0 commit f2f0c95
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/postgresql-odbc/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

################################################################################

template="postgresql-odbc.template"

################################################################################

main() {
local pg

for pg in 10 11 12 13 14 15 16 ; do
generate "$pg"
done
}

generate() {
local pg="$1"
local output

output="postgresql${pg}-odbc.recipe"

cat "$template" > "$output"
sed -i "s/%PG_VERSION%/$pg/g" "$output"

echo "$output (PostgreSQL $pg)"
}

################################################################################

main "$@"
27 changes: 27 additions & 0 deletions tests/postgresql-odbc/postgresql-odbc.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Bibop recipe for ODBC driver for PostgreSQL %PG_VERSION%
# See more: https://kaos.sh/bibop

pkg postgresql%PG_VERSION%-odbc

fast-finish yes

var pg_ver %PG_VERSION%
var pg_dir /usr/pgsql-{pg_ver}
var pg_lib {pg_dir}/lib

command "-" "Check shared libraries"
exist {pg_lib}/psqlodbc.so
exist {pg_lib}/psqlodbca.so
exist {pg_lib}/psqlodbcw.so

mode {pg_lib}/psqlodbca.so 755
mode {pg_lib}/psqlodbcw.so 755

link {LIBDIR}/psqlodbc.so {pg_lib}/psqlodbcw.so
link {LIBDIR}/psqlodbca.so {pg_lib}/psqlodbca.so
link {LIBDIR}/psqlodbcw.so {pg_lib}/psqlodbcw.so

lib-linked {pg_lib}/psqlodbca.so libpq.so.*
lib-linked {pg_lib}/psqlodbca.so libodbcinst.so.*
lib-linked {pg_lib}/psqlodbcw.so libpq.so.*
lib-linked {pg_lib}/psqlodbcw.so libodbcinst.so.*
2 changes: 2 additions & 0 deletions tests/postgresql-odbc/postgresql10-odbc.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

pkg postgresql10-odbc

fast-finish yes

var pg_ver 10
var pg_dir /usr/pgsql-{pg_ver}
var pg_lib {pg_dir}/lib
Expand Down
2 changes: 2 additions & 0 deletions tests/postgresql-odbc/postgresql11-odbc.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

pkg postgresql11-odbc

fast-finish yes

var pg_ver 11
var pg_dir /usr/pgsql-{pg_ver}
var pg_lib {pg_dir}/lib
Expand Down
2 changes: 2 additions & 0 deletions tests/postgresql-odbc/postgresql12-odbc.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

pkg postgresql12-odbc

fast-finish yes

var pg_ver 12
var pg_dir /usr/pgsql-{pg_ver}
var pg_lib {pg_dir}/lib
Expand Down
2 changes: 2 additions & 0 deletions tests/postgresql-odbc/postgresql13-odbc.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

pkg postgresql13-odbc

fast-finish yes

var pg_ver 13
var pg_dir /usr/pgsql-{pg_ver}
var pg_lib {pg_dir}/lib
Expand Down
2 changes: 2 additions & 0 deletions tests/postgresql-odbc/postgresql14-odbc.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

pkg postgresql14-odbc

fast-finish yes

var pg_ver 14
var pg_dir /usr/pgsql-{pg_ver}
var pg_lib {pg_dir}/lib
Expand Down
2 changes: 2 additions & 0 deletions tests/postgresql-odbc/postgresql15-odbc.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

pkg postgresql15-odbc

fast-finish yes

var pg_ver 15
var pg_dir /usr/pgsql-{pg_ver}
var pg_lib {pg_dir}/lib
Expand Down
27 changes: 27 additions & 0 deletions tests/postgresql-odbc/postgresql16-odbc.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Bibop recipe for ODBC driver for PostgreSQL 16
# See more: https://kaos.sh/bibop

pkg postgresql16-odbc

fast-finish yes

var pg_ver 16
var pg_dir /usr/pgsql-{pg_ver}
var pg_lib {pg_dir}/lib

command "-" "Check shared libraries"
exist {pg_lib}/psqlodbc.so
exist {pg_lib}/psqlodbca.so
exist {pg_lib}/psqlodbcw.so

mode {pg_lib}/psqlodbca.so 755
mode {pg_lib}/psqlodbcw.so 755

link {LIBDIR}/psqlodbc.so {pg_lib}/psqlodbcw.so
link {LIBDIR}/psqlodbca.so {pg_lib}/psqlodbca.so
link {LIBDIR}/psqlodbcw.so {pg_lib}/psqlodbcw.so

lib-linked {pg_lib}/psqlodbca.so libpq.so.*
lib-linked {pg_lib}/psqlodbca.so libodbcinst.so.*
lib-linked {pg_lib}/psqlodbcw.so libpq.so.*
lib-linked {pg_lib}/psqlodbcw.so libodbcinst.so.*

0 comments on commit f2f0c95

Please sign in to comment.