Browse Source

Merge remote-tracking branch 'github.wg/master' into async

Anton Lebedevich 13 years ago
parent
commit
c592716d33
3 changed files with 13 additions and 10 deletions
  1. 5 4
      Makefile
  2. 1 0
      README
  3. 7 6
      test_src/pgsql_tests.erl

+ 5 - 4
Makefile

@@ -1,12 +1,12 @@
 NAME		:= epgsql
-VERSION		:= 1.3
+VERSION		:= 1.4
 
 ERL  		:= erl
 ERLC 		:= erlc
 
 # ------------------------------------------------------------------------
 
-ERLC_FLAGS	:= -Wall -I include
+ERLC_FLAGS	:= -Wall -I include +debug_info
 
 SRC			:= $(wildcard src/*.erl)
 TESTS 		:= $(wildcard test_src/*.erl)
@@ -26,7 +26,8 @@ release: app
 	@tar czvf $(RELEASE) $(APPDIR)
 
 clean:
-	@rm -f ebin/*.{beam,app}
+	@rm -f ebin/*.beam
+	@rm -f ebin/$(NAME).app
 	@rm -rf $(NAME)-$(VERSION) $(NAME)-*.tar.gz
 
 test: $(TESTS:test_src/%.erl=test_ebin/%.beam) compile
@@ -41,7 +42,7 @@ test: $(TESTS:test_src/%.erl=test_ebin/%.beam) compile
 ebin/%.beam : src/%.erl
 	$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
 
-ebin/%.app : src/%.app.src
+ebin/%.app : src/%.app.src Makefile
 	sed -e s/VERSION/$(VERSION)/g $< > $@
 
 test_ebin/%.beam : test_src/%.erl

+ 1 - 0
README

@@ -102,6 +102,7 @@ Erlang PostgreSQL Database Client
   text        = <<"a">>
   varchar     = <<"a">>
   bytea       = <<1, 2>>
+  array       = [1, 2, 3]
 
   record      = {int2, time, text, ...} (decode only)
 

+ 7 - 6
test_src/pgsql_tests.erl

@@ -9,6 +9,8 @@
 -define(host, "localhost").
 -define(port, 5432).
 
+-define(ssl_apps, [crypto, public_key, ssl]).
+
 connect_test() ->
     connect_only([]).
 
@@ -52,7 +54,7 @@ connect_with_invalid_password_test() ->
 
 
 connect_with_ssl_test() ->
-    lists:foreach(fun application:start/1, [crypto, public_key, ssl]),
+    lists:foreach(fun application:start/1, ?ssl_apps),
     with_connection(
       fun(C) ->
               {ok, _Cols, [{true}]} = pgsql:equery(C, "select ssl_is_used()")
@@ -61,12 +63,11 @@ connect_with_ssl_test() ->
       [{ssl, true}]).
 
 connect_with_client_cert_test() ->
-    lists:foreach(fun application:start/1, [crypto, public_key, ssl]),
-
+    lists:foreach(fun application:start/1, ?ssl_apps),
     Dir = filename:join(filename:dirname(code:which(pgsql_tests)), "../test_data"),
     File = fun(Name) -> filename:join(Dir, Name) end,
-    {ok, CertBin} = file:read_file(File("epgsql.crt")),
-    [{'Certificate', Der, _}] = public_key:pem_decode(CertBin),
+    {ok, Pem} = file:read_file(File("epgsql.crt")),
+    [{'Certificate', Der, not_encrypted}] = public_key:pem_decode(Pem),
     Cert = public_key:pkix_decode_cert(Der, plain),
     #'TBSCertificate'{serialNumber = Serial} = Cert#'Certificate'.tbsCertificate,
     Serial2 = list_to_binary(integer_to_list(Serial)),
@@ -562,7 +563,7 @@ listen_notify_payload_test() ->
       [{async, self()}]).
 
 application_test() ->
-    lists:foreach(fun application:start/1, [crypto, ssl]),
+    lists:foreach(fun application:start/1, ?ssl_apps),
     ok = application:start(epgsql).
 
 %% -- run all tests --