Ticket #33673: libpqxx-test.2.diff
File libpqxx-test.2.diff, 2.1 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 testdb test_libpqxx 80 set testport 5455 81 test.run yes 65 82 test.cmd make 66 83 test.target check 67 84 85 # PGDATABASE (name of database; defaults to your user name) 86 # PGHOST (database server; defaults to local machine) 87 # PGPORT (PostgreSQL port to connect to; default is 5432) 88 # PGUSER (your PostgreSQL user ID; defaults to your login name) 89 # PGPASSWORD (your PostgreSQL password, if needed) 90 test.env PGDATABASE=${testdb} \ 91 PGPORT=${testport} 92 #PGUSER 93 #PGPASSWORD 94 68 95 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 96 system -W ${worksrcpath} "${prefix}/lib/${server}/bin/initdb -D ${testdb}" 97 # "system" doesn't return for some reason, but exec does 98 if {[catch {exec sudo -u ${macportsuser} ${prefix}/lib/${server}/bin/pg_ctl -w -D ${worksrcpath}/${testdb} -l ${worksrcpath}/${testdb}/logfile -o "-p ${testport}" start} result]} { 99 return -code error "could not start postgresql server: ${result}" 100 } 83 101 } 84 102 85 103 post-test { 86 system "pg_ctl -w -D ${worksrcdir}/test_libpqxx stop -m fast" 87 system "rm -rf ${worksrcdir}/test_libpqxx" 104 system -W ${worksrcpath} "${prefix}/lib/${server}/bin/pg_ctl -w -D ${testdb} stop -m fast" 88 105 } 89