summaryrefslogtreecommitdiff
path: root/libcrypto/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-02-26 17:04:25 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-02-28 16:07:10 +0300
commit0ca0851a01251b960ba19d958978004168f58593 (patch)
treed50cc7f7d17e1f1a79dd2c1026606ed23540222d /libcrypto/tests
parent05e886fee177833f75d01ebf72f120021f71f130 (diff)
Add implementation
Diffstat (limited to 'libcrypto/tests')
-rw-r--r--libcrypto/tests/.gitignore8
-rw-r--r--libcrypto/tests/basic/buildfile7
-rw-r--r--libcrypto/tests/basic/driver.c25
-rw-r--r--libcrypto/tests/basic/testscript12
-rw-r--r--libcrypto/tests/build/.gitignore3
-rw-r--r--libcrypto/tests/build/bootstrap.build9
-rw-r--r--libcrypto/tests/build/root.build16
-rw-r--r--libcrypto/tests/buildfile5
8 files changed, 85 insertions, 0 deletions
diff --git a/libcrypto/tests/.gitignore b/libcrypto/tests/.gitignore
new file mode 100644
index 0000000..662178d
--- /dev/null
+++ b/libcrypto/tests/.gitignore
@@ -0,0 +1,8 @@
+# Test executables.
+#
+driver
+
+# Testscript output directories (can be symlinks).
+#
+test
+test-*
diff --git a/libcrypto/tests/basic/buildfile b/libcrypto/tests/basic/buildfile
new file mode 100644
index 0000000..2f19c4a
--- /dev/null
+++ b/libcrypto/tests/basic/buildfile
@@ -0,0 +1,7 @@
+# file : tests/basic/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : OpenSSL and SSLeay Licenses; see accompanying LICENSE file
+
+import libs = libcrypto%lib{crypto}
+
+exe{driver}: {h c}{**} $libs testscript
diff --git a/libcrypto/tests/basic/driver.c b/libcrypto/tests/basic/driver.c
new file mode 100644
index 0000000..d398269
--- /dev/null
+++ b/libcrypto/tests/basic/driver.c
@@ -0,0 +1,25 @@
+/*
+ * file : tests/basic/driver.c
+ * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC
+ * license : OpenSSL and SSLeay Licenses; see accompanying LICENSE file
+ */
+
+#include <stdio.h>
+#include <assert.h>
+
+#include <openssl/crypto.h>
+
+int
+main ()
+{
+ assert (OPENSSL_init_crypto (0 /* opts */, NULL /* settings */) == 1);
+
+ printf ("version: %s\n", OpenSSL_version (OPENSSL_VERSION));
+ printf ("%s\n", OpenSSL_version (OPENSSL_BUILT_ON));
+ printf ("%s\n", OpenSSL_version (OPENSSL_PLATFORM));
+ printf ("%s\n", OpenSSL_version (OPENSSL_CFLAGS));
+ printf ("%s\n", OpenSSL_version (OPENSSL_DIR));
+ printf ("%s\n", OpenSSL_version (OPENSSL_ENGINES_DIR));
+
+ return 0;
+}
diff --git a/libcrypto/tests/basic/testscript b/libcrypto/tests/basic/testscript
new file mode 100644
index 0000000..3c55bc4
--- /dev/null
+++ b/libcrypto/tests/basic/testscript
@@ -0,0 +1,12 @@
+# file : tests/basic/testscript
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : OpenSSL and SSLeay Licenses; see accompanying LICENSE file
+
+$* >>~"%EOO%"
+ version: OpenSSL 1.1.1a 20 Nov 2018
+ %built on: .+ UTC%
+ %platform: $c.target.class-$c.target.cpu%
+ %compiler: $c.class .*-DLIBCRYPTO_BUILD .*-DOPENSSLDIR=".+" -DENGINESDIR=".+".*%
+ %OPENSSLDIR: ".+"%
+ %ENGINESDIR: ".+"%
+ EOO
diff --git a/libcrypto/tests/build/.gitignore b/libcrypto/tests/build/.gitignore
new file mode 100644
index 0000000..4a730a3
--- /dev/null
+++ b/libcrypto/tests/build/.gitignore
@@ -0,0 +1,3 @@
+config.build
+root/
+bootstrap/
diff --git a/libcrypto/tests/build/bootstrap.build b/libcrypto/tests/build/bootstrap.build
new file mode 100644
index 0000000..dd525c0
--- /dev/null
+++ b/libcrypto/tests/build/bootstrap.build
@@ -0,0 +1,9 @@
+# file : tests/build/bootstrap.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : OpenSSL and SSLeay Licenses; see accompanying LICENSE file
+
+project = # Unnamed tests subproject.
+
+using config
+using test
+using dist
diff --git a/libcrypto/tests/build/root.build b/libcrypto/tests/build/root.build
new file mode 100644
index 0000000..02e2e5d
--- /dev/null
+++ b/libcrypto/tests/build/root.build
@@ -0,0 +1,16 @@
+# file : tests/build/root.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : OpenSSL and SSLeay Licenses; see accompanying LICENSE 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/libcrypto/tests/buildfile b/libcrypto/tests/buildfile
new file mode 100644
index 0000000..70330ab
--- /dev/null
+++ b/libcrypto/tests/buildfile
@@ -0,0 +1,5 @@
+# file : tests/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : OpenSSL and SSLeay Licenses; see accompanying LICENSE file
+
+./: {*/ -build/}