summaryrefslogtreecommitdiff
path: root/libca-certificates-curl/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-01-18 22:19:54 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-01-22 15:46:09 +0300
commit004bb71d88ed54eb4d540d14491bf86256a952fd (patch)
treeb381d80f22682e29651370701d798a2e3dfebccc /libca-certificates-curl/tests
parent66e25bf08b493258642cb844b987fd96afa39c7b (diff)
Add implementation
Diffstat (limited to 'libca-certificates-curl/tests')
-rw-r--r--libca-certificates-curl/tests/.gitignore8
-rw-r--r--libca-certificates-curl/tests/basics/buildfile7
-rw-r--r--libca-certificates-curl/tests/basics/driver.c19
-rw-r--r--libca-certificates-curl/tests/basics/testscript17
-rw-r--r--libca-certificates-curl/tests/build/.gitignore3
-rw-r--r--libca-certificates-curl/tests/build/bootstrap.build9
-rw-r--r--libca-certificates-curl/tests/build/root.build22
-rw-r--r--libca-certificates-curl/tests/buildfile5
8 files changed, 90 insertions, 0 deletions
diff --git a/libca-certificates-curl/tests/.gitignore b/libca-certificates-curl/tests/.gitignore
new file mode 100644
index 0000000..662178d
--- /dev/null
+++ b/libca-certificates-curl/tests/.gitignore
@@ -0,0 +1,8 @@
+# Test executables.
+#
+driver
+
+# Testscript output directories (can be symlinks).
+#
+test
+test-*
diff --git a/libca-certificates-curl/tests/basics/buildfile b/libca-certificates-curl/tests/basics/buildfile
new file mode 100644
index 0000000..3adb0ff
--- /dev/null
+++ b/libca-certificates-curl/tests/basics/buildfile
@@ -0,0 +1,7 @@
+# file : tests/basic/buildfile
+# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC
+# license : Mozilla Public License 2.0; see accompanying LICENSE file
+
+import libs = libca-certificates-curl%lib{ca-certificates-curl}
+
+exe{driver}: {h c}{**} $libs testscript
diff --git a/libca-certificates-curl/tests/basics/driver.c b/libca-certificates-curl/tests/basics/driver.c
new file mode 100644
index 0000000..f52b3d8
--- /dev/null
+++ b/libca-certificates-curl/tests/basics/driver.c
@@ -0,0 +1,19 @@
+/* file : tests/basic/driver.c
+ * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC
+ * license : Mozilla Public License 2.0; see accompanying LICENSE file
+ */
+#include <stdio.h>
+
+#include <libca-certificates-curl/path.h>
+#include <libca-certificates-curl/version.h>
+
+/* Usage: argv[0]
+ *
+ * Print the CA certificates file path to stdout.
+ */
+int
+main ()
+{
+ printf ("%s\n", ca_certificates_file ());
+ return 0;
+}
diff --git a/libca-certificates-curl/tests/basics/testscript b/libca-certificates-curl/tests/basics/testscript
new file mode 100644
index 0000000..ffa60ad
--- /dev/null
+++ b/libca-certificates-curl/tests/basics/testscript
@@ -0,0 +1,17 @@
+# file : tests/basic/testscript
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : Mozilla Public License 2.0; see accompanying LICENSE file
+
+: basic
+:
+{
+ $* | set f;
+
+ cat "$f" >>~%EOO%
+ %.*
+ -----BEGIN CERTIFICATE-----
+ %.+
+ -----END CERTIFICATE-----
+ %*
+ EOO
+}
diff --git a/libca-certificates-curl/tests/build/.gitignore b/libca-certificates-curl/tests/build/.gitignore
new file mode 100644
index 0000000..4a730a3
--- /dev/null
+++ b/libca-certificates-curl/tests/build/.gitignore
@@ -0,0 +1,3 @@
+config.build
+root/
+bootstrap/
diff --git a/libca-certificates-curl/tests/build/bootstrap.build b/libca-certificates-curl/tests/build/bootstrap.build
new file mode 100644
index 0000000..d14d50e
--- /dev/null
+++ b/libca-certificates-curl/tests/build/bootstrap.build
@@ -0,0 +1,9 @@
+# file : tests/build/bootstrap.build
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : Mozilla Public License 2.0; see accompanying LICENSE file
+
+project = # Unnamed tests subproject.
+
+using config
+using test
+using dist
diff --git a/libca-certificates-curl/tests/build/root.build b/libca-certificates-curl/tests/build/root.build
new file mode 100644
index 0000000..2c05fe1
--- /dev/null
+++ b/libca-certificates-curl/tests/build/root.build
@@ -0,0 +1,22 @@
+# file : tests/build/root.build
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : Mozilla Public License 2.0; see accompanying LICENSE file
+
+using c
+
+h{*}: extension = h
+c{*}: extension = c
+
+if ($c.target.system == 'win32-msvc')
+ c.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
+
+if ($c.class == 'msvc')
+ c.coptions += /wd4251 /wd4275 /wd4800
+
+# 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/libca-certificates-curl/tests/buildfile b/libca-certificates-curl/tests/buildfile
new file mode 100644
index 0000000..38ca62c
--- /dev/null
+++ b/libca-certificates-curl/tests/buildfile
@@ -0,0 +1,5 @@
+# file : tests/buildfile
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : Mozilla Public License 2.0; see accompanying LICENSE file
+
+./: {*/ -build/}