From 43d743e75b7b747341b9a5c36a933b490548bebb Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 4 Nov 2017 01:17:16 +0300 Subject: Add implementation --- tests/.gitignore | 3 +++ tests/basic/buildfile | 7 +++++++ tests/basic/driver.c | 23 +++++++++++++++++++++++ tests/basic/testscript | 5 +++++ tests/build/.gitignore | 1 + tests/build/bootstrap.build | 9 +++++++++ tests/build/root.build | 20 ++++++++++++++++++++ tests/buildfile | 5 +++++ 8 files changed, 73 insertions(+) create mode 100644 tests/.gitignore create mode 100644 tests/basic/buildfile create mode 100644 tests/basic/driver.c create mode 100644 tests/basic/testscript create mode 100644 tests/build/.gitignore create mode 100644 tests/build/bootstrap.build create mode 100644 tests/build/root.build create mode 100644 tests/buildfile (limited to 'tests') 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..5f6854e --- /dev/null +++ b/tests/basic/buildfile @@ -0,0 +1,7 @@ +# file : tests/basic/buildfile +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# license : LGPLv2.1; see accompanying COPYING file + +import libs = libmariadb%lib{mariadb} + +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..faac915 --- /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 : LGPLv2.1; see accompanying COPYING file + */ + +#include + +#include + +int +main () +{ + if (mysql_library_init (0, NULL, NULL)) + { + fprintf (stderr, "failed to initialize\n"); + return 1; + } + + printf ("libmariadb 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..637734d --- /dev/null +++ b/tests/basic/testscript @@ -0,0 +1,5 @@ +# file : tests/basic/testscript +# copyright : Copyright (c) 2016-2017 Code Synthesis Ltd +# license : LGPLv2.1; see accompanying COPYING file + +$* >~'/libmariadb 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..42383e5 --- /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 : LGPLv2.1; 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..5fa307f --- /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 : LGPLv2.1; see accompanying COPYING file + +# Make sure libmariadb headers comply with an oldest C standard. +# +c.std = 90 + +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..2acc100 --- /dev/null +++ b/tests/buildfile @@ -0,0 +1,5 @@ +# file : tests/buildfile +# copyright : Copyright (c) 2016-2017 Code Synthesis Ltd +# license : LGPLv2.1; see accompanying COPYING file + +./: {*/ -build/} -- cgit v1.1