aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore12
-rw-r--r--Makefile8
-rw-r--r--lib/test/Makefile4
-rw-r--r--src/Makefile (renamed from lib/src/Makefile)3
-rw-r--r--src/TODO.org (renamed from lib/src/TODO.org)0
-rw-r--r--src/io.c (renamed from lib/src/io.c)0
-rw-r--r--src/io.h (renamed from lib/src/io.h)0
-rw-r--r--src/log.c (renamed from lib/src/log.c)0
-rw-r--r--src/log.h (renamed from lib/src/log.h)0
-rw-r--r--src/msg.c (renamed from lib/src/msg.c)0
-rw-r--r--src/msg.h (renamed from lib/src/msg.h)0
-rw-r--r--src/mysqlerl.app (renamed from lib/src/mysqlerl.app)0
-rw-r--r--src/mysqlerl.c (renamed from lib/src/mysqlerl.c)0
-rw-r--r--src/mysqlerl.erl (renamed from lib/src/mysqlerl.erl)0
-rw-r--r--src/mysqlerl.hrl (renamed from lib/src/mysqlerl.hrl)0
-rw-r--r--src/mysqlerl_app.erl (renamed from lib/src/mysqlerl_app.erl)0
-rw-r--r--src/mysqlerl_connection.erl (renamed from lib/src/mysqlerl_connection.erl)0
-rw-r--r--src/mysqlerl_connection_sup.erl (renamed from lib/src/mysqlerl_connection_sup.erl)0
-rw-r--r--src/mysqlerl_port.erl (renamed from lib/src/mysqlerl_port.erl)0
-rw-r--r--src/mysqlerl_port.hrl (renamed from lib/src/mysqlerl_port.hrl)0
-rw-r--r--src/mysqlerl_port_sup.erl (renamed from lib/src/mysqlerl_port_sup.erl)0
-rw-r--r--src/mysqlerl_sup.erl (renamed from lib/src/mysqlerl_sup.erl)0
-rw-r--r--test/Makefile4
-rw-r--r--test/database.conf (renamed from lib/test/database.conf)0
-rw-r--r--test/mysqlerl_SUITE.erl (renamed from lib/test/mysqlerl_SUITE.erl)11
-rw-r--r--test/mysqlerl_app_SUITE.erl (renamed from lib/test/mysqlerl_app_SUITE.erl)0
26 files changed, 23 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 7cd6bb1..00373e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,9 +2,9 @@
*~
*.o
*.beam
-lib/ebin/*
-lib/priv/*
-lib/test/*.html
-lib/test/*.css
-lib/test/ct_run.*
-lib/test/variables-ct*
+ebin/*
+priv/*
+test/*.html
+test/*.css
+test/ct_run.*
+test/variables-ct*
diff --git a/Makefile b/Makefile
index f431ef2..83a9166 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
.PHONY: all install test
all:
- @@cd lib/src && make all
+ @@cd src && make all
install:
- @@cd lib/src && make install
+ @@cd src && make install
-test:
- @@cd lib/test && make test
+test: all
+ @@cd test && make test
diff --git a/lib/test/Makefile b/lib/test/Makefile
deleted file mode 100644
index b4fac05..0000000
--- a/lib/test/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-.PHONY: test
-
-test:
- ct_run -pa ../ebin -dir . -config database.conf
diff --git a/lib/src/Makefile b/src/Makefile
index 3a1510b..4782487 100644
--- a/lib/src/Makefile
+++ b/src/Makefile
@@ -6,7 +6,8 @@ ERLLIBS = -L$(ERLPREFIX)/lib/erlang/lib/$(ERLINTERFACE)/lib \
MYSQLPREFIX = /usr/local/mysql
MYSQLINCS = -I$(MYSQLPREFIX)/include
-MYSQLLIBS = -L$(MYSQLPREFIX)/lib -lmysqlclient
+#MYSQLLIBS = -L$(MYSQLPREFIX)/lib -lmysqlclient
+MYSQLLIBS = $(MYSQLPREFIX)/lib/libmysqlclient.a
CFLAGS = -g -Wall -Werror $(MYSQLINCS) $(ERLINCS)
LDFLAGS = $(MYSQLLIBS) $(ERLLIBS)
diff --git a/lib/src/TODO.org b/src/TODO.org
index 636f47d..636f47d 100644
--- a/lib/src/TODO.org
+++ b/src/TODO.org
diff --git a/lib/src/io.c b/src/io.c
index dcc055f..dcc055f 100644
--- a/lib/src/io.c
+++ b/src/io.c
diff --git a/lib/src/io.h b/src/io.h
index bf4e086..bf4e086 100644
--- a/lib/src/io.h
+++ b/src/io.h
diff --git a/lib/src/log.c b/src/log.c
index 80aa755..80aa755 100644
--- a/lib/src/log.c
+++ b/src/log.c
diff --git a/lib/src/log.h b/src/log.h
index ae9a9bd..ae9a9bd 100644
--- a/lib/src/log.h
+++ b/src/log.h
diff --git a/lib/src/msg.c b/src/msg.c
index 00a5a6a..00a5a6a 100644
--- a/lib/src/msg.c
+++ b/src/msg.c
diff --git a/lib/src/msg.h b/src/msg.h
index 6db2aa8..6db2aa8 100644
--- a/lib/src/msg.h
+++ b/src/msg.h
diff --git a/lib/src/mysqlerl.app b/src/mysqlerl.app
index 5687463..5687463 100644
--- a/lib/src/mysqlerl.app
+++ b/src/mysqlerl.app
diff --git a/lib/src/mysqlerl.c b/src/mysqlerl.c
index 020d9eb..020d9eb 100644
--- a/lib/src/mysqlerl.c
+++ b/src/mysqlerl.c
diff --git a/lib/src/mysqlerl.erl b/src/mysqlerl.erl
index 946e9c5..946e9c5 100644
--- a/lib/src/mysqlerl.erl
+++ b/src/mysqlerl.erl
diff --git a/lib/src/mysqlerl.hrl b/src/mysqlerl.hrl
index 99e674f..99e674f 100644
--- a/lib/src/mysqlerl.hrl
+++ b/src/mysqlerl.hrl
diff --git a/lib/src/mysqlerl_app.erl b/src/mysqlerl_app.erl
index cdb8ade..cdb8ade 100644
--- a/lib/src/mysqlerl_app.erl
+++ b/src/mysqlerl_app.erl
diff --git a/lib/src/mysqlerl_connection.erl b/src/mysqlerl_connection.erl
index 1a3d900..1a3d900 100644
--- a/lib/src/mysqlerl_connection.erl
+++ b/src/mysqlerl_connection.erl
diff --git a/lib/src/mysqlerl_connection_sup.erl b/src/mysqlerl_connection_sup.erl
index 6e1632a..6e1632a 100644
--- a/lib/src/mysqlerl_connection_sup.erl
+++ b/src/mysqlerl_connection_sup.erl
diff --git a/lib/src/mysqlerl_port.erl b/src/mysqlerl_port.erl
index 74fe177..74fe177 100644
--- a/lib/src/mysqlerl_port.erl
+++ b/src/mysqlerl_port.erl
diff --git a/lib/src/mysqlerl_port.hrl b/src/mysqlerl_port.hrl
index a7a3300..a7a3300 100644
--- a/lib/src/mysqlerl_port.hrl
+++ b/src/mysqlerl_port.hrl
diff --git a/lib/src/mysqlerl_port_sup.erl b/src/mysqlerl_port_sup.erl
index 3053cdc..3053cdc 100644
--- a/lib/src/mysqlerl_port_sup.erl
+++ b/src/mysqlerl_port_sup.erl
diff --git a/lib/src/mysqlerl_sup.erl b/src/mysqlerl_sup.erl
index 1ebfbf2..1ebfbf2 100644
--- a/lib/src/mysqlerl_sup.erl
+++ b/src/mysqlerl_sup.erl
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..269204d
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,4 @@
+.PHONY: test
+
+test:
+ ct_run -pa -dir . -config database.conf
diff --git a/lib/test/database.conf b/test/database.conf
index 61b208d..61b208d 100644
--- a/lib/test/database.conf
+++ b/test/database.conf
diff --git a/lib/test/mysqlerl_SUITE.erl b/test/mysqlerl_SUITE.erl
index 28a8bef..bcce236 100644
--- a/lib/test/mysqlerl_SUITE.erl
+++ b/test/mysqlerl_SUITE.erl
@@ -39,7 +39,7 @@ init_per_suite(Config) ->
%% @end
%%--------------------------------------------------------------------
end_per_suite(_Config) ->
- ok = application:start(mysqlerl),
+ ok = application:stop(mysqlerl),
os:cmd("mysqladmin -uroot drop mysqlerl_test"),
ok.
@@ -128,6 +128,9 @@ app_starts(_Config) ->
app_stops(_Config) ->
ok = application:start(mysqlerl).
-connect(_Config) ->
- ok = mysqlerl:connect("localhost", undefined, "mysqlerl_test", "root",
- undefined, []).
+connect(Config) ->
+ DBInfo = ct:get_config(db_info),
+ ok = mysqlerl:connect(?config(host, DBInfo), ?config(port, DBInfo),
+ ?config(name, DBInfo), ?config(username, DBInfo),
+ ?config(password, DBInfo), ?config(options, DBInfo)),
+ {comment, "Connected successfully"}.
diff --git a/lib/test/mysqlerl_app_SUITE.erl b/test/mysqlerl_app_SUITE.erl
index 9ea4b76..9ea4b76 100644
--- a/lib/test/mysqlerl_app_SUITE.erl
+++ b/test/mysqlerl_app_SUITE.erl