Ticket #33673: libpqxx-test.3.diff
File libpqxx-test.3.diff, 2.2 KB (added by ryandesign (Ryan Carsten Schmidt), 13 years ago) |
---|
-
Portfile
61 76 # http://pqxx.org/development/libpqxx/browser/trunk/README?rev=latest 62 77 # http://pqxx.org/development/libpqxx/wiki/TestDocs 63 78 64 test.run no 79 set dbdir ${workpath}/db 80 set dbname test_libpqxx 81 set dbport 5455 82 test.run yes 65 83 test.cmd make 66 84 test.target check 85 test.post_args [portbuild::build_getjobsarg] 67 86 87 # PGDATABASE (name of database; defaults to your user name) 88 # PGHOST (database server; defaults to local machine) 89 # PGPORT (PostgreSQL port to connect to; default is 5432) 90 # PGUSER (your PostgreSQL user ID; defaults to your login name) 91 # PGPASSWORD (your PostgreSQL password, if needed) 92 test.env PGDATABASE=${dbname} \ 93 PGPORT=${dbport} 94 #PGUSER 95 #PGPASSWORD 96 68 97 pre-test { 69 system "initdb -D ${worksrcdir}/test_libpqxx" 70 system "pg_ctl -w -D ${worksrcdir}/test_libpqxx -l ${worksrcdir}/test_libpqxx/logfile -o \"-p 5455\" start" 71 # test for existence of ${worksrcdir}/test_libpqxx/postmaster.pid to indicate success 72 73 # PGDATABASE (name of database; defaults to your user name) 74 # PGHOST (database server; defaults to local machine) 75 # PGPORT (PostgreSQL port to connect to; default is 5432) 76 # PGUSER (your PostgreSQL user ID; defaults to your login name) 77 # PGPASSWORD (your PostgreSQL password, if needed) 78 test.env-append \ 79 PGDATABASE=${worksrcdir}/test_libpqxx \ 80 PGPORT=5455 81 #PGUSER 82 #PGPASSWORD 98 system "${prefix}/lib/${server}/bin/initdb -D ${dbdir}" 99 # "system" doesn't return for some reason, but exec does 100 if {[catch {exec sudo -u ${macportsuser} ${prefix}/lib/${server}/bin/pg_ctl -w -D ${dbdir} -l ${dbdir}/logfile -o "-p ${dbport}" start} result]} { 101 return -code error "could not start postgresql server" 102 } 103 system "${prefix}/lib/${server}/bin/createdb -p ${dbport} ${dbname}" 83 104 } 84 105 85 106 post-test { 86 system "pg_ctl -w -D ${worksrcdir}/test_libpqxx stop -m fast" 87 system "rm -rf ${worksrcdir}/test_libpqxx" 107 system "${prefix}/lib/${server}/bin/pg_ctl -w -D ${dbdir} stop -m fast" 88 108 } 89