summaryrefslogtreecommitdiff
path: root/libcmark-gfm/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libcmark-gfm/tests')
-rw-r--r--libcmark-gfm/tests/.gitignore8
-rw-r--r--libcmark-gfm/tests/basic/buildfile7
-rw-r--r--libcmark-gfm/tests/basic/driver.c28
-rw-r--r--libcmark-gfm/tests/basic/testscript5
-rw-r--r--libcmark-gfm/tests/build/.gitignore3
-rw-r--r--libcmark-gfm/tests/build/bootstrap.build9
-rw-r--r--libcmark-gfm/tests/build/root.build16
-rw-r--r--libcmark-gfm/tests/buildfile5
8 files changed, 81 insertions, 0 deletions
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 <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include <cmark-gfm.h>
+#include <cmark-gfm-extension_api.h>
+
+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*' >'<p>Hello <em>world</em></p>'
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/}