aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-11-02 23:11:29 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-11-21 13:51:37 +0300
commitb1471ebbe9db90c472ff356bea6a7c8aedb45db9 (patch)
treea3494b3c2ca9a3529588c4da6e52d9040722a404 /tests
parent4bce3c574df293415c7b2f45b9c2951262fe3412 (diff)
Add implementation
Diffstat (limited to 'tests')
-rw-r--r--tests/.gitignore3
-rw-r--r--tests/basic/buildfile7
-rw-r--r--tests/basic/driver.c23
-rw-r--r--tests/basic/testscript5
-rw-r--r--tests/build/.gitignore1
-rw-r--r--tests/build/bootstrap.build9
-rw-r--r--tests/build/root.build20
-rw-r--r--tests/buildfile5
8 files changed, 73 insertions, 0 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..2e508a9
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1,3 @@
+driver
+test/
+test-*/
diff --git a/tests/basic/buildfile b/tests/basic/buildfile
new file mode 100644
index 0000000..4c93d2e
--- /dev/null
+++ b/tests/basic/buildfile
@@ -0,0 +1,7 @@
+# file : tests/basic/buildfile
+# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC
+# license : GPLv2 with FOSS License Exception; see accompanying COPYING file
+
+import libs = libmysqlclient%lib{mysqlclient}
+
+exe{driver}: {h c}{*} $libs test{testscript}
diff --git a/tests/basic/driver.c b/tests/basic/driver.c
new file mode 100644
index 0000000..267f206
--- /dev/null
+++ b/tests/basic/driver.c
@@ -0,0 +1,23 @@
+/*
+ * file : tests/basic/driver.c
+ * copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC
+ * license : GPLv2 with FOSS License Exception; see accompanying COPYING file
+ */
+
+#include <stdio.h>
+
+#include <mysql/mysql.h>
+
+int
+main ()
+{
+ if (mysql_library_init (0, NULL, NULL))
+ {
+ fprintf (stderr, "failed to initialize\n");
+ return 1;
+ }
+
+ printf ("libmysqlclient version: %s\n", mysql_get_client_info ());
+ mysql_library_end ();
+ return 0;
+}
diff --git a/tests/basic/testscript b/tests/basic/testscript
new file mode 100644
index 0000000..efd768e
--- /dev/null
+++ b/tests/basic/testscript
@@ -0,0 +1,5 @@
+# file : tests/basic/testscript
+# copyright : Copyright (c) 2016-2017 Code Synthesis Ltd
+# license : GPLv2 with FOSS License Exception; see accompanying COPYING file
+
+$* >~'/libmysqlclient version: \d*.\d*.\d*(-.*)?/'
diff --git a/tests/build/.gitignore b/tests/build/.gitignore
new file mode 100644
index 0000000..225c27f
--- /dev/null
+++ b/tests/build/.gitignore
@@ -0,0 +1 @@
+config.build
diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build
new file mode 100644
index 0000000..d0577fd
--- /dev/null
+++ b/tests/build/bootstrap.build
@@ -0,0 +1,9 @@
+# file : tests/build/bootstrap.build
+# copyright : Copyright (c) 2016-2017 Code Synthesis Ltd
+# license : GPLv2 with FOSS License Exception; see accompanying COPYING file
+
+project = # Unnamed subproject.
+
+using config
+using dist
+using test
diff --git a/tests/build/root.build b/tests/build/root.build
new file mode 100644
index 0000000..5c785b1
--- /dev/null
+++ b/tests/build/root.build
@@ -0,0 +1,20 @@
+# file : tests/build/root.build
+# copyright : Copyright (c) 2016-2017 Code Synthesis Ltd
+# license : GPLv2 with FOSS License Exception; see accompanying COPYING file
+
+# It would be good to make sure that libmysqlclient headers comply with an
+# oldest C standard, but that's not the case. They use C++-style comments, so
+# we don't specify any C standard.
+#
+using c
+
+h{*}: extension = h
+c{*}: extension = c
+
+# Every exe{} in this subproject is by default a test.
+#
+exe{*}: test = true
+
+# Specify the test target for cross-testing.
+#
+test.target = $c.target
diff --git a/tests/buildfile b/tests/buildfile
new file mode 100644
index 0000000..d6154dd
--- /dev/null
+++ b/tests/buildfile
@@ -0,0 +1,5 @@
+# file : tests/buildfile
+# copyright : Copyright (c) 2016-2017 Code Synthesis Ltd
+# license : GPLv2 with FOSS License Exception; see accompanying COPYING file
+
+./: {*/ -build/}