From 19dc42649183b2e1cd37be1ca69145dafe1330a2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 3 May 2019 22:19:55 +0300 Subject: Add implementation --- libcmark-gfm/tests/.gitignore | 8 ++++++++ libcmark-gfm/tests/basic/buildfile | 7 +++++++ libcmark-gfm/tests/basic/driver.c | 28 ++++++++++++++++++++++++++++ libcmark-gfm/tests/basic/testscript | 5 +++++ libcmark-gfm/tests/build/.gitignore | 3 +++ libcmark-gfm/tests/build/bootstrap.build | 9 +++++++++ libcmark-gfm/tests/build/root.build | 16 ++++++++++++++++ libcmark-gfm/tests/buildfile | 5 +++++ 8 files changed, 81 insertions(+) create mode 100644 libcmark-gfm/tests/.gitignore create mode 100644 libcmark-gfm/tests/basic/buildfile create mode 100644 libcmark-gfm/tests/basic/driver.c create mode 100644 libcmark-gfm/tests/basic/testscript create mode 100644 libcmark-gfm/tests/build/.gitignore create mode 100644 libcmark-gfm/tests/build/bootstrap.build create mode 100644 libcmark-gfm/tests/build/root.build create mode 100644 libcmark-gfm/tests/buildfile (limited to 'libcmark-gfm/tests') diff --git a/libcmark-gfm/tests/.gitignore b/libcmark-gfm/tests/.gitignore new file mode 100644 index 0000000..662178d --- /dev/null +++ b/libcmark-gfm/tests/.gitignore @@ -0,0 +1,8 @@ +# Test executables. +# +driver + +# Testscript output directories (can be symlinks). +# +test +test-* diff --git a/libcmark-gfm/tests/basic/buildfile b/libcmark-gfm/tests/basic/buildfile new file mode 100644 index 0000000..3f72c2d --- /dev/null +++ b/libcmark-gfm/tests/basic/buildfile @@ -0,0 +1,7 @@ +# file : tests/basic/buildfile +# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd +# license : FreeBSD License; see accompanying COPYING file + +import libs = libcmark-gfm%lib{cmark-gfm} + +exe{driver}: {h c}{**} $libs testscript diff --git a/libcmark-gfm/tests/basic/driver.c b/libcmark-gfm/tests/basic/driver.c new file mode 100644 index 0000000..e38e03a --- /dev/null +++ b/libcmark-gfm/tests/basic/driver.c @@ -0,0 +1,28 @@ +/* + * file : tests/basic/driver.c + * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC + * license : FreeBSD License; see accompanying COPYING file + */ + +#include +#include +#include + +#include +#include + +int +main (int argc, const char* argv[]) +{ + assert (argc == 2); + + const char* from = argv[1]; + + char* to = cmark_markdown_to_html (from, + strlen (from), + CMARK_OPT_DEFAULT | + CMARK_OPT_VALIDATE_UTF8); + printf ("%s", to); + cmark_get_default_mem_allocator ()->free (to); + return 0; +} diff --git a/libcmark-gfm/tests/basic/testscript b/libcmark-gfm/tests/basic/testscript new file mode 100644 index 0000000..41b7d26 --- /dev/null +++ b/libcmark-gfm/tests/basic/testscript @@ -0,0 +1,5 @@ +# file : tests/basic/testscript +# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd +# license : FreeBSD License; see accompanying COPYING file + +$* 'Hello *world*' >'

Hello world

' diff --git a/libcmark-gfm/tests/build/.gitignore b/libcmark-gfm/tests/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/libcmark-gfm/tests/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/libcmark-gfm/tests/build/bootstrap.build b/libcmark-gfm/tests/build/bootstrap.build new file mode 100644 index 0000000..cb2b962 --- /dev/null +++ b/libcmark-gfm/tests/build/bootstrap.build @@ -0,0 +1,9 @@ +# file : tests/build/bootstrap.build +# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd +# license : FreeBSD License; see accompanying COPYING file + +project = # Unnamed tests subproject. + +using config +using test +using dist diff --git a/libcmark-gfm/tests/build/root.build b/libcmark-gfm/tests/build/root.build new file mode 100644 index 0000000..1a4dbbe --- /dev/null +++ b/libcmark-gfm/tests/build/root.build @@ -0,0 +1,16 @@ +# file : tests/build/root.build +# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd +# license : FreeBSD License; see accompanying COPYING file + +using c + +h{*}: extension = h +c{*}: extension = c + +# Every exe{} in this subproject is by default a test. +# +exe{*}: test = true + +# The test target for cross-testing (running tests under Wine, etc). +# +test.target = $c.target diff --git a/libcmark-gfm/tests/buildfile b/libcmark-gfm/tests/buildfile new file mode 100644 index 0000000..3961c0a --- /dev/null +++ b/libcmark-gfm/tests/buildfile @@ -0,0 +1,5 @@ +# file : tests/buildfile +# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd +# license : FreeBSD License; see accompanying COPYING file + +./: {*/ -build/} -- cgit v1.1