[gnome-keyring] Cleanup naming and whitespace for testing stuff.
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] Cleanup naming and whitespace for testing stuff.
- Date: Tue, 8 Jun 2010 16:02:23 +0000 (UTC)
commit ddcd1ae794f789379964b6b26683c1436c19c70f
Author: Stef Walter <stef memberwebs com>
Date: Tue Jun 8 15:45:33 2010 +0000
Cleanup naming and whitespace for testing stuff.
* Rip off bandaid (painful) whitespace cleanup.
* At the same time cleanup naming, and remove old cruft.
.gitignore | 3 +-
Makefile.am | 2 +-
configure.in | 2 +-
daemon/.gitignore | 1 -
daemon/control/tests/test-control-change.c | 4 +-
daemon/control/tests/test-control-init.c | 4 +-
daemon/control/tests/test-control-unlock.c | 4 +-
docs/reference/gcr/gcr-sections.txt | 4 --
egg/tests/.gitignore | 3 -
egg/tests/Makefile.am | 6 +-
egg/tests/test-padding.c | 2 +-
egg/tests/unit-test-asn1.c | 4 +-
egg/tests/unit-test-cleanup.c | 2 +-
egg/tests/unit-test-dh.c | 2 +-
egg/tests/unit-test-hex.c | 2 +-
egg/tests/unit-test-oid.c | 2 +-
egg/tests/unit-test-openssl.c | 4 +-
egg/tests/unit-test-secmem.c | 2 +-
egg/tests/unit-test-spawn.c | 18 +++---
egg/tests/unit-test-symkey.c | 2 +-
gcr/tests/.gitignore | 3 -
gcr/tests/Makefile.am | 8 ++--
gcr/tests/unit-test-certificate.c | 4 +-
gcr/tests/unit-test-parser.c | 6 +-
gp11/tests/.gitignore | 3 -
gp11/tests/Makefile.am | 8 ++--
gp11/tests/test-gp11-mechanism.c | 2 +-
gp11/tests/unit-test-gp11-attributes.c | 2 +-
gp11/tests/unit-test-gp11-crypto.c | 30 ++++++------
gp11/tests/unit-test-gp11-module.c | 2 +-
gp11/tests/unit-test-gp11-object.c | 18 +++---
gp11/tests/unit-test-gp11-session.c | 20 ++++----
gp11/tests/unit-test-gp11-slot.c | 2 +-
pkcs11/gkm/tests/.gitignore | 2 -
pkcs11/gkm/tests/Makefile.am | 6 +-
pkcs11/gkm/tests/test-module.c | 4 +-
pkcs11/gkm/tests/unit-test-attributes.c | 2 +-
pkcs11/gkm/tests/unit-test-credential.c | 2 +-
pkcs11/gkm/tests/unit-test-data-asn1.c | 4 +-
pkcs11/gkm/tests/unit-test-data-der.c | 14 +++---
pkcs11/gkm/tests/unit-test-data-file.c | 8 ++--
pkcs11/gkm/tests/unit-test-file-tracker.c | 2 +-
pkcs11/gkm/tests/unit-test-memory-store.c | 2 +-
pkcs11/gkm/tests/unit-test-object.c | 6 +-
pkcs11/gkm/tests/unit-test-secret.c | 2 +-
pkcs11/gkm/tests/unit-test-sexp.c | 2 +-
pkcs11/gkm/tests/unit-test-store.c | 2 +-
pkcs11/gkm/tests/unit-test-timer.c | 12 ++--
pkcs11/gkm/tests/unit-test-transaction.c | 14 +++---
pkcs11/roots-store/tests/Makefile.am | 6 +-
pkcs11/roots-store/tests/test-module.c | 4 +-
pkcs11/secret-store/tests/.gitignore | 1 -
pkcs11/secret-store/tests/Makefile.am | 6 +-
pkcs11/secret-store/tests/test-secret-module.c | 12 ++--
.../secret-store/tests/unit-test-secret-binary.c | 12 ++--
.../tests/unit-test-secret-collection.c | 14 +++---
.../secret-store/tests/unit-test-secret-compat.c | 2 +-
pkcs11/secret-store/tests/unit-test-secret-data.c | 2 +-
.../secret-store/tests/unit-test-secret-fields.c | 2 +-
pkcs11/secret-store/tests/unit-test-secret-item.c | 2 +-
.../secret-store/tests/unit-test-secret-object.c | 2 +-
.../secret-store/tests/unit-test-secret-search.c | 2 +-
.../secret-store/tests/unit-test-secret-textual.c | 10 ++--
pkcs11/ssh-store/tests/.gitignore | 2 -
pkcs11/ssh-store/tests/Makefile.am | 6 +-
pkcs11/ssh-store/tests/test-ssh-module.c | 4 +-
pkcs11/ssh-store/tests/unit-test-private-key.c | 10 ++--
pkcs11/ssh-store/tests/unit-test-ssh-openssh.c | 6 +-
pkcs11/user-store/tests/Makefile.am | 6 +-
pkcs11/user-store/tests/test-module.c | 4 +-
pkcs11/wrap-layer/tests/Makefile.am | 9 +--
pkcs11/wrap-layer/tests/test-prompt-login.c | 2 +-
po/POTFILES.in | 1 +
{tests => testing}/.gitignore | 0
testing/Makefile.am | 19 +++++++
{tests => testing}/ca-example/certs/ca.crt | 0
{tests => testing}/ca-example/certs/client.crt | 0
{tests => testing}/ca-example/certs/email.crt | 0
.../ca-example/certs/generic-dsa.crt | 0
{tests => testing}/ca-example/database.txt | 0
{tests => testing}/ca-example/keys/ca.key | 0
{tests => testing}/ca-example/keys/client.key | 0
{tests => testing}/ca-example/keys/dsa.params | 0
{tests => testing}/ca-example/keys/email.key | 0
{tests => testing}/ca-example/keys/generic-dsa.key | 0
{tests => testing}/ca-example/profiles/ca.conf | 2 +-
.../ca-example/profiles/extensions.conf | 0
.../ca-example/profiles/request.conf | 0
{tests => testing}/ca-example/requests/client.req | 0
{tests => testing}/ca-example/requests/email.req | 0
.../ca-example/requests/generic-dsa.req | 0
{tests => testing}/ca-example/serial.txt | 0
tests/prep-gtest.sh => testing/testing-build.sh | 34 ++++++------
tests/gtest-helpers.c => testing/testing.c | 46 ++++++++--------
tests/gtest-helpers.h => testing/testing.h | 46 ++++++++++-------
testing/testing.make | 54 ++++++++++++++++++++
tests/Makefile.am | 19 -------
tests/dbus-test.py | 16 ------
tests/gtest.make | 53 -------------------
ui/tests/Makefile.am | 6 +-
ui/tests/unit-test-util.c | 2 +-
101 files changed, 332 insertions(+), 357 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index d8e301a..5926741 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,7 +22,8 @@ stamp-*
Makefile
Makefile.in
core
-run-auto-test*
+test-framework.[ch]
+run-tests
*-marshal.[ch]
.libs
.deps
diff --git a/Makefile.am b/Makefile.am
index 7805792..fb9ec48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ PAM_DIR =
endif
if WITH_TESTS
-TESTS_DIR = tests
+TESTS_DIR = testing
else
TESTS_DIR =
endif
diff --git a/configure.in b/configure.in
index 830c10b..edf5dae 100644
--- a/configure.in
+++ b/configure.in
@@ -586,7 +586,7 @@ pkcs11/user-store/tests/Makefile
pkcs11/wrap-layer/Makefile
pkcs11/wrap-layer/tests/Makefile
po/Makefile.in
-tests/Makefile
+testing/Makefile
tool/Makefile
ui/Makefile
ui/tests/Makefile
diff --git a/daemon/.gitignore b/daemon/.gitignore
index 3f574c6..5885fec 100644
--- a/daemon/.gitignore
+++ b/daemon/.gitignore
@@ -14,7 +14,6 @@ Makefile.in
/gnome-keyring-ssh.desktop.in
*-marshal.[ch]
gnome-keyring-prompt
-run-auto-test*
/control/tests/test-control-change
/control/tests/test-control-init
diff --git a/daemon/control/tests/test-control-change.c b/daemon/control/tests/test-control-change.c
index ee5d995..b910f77 100644
--- a/daemon/control/tests/test-control-change.c
+++ b/daemon/control/tests/test-control-change.c
@@ -1,6 +1,6 @@
#include "control/gkd-control.h"
-#include "tests/gtest-helpers.h"
+#include "testing/testing.h"
#include <pwd.h>
#include <unistd.h>
@@ -27,4 +27,4 @@ run (void)
return 0;
}
-#include "tests/gtest-helpers.c"
+#include "testing/testing.c"
diff --git a/daemon/control/tests/test-control-init.c b/daemon/control/tests/test-control-init.c
index c059477..4b1d6b4 100644
--- a/daemon/control/tests/test-control-init.c
+++ b/daemon/control/tests/test-control-init.c
@@ -1,6 +1,6 @@
#include "control/gkd-control.h"
-#include "tests/gtest-helpers.h"
+#include "testing/testing.h"
#include <pwd.h>
#include <stdlib.h>
@@ -27,4 +27,4 @@ run (void)
return 0;
}
-#include "tests/gtest-helpers.c"
+#include "testing/testing.c"
diff --git a/daemon/control/tests/test-control-unlock.c b/daemon/control/tests/test-control-unlock.c
index d77901b..ba6cca4 100644
--- a/daemon/control/tests/test-control-unlock.c
+++ b/daemon/control/tests/test-control-unlock.c
@@ -1,6 +1,6 @@
#include "control/gkd-control.h"
-#include "tests/gtest-helpers.h"
+#include "testing/testing.h"
#include <pwd.h>
#include <unistd.h>
@@ -21,4 +21,4 @@ run (void)
return 0;
}
-#include "tests/gtest-helpers.c"
+#include "testing/testing.c"
diff --git a/docs/reference/gcr/gcr-sections.txt b/docs/reference/gcr/gcr-sections.txt
index 6dd180c..ac83c61 100644
--- a/docs/reference/gcr/gcr-sections.txt
+++ b/docs/reference/gcr/gcr-sections.txt
@@ -198,7 +198,3 @@ GCR_DATA_ERROR
gcr_data_error_get_domain
</SECTION>
-<SECTION>
-<FILE>run-auto-test</FILE>
-</SECTION>
-
diff --git a/egg/tests/.gitignore b/egg/tests/.gitignore
index 1ff6d55..133d204 100644
--- a/egg/tests/.gitignore
+++ b/egg/tests/.gitignore
@@ -1,8 +1,5 @@
/asn1-def-test.h
-/run-auto-test.c
-/run-auto-test.h
/.deps
/.libs
/Makefile
/Makefile.in
-/run-auto-test
diff --git a/egg/tests/Makefile.am b/egg/tests/Makefile.am
index 3bcecbc..daae728 100644
--- a/egg/tests/Makefile.am
+++ b/egg/tests/Makefile.am
@@ -2,7 +2,7 @@ asn1-def-test.h: test.asn
$(ASN1PARSER) -o asn1-def-test.h $(srcdir)/test.asn
# Test files should be listed in order they need to run
-UNIT_AUTO = \
+TESTING_FILES = \
unit-test-asn1.c \
unit-test-cleanup.c \
unit-test-hex.c \
@@ -17,14 +17,14 @@ UNIT_AUTO = \
UNIT_PROMPT =
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/egg/libegg.la
EXTRA_DIST = \
test.asn \
test-data
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
BUILT_SOURCES += \
asn1-def-test.h
diff --git a/egg/tests/test-padding.c b/egg/tests/test-padding.c
index 569f07f..8a02c9a 100644
--- a/egg/tests/test-padding.c
+++ b/egg/tests/test-padding.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg/egg-padding.h"
diff --git a/egg/tests/unit-test-asn1.c b/egg/tests/unit-test-asn1.c
index b0e20b2..1ab3f38 100644
--- a/egg/tests/unit-test-asn1.c
+++ b/egg/tests/unit-test-asn1.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg/egg-asn1.h"
#include "egg/egg-oid.h"
@@ -55,7 +55,7 @@ DEFINE_SETUP(asn1_tree)
/* -------- */
- data_cert = test_data_read ("test-certificate-1.der", &n_data_cert);
+ data_cert = testing_data_read ("test-certificate-1.der", &n_data_cert);
/* We'll be catching this error later */
pkix = egg_asn1_get_pkix_asn1type ();
diff --git a/egg/tests/unit-test-cleanup.c b/egg/tests/unit-test-cleanup.c
index 43ce642..cdb50c9 100644
--- a/egg/tests/unit-test-cleanup.c
+++ b/egg/tests/unit-test-cleanup.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg/egg-cleanup.h"
diff --git a/egg/tests/unit-test-dh.c b/egg/tests/unit-test-dh.c
index 1111fd4..5adba5b 100644
--- a/egg/tests/unit-test-dh.c
+++ b/egg/tests/unit-test-dh.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg-dh.h"
#include "egg-secure-memory.h"
diff --git a/egg/tests/unit-test-hex.c b/egg/tests/unit-test-hex.c
index 727779b..5088f2f 100644
--- a/egg/tests/unit-test-hex.c
+++ b/egg/tests/unit-test-hex.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg-hex.h"
diff --git a/egg/tests/unit-test-oid.c b/egg/tests/unit-test-oid.c
index aa4a866..bebd1a1 100644
--- a/egg/tests/unit-test-oid.c
+++ b/egg/tests/unit-test-oid.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg/egg-oid.h"
diff --git a/egg/tests/unit-test-openssl.c b/egg/tests/unit-test-openssl.c
index f7dbed7..256fa2b 100644
--- a/egg/tests/unit-test-openssl.c
+++ b/egg/tests/unit-test-openssl.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg-symkey.h"
#include "egg-openssl.h"
@@ -76,7 +76,7 @@ DEFINE_TEST(parse_reference)
gsize n_input;
guint num;
- input = test_data_read ("pem-rsa-enc.key", &n_input);
+ input = testing_data_read ("pem-rsa-enc.key", &n_input);
num = egg_openssl_pem_parse (input, n_input, parse_reference, NULL);
g_assert ("couldn't PEM block in reference data" && num == 1);
diff --git a/egg/tests/unit-test-secmem.c b/egg/tests/unit-test-secmem.c
index ffa9b0b..8e0cf55 100644
--- a/egg/tests/unit-test-secmem.c
+++ b/egg/tests/unit-test-secmem.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg/egg-secure-memory.h"
diff --git a/egg/tests/unit-test-spawn.c b/egg/tests/unit-test-spawn.c
index 7ed7cfd..2e53b53 100644
--- a/egg/tests/unit-test-spawn.c
+++ b/egg/tests/unit-test-spawn.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg-spawn.h"
@@ -113,7 +113,7 @@ completed_func (gpointer user_data)
g_assert (!data->completed);
data->completed = TRUE;
if (data->is_async)
- test_wait_stop ();
+ testing_wait_stop ();
}
static void
@@ -172,7 +172,7 @@ DEFINE_TEST(test_spawn_sync)
data.parent_pid = getpid();
data.index = 80;
- ret = egg_spawn_sync_with_callbacks (test_data_directory (),
+ ret = egg_spawn_sync_with_callbacks (testing_data_directory (),
echo_argv, NULL, 0, &pid,
&echo_callbacks, &data,
&exit_status, &error);
@@ -192,7 +192,7 @@ DEFINE_TEST(test_spawn_sync_error)
GError *error = NULL;
gboolean ret;
- ret = egg_spawn_sync_with_callbacks (test_data_directory (),
+ ret = egg_spawn_sync_with_callbacks (testing_data_directory (),
error_argv, NULL, 0, NULL,
NULL, NULL,
NULL, &error);
@@ -214,7 +214,7 @@ DEFINE_TEST(test_spawn_async)
data.index = 80;
data.is_async = TRUE;
- ret = egg_spawn_async_with_callbacks (test_data_directory (),
+ ret = egg_spawn_async_with_callbacks (testing_data_directory (),
echo_argv, NULL, 0, &pid,
&echo_callbacks, &data,
NULL, &error);
@@ -224,7 +224,7 @@ DEFINE_TEST(test_spawn_async)
g_assert (!data.output);
g_assert (!data.completed);
- test_wait_until (2000);
+ testing_wait_until (2000);
g_assert (data.finalized);
g_assert (data.completed);
@@ -242,7 +242,7 @@ DEFINE_TEST(test_spawn_async_none)
data.parent_pid = getpid();
data.is_async = TRUE;
- ret = egg_spawn_async_with_callbacks (test_data_directory (),
+ ret = egg_spawn_async_with_callbacks (testing_data_directory (),
echo_argv, NULL, 0, NULL,
&null_callbacks, &data,
NULL, &error);
@@ -252,7 +252,7 @@ DEFINE_TEST(test_spawn_async_none)
g_assert (!data.completed);
g_assert (!data.output);
- test_wait_until (2000);
+ testing_wait_until (2000);
g_assert (data.finalized);
g_assert (data.completed);
@@ -264,7 +264,7 @@ DEFINE_TEST(test_spawn_async_error)
GError *error = NULL;
guint ret;
- ret = egg_spawn_async_with_callbacks (test_data_directory (),
+ ret = egg_spawn_async_with_callbacks (testing_data_directory (),
error_argv, NULL, 0, NULL,
NULL, NULL,
NULL, &error);
diff --git a/egg/tests/unit-test-symkey.c b/egg/tests/unit-test-symkey.c
index 2287eff..bf35dca 100644
--- a/egg/tests/unit-test-symkey.c
+++ b/egg/tests/unit-test-symkey.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg-libgcrypt.h"
#include "egg-secure-memory.h"
diff --git a/gcr/tests/.gitignore b/gcr/tests/.gitignore
index 217eaf9..ee3b34a 100644
--- a/gcr/tests/.gitignore
+++ b/gcr/tests/.gitignore
@@ -1,8 +1,5 @@
/Makefile
/Makefile.in
-/run-auto-test
-/run-auto-test.c
-/run-auto-test.h
/.deps
/.libs
/ui-test-details
diff --git a/gcr/tests/Makefile.am b/gcr/tests/Makefile.am
index 2d5e3e4..5600bff 100644
--- a/gcr/tests/Makefile.am
+++ b/gcr/tests/Makefile.am
@@ -1,19 +1,19 @@
# Test files should be listed in order they need to run
-UNIT_AUTO = \
+TESTING_FILES = \
unit-test-certificate.c \
unit-test-parser.c
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/gcr/libgcr.la \
$(top_builddir)/egg/libegg.la \
$(top_builddir)/egg/libegg-entry-buffer.la \
$(top_builddir)/gp11/libgp11.la
-UNIT_FLAGS = \
+TESTING_FLAGS = \
-DGCR_API_SUBJECT_TO_CHANGE
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
# ------------------------------------------------------------------
diff --git a/gcr/tests/unit-test-certificate.c b/gcr/tests/unit-test-certificate.c
index 387593b..709f944 100644
--- a/gcr/tests/unit-test-certificate.c
+++ b/gcr/tests/unit-test-certificate.c
@@ -1,6 +1,6 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gcr-certificate.h"
#include "gcr-simple-certificate.h"
@@ -16,7 +16,7 @@ DEFINE_SETUP(certificate)
guchar *contents;
gsize n_contents;
- contents = test_data_read ("der-certificate.crt", &n_contents);
+ contents = testing_data_read ("der-certificate.crt", &n_contents);
certificate = gcr_simple_certificate_new (contents, n_contents);
g_assert (certificate);
g_free (contents);
diff --git a/gcr/tests/unit-test-parser.c b/gcr/tests/unit-test-parser.c
index cf0108e..1359e9d 100644
--- a/gcr/tests/unit-test-parser.c
+++ b/gcr/tests/unit-test-parser.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg/egg-error.h"
#include "egg/egg-secure-memory.h"
@@ -114,7 +114,7 @@ DEFINE_TEST(parse_all)
gsize len;
GDir *dir;
- dir = g_dir_open (test_data_directory (), 0, NULL);
+ dir = g_dir_open (testing_data_directory (), 0, NULL);
g_assert (dir);
for (;;) {
@@ -125,7 +125,7 @@ DEFINE_TEST(parse_all)
continue;
filedesc = filename;
- contents = test_data_read (filename, &len);
+ contents = testing_data_read (filename, &len);
result = gcr_parser_parse_data (parser, contents, len, &err);
if (!result) {
diff --git a/gp11/tests/.gitignore b/gp11/tests/.gitignore
index 68d9409..8a5f5ef 100644
--- a/gp11/tests/.gitignore
+++ b/gp11/tests/.gitignore
@@ -1,6 +1,3 @@
-/run-auto-test.h
-/run-auto-test.c
-/run-auto-test
/Makefile
/Makefile.in
/.*
diff --git a/gp11/tests/Makefile.am b/gp11/tests/Makefile.am
index c0af4a3..a223827 100644
--- a/gp11/tests/Makefile.am
+++ b/gp11/tests/Makefile.am
@@ -1,6 +1,6 @@
# Keep these in the order they should be tested
-UNIT_AUTO = \
+TESTING_FILES = \
unit-test-gp11-attributes.c \
test-gp11-mechanism.c \
unit-test-gp11-module.c \
@@ -9,11 +9,11 @@ UNIT_AUTO = \
unit-test-gp11-object.c \
unit-test-gp11-crypto.c
-UNIT_FLAGS = \
+TESTING_FLAGS = \
-I$(top_srcdir)/gp11/ \
-DEXTERNAL_TEST
-UNIT_LIBS = \
+TESTING_LIBS = \
$(GIO_LIBS) \
$(top_builddir)/gp11/libgp11.la \
libgp11-test-module.la
@@ -21,7 +21,7 @@ UNIT_LIBS = \
EXTRA_DIST = \
gp11-test.h
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
# ------------------------------------------------------------------------
diff --git a/gp11/tests/test-gp11-mechanism.c b/gp11/tests/test-gp11-mechanism.c
index 68543a2..23eeddb 100644
--- a/gp11/tests/test-gp11-mechanism.c
+++ b/gp11/tests/test-gp11-mechanism.c
@@ -2,7 +2,7 @@
#include <glib.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gp11-test.h"
#define MECH_TYPE 55
diff --git a/gp11/tests/unit-test-gp11-attributes.c b/gp11/tests/unit-test-gp11-attributes.c
index cb4e1c9..78cd265 100644
--- a/gp11/tests/unit-test-gp11-attributes.c
+++ b/gp11/tests/unit-test-gp11-attributes.c
@@ -2,7 +2,7 @@
#include <glib.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gp11-test.h"
#define ATTR_TYPE 55
diff --git a/gp11/tests/unit-test-gp11-crypto.c b/gp11/tests/unit-test-gp11-crypto.c
index 67a8560..c0581a6 100644
--- a/gp11/tests/unit-test-gp11-crypto.c
+++ b/gp11/tests/unit-test-gp11-crypto.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include <glib.h>
@@ -44,7 +44,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
{
*((GAsyncResult**)user_data) = result;
g_object_ref (result);
- test_wait_stop ();
+ testing_wait_stop ();
}
static GP11Object*
@@ -159,7 +159,7 @@ DEFINE_TEST(encrypt)
/* Asynchronous one */
gp11_session_encrypt_async (session, key, mech, (const guchar*)"second chance", 14, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
/* Get the result */
@@ -206,7 +206,7 @@ DEFINE_TEST(decrypt)
/* Asynchronous one */
gp11_session_decrypt_async (session, key, mech, (const guchar*)"FAT CHANCE", 11, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
/* Get the result */
@@ -279,7 +279,7 @@ DEFINE_TEST(sign)
/* Asynchronous one */
gp11_session_sign_async (session, key, mech, (const guchar*)"Conrad", 7, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
/* Get the result */
@@ -330,7 +330,7 @@ DEFINE_TEST(verify)
/* Asynchronous one */
gp11_session_verify_async (session, key, mech, (const guchar*)"Labarbara", 10,
(const guchar*)"my-prefix:Labarbara", 20, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_verify_finish (session, result, &error);
SUCCESS_RES (ret, error);
@@ -340,7 +340,7 @@ DEFINE_TEST(verify)
result = NULL;
gp11_session_verify_async (session, key, mech, (const guchar*)"Labarbara", 10,
(const guchar*)"my-prefix:Labarxoro", 20, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_verify_finish (session, result, &error);
FAIL_RES (ret, error);
@@ -385,7 +385,7 @@ DEFINE_TEST(generate_key_pair)
/* Asynchronous one */
mech->type = CKM_GENERATE;
gp11_session_generate_key_pair_async (session, mech, pub_attrs, prv_attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_generate_key_pair_finish (session, result, &pub_key, &prv_key, &error);
SUCCESS_RES (ret, error);
@@ -398,7 +398,7 @@ DEFINE_TEST(generate_key_pair)
mech->type = 0;
pub_key = prv_key = NULL;
gp11_session_generate_key_pair_async (session, mech, pub_attrs, prv_attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_generate_key_pair_finish (session, result, &pub_key, &prv_key, &error);
FAIL_RES (ret, error);
@@ -449,7 +449,7 @@ DEFINE_TEST(wrap_key)
/* Asynchronous one */
mech->type = CKM_WRAP;
gp11_session_wrap_key_async (session, wrapper, mech, wrapped, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
output = gp11_session_wrap_key_finish (session, result, &n_output, &error);
SUCCESS_RES (output, error);
@@ -463,7 +463,7 @@ DEFINE_TEST(wrap_key)
mech->type = 0;
n_output = 0;
gp11_session_wrap_key_async (session, wrapper, mech, wrapped, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
output = gp11_session_wrap_key_finish (session, result, &n_output, &error);
FAIL_RES (output, error);
@@ -510,7 +510,7 @@ DEFINE_TEST(unwrap_key)
/* Asynchronous one */
mech->type = CKM_WRAP;
gp11_session_unwrap_key_async (session, wrapper, mech, "special", 7, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
unwrapped = gp11_session_unwrap_key_finish (session, result, &error);
SUCCESS_RES (unwrapped, error);
@@ -523,7 +523,7 @@ DEFINE_TEST(unwrap_key)
result = NULL;
mech->type = 0;
gp11_session_unwrap_key_async (session, wrapper, mech, "special", 6, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
unwrapped = gp11_session_unwrap_key_finish (session, result, &error);
FAIL_RES (unwrapped, error);
@@ -570,7 +570,7 @@ g_printerr ("derived is: %lu", gp11_object_get_handle (derived));
/* Asynchronous one */
mech->type = CKM_DERIVE;
gp11_session_derive_key_async (session, wrapper, mech, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
derived = gp11_session_derive_key_finish (session, result, &error);
SUCCESS_RES (derived, error);
@@ -583,7 +583,7 @@ g_printerr ("derived is: %lu", gp11_object_get_handle (derived));
result = NULL;
mech->type = 0;
gp11_session_derive_key_async (session, wrapper, mech, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
derived = gp11_session_derive_key_finish (session, result, &error);
FAIL_RES (derived, error);
diff --git a/gp11/tests/unit-test-gp11-module.c b/gp11/tests/unit-test-gp11-module.c
index 0d89d04..0a5bda9 100644
--- a/gp11/tests/unit-test-gp11-module.c
+++ b/gp11/tests/unit-test-gp11-module.c
@@ -2,7 +2,7 @@
#include <glib.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gp11-test.h"
static GP11Module *module = NULL;
diff --git a/gp11/tests/unit-test-gp11-object.c b/gp11/tests/unit-test-gp11-object.c
index 8daac3f..6495973 100644
--- a/gp11/tests/unit-test-gp11-object.c
+++ b/gp11/tests/unit-test-gp11-object.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include <glib.h>
@@ -94,7 +94,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
{
*((GAsyncResult**)user_data) = result;
g_object_ref (result);
- test_wait_stop ();
+ testing_wait_stop ();
}
DEFINE_TEST(create_object)
@@ -139,7 +139,7 @@ DEFINE_TEST(create_object)
/* Using async */
gp11_session_create_object_async (session, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
object = gp11_session_create_object_finish (session, result, &err);
@@ -205,7 +205,7 @@ DEFINE_TEST(destroy_object)
/* Using async */
gp11_object_destroy_async (object, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_object_destroy_finish (object, result, &err);
@@ -247,7 +247,7 @@ DEFINE_TEST(get_attributes)
/* Async */
attrs = gp11_attributes_new_empty (CKA_CLASS, CKA_LABEL, GP11_INVALID);
gp11_object_get_async (object, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
attrs_ret = gp11_object_get_finish (object, result, &err);
@@ -289,7 +289,7 @@ DEFINE_TEST(get_data_attribute)
/* Async */
gp11_object_get_data_async (object, CKA_CLASS, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
klass = gp11_object_get_data_finish (object, result, &n_data, &err);
@@ -348,7 +348,7 @@ DEFINE_TEST(set_attributes)
/* Async */
gp11_object_set_async (object, templ, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_object_set_finish (object, result, &err);
@@ -399,7 +399,7 @@ DEFINE_TEST(find_objects)
/* Async, None */
gp11_attributes_add_string (templ, CKA_LABEL, "blah blah");
gp11_session_find_objects_async (session, templ, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
objects = gp11_session_find_objects_finish (session, result, &err);
@@ -436,7 +436,7 @@ DEFINE_TEST(explicit_sessions)
/* Async */
gp11_object_get_data_async (object, CKA_CLASS, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
klass = gp11_object_get_data_finish (object, result, &n_data, &err);
diff --git a/gp11/tests/unit-test-gp11-session.c b/gp11/tests/unit-test-gp11-session.c
index 5bc6cc5..19cb11f 100644
--- a/gp11/tests/unit-test-gp11-session.c
+++ b/gp11/tests/unit-test-gp11-session.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include <glib.h>
@@ -73,7 +73,7 @@ fetch_async_result (GObject *source, GAsyncResult *result, gpointer user_data)
{
*((GAsyncResult**)user_data) = result;
g_object_ref (result);
- test_wait_stop ();
+ testing_wait_stop ();
}
DEFINE_TEST(open_close_session)
@@ -90,7 +90,7 @@ DEFINE_TEST(open_close_session)
/* Test opening async */
gp11_slot_open_session_async (slot, 0, NULL, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
/* Get the result */
@@ -132,7 +132,7 @@ DEFINE_TEST(open_reused)
/* Test opening async */
gp11_slot_open_session_async (slot, 0, NULL, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
sess = gp11_slot_open_session_finish (slot, result, &err);
SUCCESS_RES (sess, err);
@@ -177,7 +177,7 @@ DEFINE_TEST(init_set_pin)
/* init pin async */
gp11_session_init_pin_async (session, (guchar*)"booo", 4, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_init_pin_finish (session, result, &err);
SUCCESS_RES (ret, err);
@@ -186,7 +186,7 @@ DEFINE_TEST(init_set_pin)
/* set pin async */
gp11_session_set_pin_async (session, (guchar*)"booo", 4, (guchar*)"tooo", 4, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_set_pin_finish (session, result, &err);
SUCCESS_RES (ret, err);
@@ -217,7 +217,7 @@ DEFINE_TEST(login_logout)
/* login async */
gp11_session_login_async (session, CKU_USER, (guchar*)"booo", 4, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_login_finish (session, result, &err);
@@ -228,7 +228,7 @@ DEFINE_TEST(login_logout)
/* logout async */
gp11_session_logout_async (session, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
ret = gp11_session_logout_finish (session, result, &err);
@@ -298,7 +298,7 @@ DEFINE_TEST(auto_login)
/* Now try the same thing, but asyncronously */
gp11_slot_open_session_async (slot, CKF_RW_SESSION, NULL, NULL, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
new_session = gp11_slot_open_session_finish (slot, result, &err);
SUCCESS_RES (new_session, err);
@@ -307,7 +307,7 @@ DEFINE_TEST(auto_login)
result = NULL;
gp11_session_create_object_async (session, attrs, NULL, fetch_async_result, &result);
- test_wait_until (500);
+ testing_wait_until (500);
g_assert (result != NULL);
object = gp11_session_create_object_finish (session, result, &err);
SUCCESS_RES (object, err);
diff --git a/gp11/tests/unit-test-gp11-slot.c b/gp11/tests/unit-test-gp11-slot.c
index eaa679b..90eb6cd 100644
--- a/gp11/tests/unit-test-gp11-slot.c
+++ b/gp11/tests/unit-test-gp11-slot.c
@@ -2,7 +2,7 @@
#include <glib.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gp11-test.h"
static GP11Module *module = NULL;
diff --git a/pkcs11/gkm/tests/.gitignore b/pkcs11/gkm/tests/.gitignore
index 8178432..989f10e 100644
--- a/pkcs11/gkm/tests/.gitignore
+++ b/pkcs11/gkm/tests/.gitignore
@@ -1,7 +1,5 @@
-/run-auto-test.*
/asn1-def-test.h
/.*
/Makefile
/Makefile.in
-/run-auto-test
/dump-data-file
diff --git a/pkcs11/gkm/tests/Makefile.am b/pkcs11/gkm/tests/Makefile.am
index 6890297..e7fc9dc 100644
--- a/pkcs11/gkm/tests/Makefile.am
+++ b/pkcs11/gkm/tests/Makefile.am
@@ -3,7 +3,7 @@ asn1-def-test.h: test.asn
$(ASN1PARSER) -o asn1-def-test.h $(srcdir)/test.asn
# Test files should be listed in order they need to run
-UNIT_AUTO = \
+TESTING_FILES = \
unit-test-attributes.c \
unit-test-sexp.c \
unit-test-data-asn1.c \
@@ -23,7 +23,7 @@ UNIT_AUTO = \
UNIT_PROMPT =
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/pkcs11/gkm/libgkm.la \
$(top_builddir)/egg/libegg.la
@@ -31,7 +31,7 @@ EXTRA_DIST = \
test.asn \
test-data
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
# ---------------------------------------------------------------------
diff --git a/pkcs11/gkm/tests/test-module.c b/pkcs11/gkm/tests/test-module.c
index 9d8ff33..6a7a7d0 100644
--- a/pkcs11/gkm/tests/test-module.c
+++ b/pkcs11/gkm/tests/test-module.c
@@ -23,7 +23,7 @@
#include "config.h"
#include "test-module.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
/* Include all the module entry points */
#include "gkm/gkm-module-ep.h"
@@ -97,7 +97,7 @@ test_module_object_new (GkmSession *session)
GkmObject *object;
gsize n_data;
- guchar *data = test_data_read ("test-certificate-1.der", &n_data);
+ guchar *data = testing_data_read ("test-certificate-1.der", &n_data);
CK_ATTRIBUTE attrs[] = {
{ CKA_TOKEN, &token, sizeof (token) },
diff --git a/pkcs11/gkm/tests/unit-test-attributes.c b/pkcs11/gkm/tests/unit-test-attributes.c
index 6c62382..9a86c1b 100644
--- a/pkcs11/gkm/tests/unit-test-attributes.c
+++ b/pkcs11/gkm/tests/unit-test-attributes.c
@@ -21,7 +21,7 @@
Author: Stef Walter <stef memberwebs com>
*/
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-attributes.h"
diff --git a/pkcs11/gkm/tests/unit-test-credential.c b/pkcs11/gkm/tests/unit-test-credential.c
index 805f950..f40d7e5 100644
--- a/pkcs11/gkm/tests/unit-test-credential.c
+++ b/pkcs11/gkm/tests/unit-test-credential.c
@@ -21,7 +21,7 @@
Author: Stef Walter <stef memberwebs com>
*/
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-module.h"
#include "mock-locked-object.h"
diff --git a/pkcs11/gkm/tests/unit-test-data-asn1.c b/pkcs11/gkm/tests/unit-test-data-asn1.c
index 3ae9f65..ba5b542 100644
--- a/pkcs11/gkm/tests/unit-test-data-asn1.c
+++ b/pkcs11/gkm/tests/unit-test-data-asn1.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-data-asn1.h"
@@ -54,7 +54,7 @@ DEFINE_SETUP(asn1_tree)
/* -------- */
- data_cert = test_data_read ("test-certificate-1.der", &n_data_cert);
+ data_cert = testing_data_read ("test-certificate-1.der", &n_data_cert);
/* We'll be catching this error later */
pkix = egg_asn1_get_pkix_asn1type ();
diff --git a/pkcs11/gkm/tests/unit-test-data-der.c b/pkcs11/gkm/tests/unit-test-data-der.c
index 3e07598..bb7054f 100644
--- a/pkcs11/gkm/tests/unit-test-data-der.c
+++ b/pkcs11/gkm/tests/unit-test-data-der.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-crypto.h"
#include "gkm/gkm-data-asn1.h"
@@ -111,11 +111,11 @@ test_der_public (gcry_sexp_t key)
DEFINE_SETUP(preload)
{
- certificate_data = test_data_read ("test-certificate-1.der", &n_certificate_data);
+ certificate_data = testing_data_read ("test-certificate-1.der", &n_certificate_data);
certificate = egg_asn1_decode ("PKIX1.Certificate", certificate_data, n_certificate_data);
g_assert (certificate);
- certificate2_data = test_data_read ("test-certificate-2.der", &n_certificate2_data);
+ certificate2_data = testing_data_read ("test-certificate-2.der", &n_certificate2_data);
certificate2 = egg_asn1_decode ("PKIX1.Certificate", certificate2_data, n_certificate2_data);
g_assert (certificate2);
}
@@ -313,7 +313,7 @@ DEFINE_TEST(read_ca_certificates_public_key_info)
gpointer data;
gsize n_data;
- data = test_data_read ("ca-certificates.crt", &n_data);
+ data = testing_data_read ("ca-certificates.crt", &n_data);
egg_openssl_pem_parse (data, n_data, on_ca_certificate_public_key_info, NULL);
g_free (data);
}
@@ -412,7 +412,7 @@ DEFINE_TEST(read_all_pkcs8)
guchar *data;
gsize n_data;
- dir = g_dir_open (test_data_directory (), 0, NULL);
+ dir = g_dir_open (testing_data_directory (), 0, NULL);
g_assert (dir);
for(;;) {
@@ -423,7 +423,7 @@ DEFINE_TEST(read_all_pkcs8)
if (!g_pattern_match_simple ("der-pkcs8-*", name))
continue;
- data = test_data_read (name, &n_data);
+ data = testing_data_read (name, &n_data);
res = gkm_data_der_read_private_pkcs8 (data, n_data, "booo", 4, &sexp);
g_assert (res == GKM_DATA_SUCCESS);
@@ -442,7 +442,7 @@ DEFINE_TEST(read_pkcs8_bad_password)
guchar *data;
gsize n_data;
- data = test_data_read ("der-pkcs8-encrypted-pkcs5.key", &n_data);
+ data = testing_data_read ("der-pkcs8-encrypted-pkcs5.key", &n_data);
res = gkm_data_der_read_private_pkcs8 (data, n_data, "wrong password", 4, &sexp);
g_assert (res == GKM_DATA_LOCKED);
diff --git a/pkcs11/gkm/tests/unit-test-data-file.c b/pkcs11/gkm/tests/unit-test-data-file.c
index af95eab..48b1097 100644
--- a/pkcs11/gkm/tests/unit-test-data-file.c
+++ b/pkcs11/gkm/tests/unit-test-data-file.c
@@ -21,7 +21,7 @@
Author: Stef Walter <stef memberwebs com>
*/
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-data-file.h"
#include "gkm/gkm-object.h"
@@ -42,9 +42,9 @@ static GkmSecret *login = NULL;
DEFINE_SETUP(file_store)
{
- public_filename = test_data_filename ("data-file-public.store");
- private_filename = test_data_filename ("data-file-private.store");
- write_filename = test_scratch_filename ("unit-test-file.store");
+ public_filename = testing_data_filename ("data-file-public.store");
+ private_filename = testing_data_filename ("data-file-private.store");
+ write_filename = testing_scratch_filename ("unit-test-file.store");
data_file = gkm_data_file_new ();
diff --git a/pkcs11/gkm/tests/unit-test-file-tracker.c b/pkcs11/gkm/tests/unit-test-file-tracker.c
index 393032a..9d88aa4 100644
--- a/pkcs11/gkm/tests/unit-test-file-tracker.c
+++ b/pkcs11/gkm/tests/unit-test-file-tracker.c
@@ -26,7 +26,7 @@
#include <string.h>
#include <unistd.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-file-tracker.h"
diff --git a/pkcs11/gkm/tests/unit-test-memory-store.c b/pkcs11/gkm/tests/unit-test-memory-store.c
index 7a5a782..c7814ba 100644
--- a/pkcs11/gkm/tests/unit-test-memory-store.c
+++ b/pkcs11/gkm/tests/unit-test-memory-store.c
@@ -26,7 +26,7 @@
#include <string.h>
#include <unistd.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-module.h"
#include "gkm/gkm-object.h"
diff --git a/pkcs11/gkm/tests/unit-test-object.c b/pkcs11/gkm/tests/unit-test-object.c
index e3cf835..efe1115 100644
--- a/pkcs11/gkm/tests/unit-test-object.c
+++ b/pkcs11/gkm/tests/unit-test-object.c
@@ -21,7 +21,7 @@
Author: Stef Walter <stef memberwebs com>
*/
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-module.h"
#include "gkm/gkm-attributes.h"
@@ -41,7 +41,7 @@ DEFINE_SETUP(object_setup)
{
module = test_module_initialize_and_enter ();
session = test_module_open_session (TRUE);
- certificate_data = test_data_read ("test-certificate-1.der", &certificate_n_data);
+ certificate_data = testing_data_read ("test-certificate-1.der", &certificate_n_data);
}
DEFINE_TEARDOWN(object_teardown)
@@ -191,7 +191,7 @@ DEFINE_TEST(object_create_auto_destruct)
g_assert (memcmp (&lifetime, &check, sizeof (lifetime)) == 0);
test_module_leave ();
- test_wait_until (2200);
+ testing_wait_until (2200);
test_module_enter ();
g_assert (!check_object_exists (handle));
diff --git a/pkcs11/gkm/tests/unit-test-secret.c b/pkcs11/gkm/tests/unit-test-secret.c
index 4406cf0..d8e6ebe 100644
--- a/pkcs11/gkm/tests/unit-test-secret.c
+++ b/pkcs11/gkm/tests/unit-test-secret.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-secret.h"
diff --git a/pkcs11/gkm/tests/unit-test-sexp.c b/pkcs11/gkm/tests/unit-test-sexp.c
index 503e2c0..2253e71 100644
--- a/pkcs11/gkm/tests/unit-test-sexp.c
+++ b/pkcs11/gkm/tests/unit-test-sexp.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-crypto.h"
#include "gkm/gkm-sexp.h"
diff --git a/pkcs11/gkm/tests/unit-test-store.c b/pkcs11/gkm/tests/unit-test-store.c
index d6daabf..23db8a5 100644
--- a/pkcs11/gkm/tests/unit-test-store.c
+++ b/pkcs11/gkm/tests/unit-test-store.c
@@ -26,7 +26,7 @@
#include <string.h>
#include <unistd.h>
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-module.h"
#include "gkm/gkm-store.h"
diff --git a/pkcs11/gkm/tests/unit-test-timer.c b/pkcs11/gkm/tests/unit-test-timer.c
index 893c081..0159a55 100644
--- a/pkcs11/gkm/tests/unit-test-timer.c
+++ b/pkcs11/gkm/tests/unit-test-timer.c
@@ -21,7 +21,7 @@
Author: Stef Walter <stef memberwebs com>
*/
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-module.h"
#include "gkm/gkm-timer.h"
@@ -60,7 +60,7 @@ DEFINE_TEST(timer_simple)
timer = gkm_timer_start (module, 2, timer_callback, &timer);
test_module_leave ();
- test_wait_until (2200);
+ testing_wait_until (2200);
test_module_enter ();
g_assert (timer == NULL);
@@ -73,13 +73,13 @@ DEFINE_TEST(timer_cancel)
timer = gkm_timer_start (module, 2, timer_callback, &timer);
test_module_leave ();
- test_wait_until (500);
+ testing_wait_until (500);
test_module_enter ();
gkm_timer_cancel (timer);
test_module_leave ();
- test_wait_until (2000);
+ testing_wait_until (2000);
test_module_enter ();
/* The callback should not have been called */
@@ -97,7 +97,7 @@ DEFINE_TEST(timer_immediate)
g_assert (timer != NULL);
test_module_leave ();
- test_wait_until (50);
+ testing_wait_until (50);
test_module_enter ();
/* Should have been called now */
@@ -129,7 +129,7 @@ DEFINE_TEST(timer_multiple)
gkm_timer_start (module, 0, multiple_callback, GINT_TO_POINTER (0));
test_module_leave ();
- test_wait_until (3500);
+ testing_wait_until (3500);
test_module_enter ();
g_assert (timer_check == 4);
diff --git a/pkcs11/gkm/tests/unit-test-transaction.c b/pkcs11/gkm/tests/unit-test-transaction.c
index 41c9fb8..1b2b76f 100644
--- a/pkcs11/gkm/tests/unit-test-transaction.c
+++ b/pkcs11/gkm/tests/unit-test-transaction.c
@@ -21,7 +21,7 @@
Author: Stef Walter <stef memberwebs com>
*/
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-transaction.h"
@@ -190,7 +190,7 @@ DEFINE_TEST(transaction_dispose_completes)
DEFINE_TEST(remove_file_success)
{
GkmTransaction *transaction = gkm_transaction_new ();
- gchar *filename = test_scratch_filename ("remove-file");
+ gchar *filename = testing_scratch_filename ("remove-file");
g_assert (g_file_set_contents (filename, "xxx", 3, NULL));
g_assert (g_file_test (filename, G_FILE_TEST_IS_REGULAR));
@@ -210,7 +210,7 @@ DEFINE_TEST(remove_file_success)
DEFINE_TEST(remove_file_abort)
{
GkmTransaction *transaction = gkm_transaction_new ();
- gchar *filename = test_scratch_filename ("remove-file");
+ gchar *filename = testing_scratch_filename ("remove-file");
gchar *data;
gsize n_data;
@@ -242,7 +242,7 @@ DEFINE_TEST(remove_file_abort)
DEFINE_TEST(remove_file_non_exist)
{
GkmTransaction *transaction = gkm_transaction_new ();
- gchar *filename = test_scratch_filename ("remove-non-existant");
+ gchar *filename = testing_scratch_filename ("remove-non-existant");
g_unlink (filename);
@@ -258,7 +258,7 @@ DEFINE_TEST(remove_file_non_exist)
DEFINE_TEST(write_file)
{
GkmTransaction *transaction = gkm_transaction_new ();
- gchar *filename = test_scratch_filename ("write-test");
+ gchar *filename = testing_scratch_filename ("write-test");
gchar *data;
gsize n_data;
@@ -284,7 +284,7 @@ DEFINE_TEST(write_file)
DEFINE_TEST(write_file_abort_gone)
{
GkmTransaction *transaction = gkm_transaction_new ();
- gchar *filename = test_scratch_filename ("write-test");
+ gchar *filename = testing_scratch_filename ("write-test");
gchar *data;
gsize n_data;
@@ -310,7 +310,7 @@ DEFINE_TEST(write_file_abort_gone)
DEFINE_TEST(write_file_abort_revert)
{
GkmTransaction *transaction = gkm_transaction_new ();
- gchar *filename = test_scratch_filename ("write-test");
+ gchar *filename = testing_scratch_filename ("write-test");
gchar *data;
g_assert (g_file_set_contents (filename, "my original", -1, NULL));
diff --git a/pkcs11/roots-store/tests/Makefile.am b/pkcs11/roots-store/tests/Makefile.am
index 89ed910..9fbbbee 100644
--- a/pkcs11/roots-store/tests/Makefile.am
+++ b/pkcs11/roots-store/tests/Makefile.am
@@ -1,15 +1,15 @@
-UNIT_AUTO = \
+TESTING_FILES = \
test-module.c
UNIT_PROMPT =
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/pkcs11/roots-store/libgkm-roots-store.la \
$(top_builddir)/pkcs11/gkm/libgkm.la \
$(top_builddir)/egg/libegg.la
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
EXTRA_DIST = \
test-data \
diff --git a/pkcs11/roots-store/tests/test-module.c b/pkcs11/roots-store/tests/test-module.c
index ec0bebe..8431d74 100644
--- a/pkcs11/roots-store/tests/test-module.c
+++ b/pkcs11/roots-store/tests/test-module.c
@@ -25,10 +25,10 @@
#include "roots-store/gkm-roots-store.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
DEFINE_EXTERNAL(roots_module)
{
CK_FUNCTION_LIST_PTR funcs = gkm_roots_store_get_functions ();
- test_p11_module (funcs, "p11-tests.conf");
+ testing_test_p11_module (funcs, "p11-tests.conf");
}
diff --git a/pkcs11/secret-store/tests/.gitignore b/pkcs11/secret-store/tests/.gitignore
index 17416be..67cbf79 100644
--- a/pkcs11/secret-store/tests/.gitignore
+++ b/pkcs11/secret-store/tests/.gitignore
@@ -1,4 +1,3 @@
-run-auto-test*
.libs
.deps
diff --git a/pkcs11/secret-store/tests/Makefile.am b/pkcs11/secret-store/tests/Makefile.am
index 144808b..74edf7f 100644
--- a/pkcs11/secret-store/tests/Makefile.am
+++ b/pkcs11/secret-store/tests/Makefile.am
@@ -1,4 +1,4 @@
-UNIT_AUTO = \
+TESTING_FILES = \
unit-test-secret-compat.c \
unit-test-secret-fields.c \
unit-test-secret-data.c \
@@ -12,7 +12,7 @@ UNIT_AUTO = \
UNIT_PROMPT =
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/pkcs11/secret-store/libgkm-secret-store.la \
$(top_builddir)/pkcs11/gkm/libgkm.la \
$(top_builddir)/egg/libegg.la
@@ -20,4 +20,4 @@ UNIT_LIBS = \
EXTRA_DIST = \
test-data
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
diff --git a/pkcs11/secret-store/tests/test-secret-module.c b/pkcs11/secret-store/tests/test-secret-module.c
index 7eb7141..e145b60 100644
--- a/pkcs11/secret-store/tests/test-secret-module.c
+++ b/pkcs11/secret-store/tests/test-secret-module.c
@@ -23,7 +23,7 @@
#include "config.h"
#include "test-secret-module.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm/gkm-secret.h"
#include "gkm/gkm-module.h"
@@ -49,14 +49,14 @@ copy_scratch_file (const gchar *basename)
gchar *data;
gsize n_data;
- filename = test_data_filename (basename);
+ filename = testing_data_filename (basename);
if (!g_file_get_contents (filename, &data, &n_data, NULL)) {
g_warning ("couldn't read: %s", filename);
g_return_if_reached ();
}
g_free (filename);
- filename = test_scratch_filename (basename);
+ filename = testing_scratch_filename (basename);
if (!g_file_set_contents (filename, data, n_data, NULL))
g_return_if_reached ();
g_free (filename);
@@ -74,7 +74,7 @@ test_secret_module_initialize_and_enter (void)
/* Setup test directory to work in */
memset (&args, 0, sizeof (args));
- string = g_strdup_printf ("directory='%s'", test_scratch_directory ());
+ string = g_strdup_printf ("directory='%s'", testing_scratch_directory ());
args.pReserved = string;
args.flags = CKF_OS_LOCKING_OK;
@@ -213,10 +213,10 @@ test_secret_collection_validate (GkmSecretCollection *collection, GkmSecretData
/* "Invalid ACL" */
g_assert (ac && ac->application);
/* "Invalid ACL Path" */
- g_assert (ac->application->pathname && strstr (ac->application->pathname, "run-auto-test"));
+ g_assert (ac->application->pathname && strstr (ac->application->pathname, "test-framework"));
/* "Invalid ACL Display Name" */
g_assert (ac->application->display_name);
- g_assert_cmpstr (ac->application->display_name, ==, "run-auto-test");
+ g_assert_cmpstr (ac->application->display_name, ==, "test-framework");
/* "Invalid ACL Access Type" */
g_assert_cmpint (ac->types_allowed, ==, (GNOME_KEYRING_ACCESS_READ | GNOME_KEYRING_ACCESS_WRITE | GNOME_KEYRING_ACCESS_REMOVE));
#endif
diff --git a/pkcs11/secret-store/tests/unit-test-secret-binary.c b/pkcs11/secret-store/tests/unit-test-secret-binary.c
index dca0347..7b9c359 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-binary.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-binary.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-secret-module.h"
#include "gkm-secret-binary.h"
@@ -90,7 +90,7 @@ DEFINE_TEST(binary_read)
guchar *data;
gsize n_data;
- data = test_data_read ("encrypted.keyring", &n_data);
+ data = testing_data_read ("encrypted.keyring", &n_data);
res = gkm_secret_binary_read (collection, sdata, data, n_data);
g_free (data);
@@ -105,7 +105,7 @@ DEFINE_TEST(binary_read_wrong_format)
guchar *data;
gsize n_data;
- data = test_data_read ("plain.keyring", &n_data);
+ data = testing_data_read ("plain.keyring", &n_data);
res = gkm_secret_binary_read (collection, sdata, data, n_data);
g_free (data);
@@ -123,7 +123,7 @@ DEFINE_TEST(binary_read_wrong_master)
gkm_secret_data_set_master (sdata, master);
g_object_unref (master);
- data = test_data_read ("encrypted.keyring", &n_data);
+ data = testing_data_read ("encrypted.keyring", &n_data);
res = gkm_secret_binary_read (collection, sdata, data, n_data);
g_free (data);
@@ -138,7 +138,7 @@ DEFINE_TEST(binary_read_sdata_but_no_master)
gkm_secret_data_set_master (sdata, NULL);
- data = test_data_read ("encrypted.keyring", &n_data);
+ data = testing_data_read ("encrypted.keyring", &n_data);
res = gkm_secret_binary_read (collection, sdata, data, n_data);
g_free (data);
@@ -170,7 +170,7 @@ DEFINE_TEST(binary_remove_unavailable)
guchar *data;
gsize n_data;
- data = test_data_read ("encrypted.keyring", &n_data);
+ data = testing_data_read ("encrypted.keyring", &n_data);
res = gkm_secret_binary_read (collection, sdata, data, n_data);
g_assert (res == GKM_DATA_SUCCESS);
diff --git a/pkcs11/secret-store/tests/unit-test-secret-collection.c b/pkcs11/secret-store/tests/unit-test-secret-collection.c
index 39a8285..533d1a2 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-collection.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-collection.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-secret-module.h"
#include "gkm-secret-data.h"
@@ -164,7 +164,7 @@ DEFINE_TEST(secret_collection_load_unlock_plain)
gchar *filename;
CK_RV rv;
- filename = test_data_filename ("plain.keyring");
+ filename = testing_data_filename ("plain.keyring");
gkm_secret_collection_set_filename (collection, filename);
g_free (filename);
@@ -192,7 +192,7 @@ DEFINE_TEST(secret_collection_load_unlock_encrypted)
gchar *filename;
CK_RV rv;
- filename = test_data_filename ("encrypted.keyring");
+ filename = testing_data_filename ("encrypted.keyring");
gkm_secret_collection_set_filename (collection, filename);
g_free (filename);
@@ -220,7 +220,7 @@ DEFINE_TEST(secret_collection_load_unlock_bad_password)
gchar *filename;
CK_RV rv;
- filename = test_data_filename ("encrypted.keyring");
+ filename = testing_data_filename ("encrypted.keyring");
gkm_secret_collection_set_filename (collection, filename);
g_free (filename);
@@ -241,7 +241,7 @@ DEFINE_TEST(secret_collection_unlock_without_load)
gchar *filename;
CK_RV rv;
- filename = test_data_filename ("encrypted.keyring");
+ filename = testing_data_filename ("encrypted.keyring");
gkm_secret_collection_set_filename (collection, filename);
g_free (filename);
@@ -265,7 +265,7 @@ DEFINE_TEST(secret_collection_twice_unlock)
gchar *filename;
CK_RV rv;
- filename = test_data_filename ("encrypted.keyring");
+ filename = testing_data_filename ("encrypted.keyring");
gkm_secret_collection_set_filename (collection, filename);
g_free (filename);
@@ -296,7 +296,7 @@ DEFINE_TEST(secret_collection_twice_unlock_bad_password)
gchar *filename;
CK_RV rv;
- filename = test_data_filename ("encrypted.keyring");
+ filename = testing_data_filename ("encrypted.keyring");
gkm_secret_collection_set_filename (collection, filename);
g_free (filename);
diff --git a/pkcs11/secret-store/tests/unit-test-secret-compat.c b/pkcs11/secret-store/tests/unit-test-secret-compat.c
index 96629fd..ade7a3d 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-compat.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-compat.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm-secret-compat.h"
diff --git a/pkcs11/secret-store/tests/unit-test-secret-data.c b/pkcs11/secret-store/tests/unit-test-secret-data.c
index eacb76e..c8c9775 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-data.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-data.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm-secret-data.h"
diff --git a/pkcs11/secret-store/tests/unit-test-secret-fields.c b/pkcs11/secret-store/tests/unit-test-secret-fields.c
index f74b49d..454c2a9 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-fields.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-fields.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm-secret-fields.h"
diff --git a/pkcs11/secret-store/tests/unit-test-secret-item.c b/pkcs11/secret-store/tests/unit-test-secret-item.c
index f804b88..0ac53eb 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-item.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-item.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-secret-module.h"
#include "gkm-secret-collection.h"
diff --git a/pkcs11/secret-store/tests/unit-test-secret-object.c b/pkcs11/secret-store/tests/unit-test-secret-object.c
index ae7e694..7c7f589 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-object.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-object.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-secret-module.h"
#include "gkm-secret-object.h"
diff --git a/pkcs11/secret-store/tests/unit-test-secret-search.c b/pkcs11/secret-store/tests/unit-test-secret-search.c
index 6b57089..99d1337 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-search.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-search.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-secret-module.h"
#include "gkm-secret-collection.h"
diff --git a/pkcs11/secret-store/tests/unit-test-secret-textual.c b/pkcs11/secret-store/tests/unit-test-secret-textual.c
index 3e94005..2493aed 100644
--- a/pkcs11/secret-store/tests/unit-test-secret-textual.c
+++ b/pkcs11/secret-store/tests/unit-test-secret-textual.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-secret-module.h"
#include "gkm-secret-collection.h"
@@ -85,7 +85,7 @@ DEFINE_TEST(textual_read)
guchar *data;
gsize n_data;
- data = test_data_read ("plain.keyring", &n_data);
+ data = testing_data_read ("plain.keyring", &n_data);
res = gkm_secret_textual_read (collection, sdata, data, n_data);
g_free (data);
@@ -100,7 +100,7 @@ DEFINE_TEST(textual_read_wrong_format)
guchar *data;
gsize n_data;
- data = test_data_read ("encrypted.keyring", &n_data);
+ data = testing_data_read ("encrypted.keyring", &n_data);
res = gkm_secret_textual_read (collection, sdata, data, n_data);
g_free (data);
@@ -115,7 +115,7 @@ DEFINE_TEST(textual_read_bad_number)
guchar *data;
gsize n_data;
- data = test_data_read ("plain-bad-number.keyring", &n_data);
+ data = testing_data_read ("plain-bad-number.keyring", &n_data);
res = gkm_secret_textual_read (collection, sdata, data, n_data);
g_free (data);
@@ -154,7 +154,7 @@ DEFINE_TEST(textual_remove_unavailable)
guchar *data;
gsize n_data;
- data = test_data_read ("plain.keyring", &n_data);
+ data = testing_data_read ("plain.keyring", &n_data);
res = gkm_secret_textual_read (collection, sdata, data, n_data);
g_assert (res == GKM_DATA_SUCCESS);
diff --git a/pkcs11/ssh-store/tests/.gitignore b/pkcs11/ssh-store/tests/.gitignore
index 5829e75..9f3b297 100644
--- a/pkcs11/ssh-store/tests/.gitignore
+++ b/pkcs11/ssh-store/tests/.gitignore
@@ -1,6 +1,4 @@
-/run-auto-test.*
.deps
.libs
/Makefile
/Makefile.in
-/run-auto-test
diff --git a/pkcs11/ssh-store/tests/Makefile.am b/pkcs11/ssh-store/tests/Makefile.am
index eaccd14..ff53cb8 100644
--- a/pkcs11/ssh-store/tests/Makefile.am
+++ b/pkcs11/ssh-store/tests/Makefile.am
@@ -1,16 +1,16 @@
-UNIT_AUTO = \
+TESTING_FILES = \
unit-test-ssh-openssh.c \
unit-test-private-key.c \
test-ssh-module.c test-ssh-module.h
UNIT_PROMPT =
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/pkcs11/ssh-store/libgkm-ssh-store.la \
$(top_builddir)/pkcs11/gkm/libgkm.la \
$(top_builddir)/egg/libegg.la
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
EXTRA_DIST = \
test-data
diff --git a/pkcs11/ssh-store/tests/test-ssh-module.c b/pkcs11/ssh-store/tests/test-ssh-module.c
index 437f80d..03910d6 100644
--- a/pkcs11/ssh-store/tests/test-ssh-module.c
+++ b/pkcs11/ssh-store/tests/test-ssh-module.c
@@ -28,7 +28,7 @@
#include "ssh-store/gkm-ssh-store.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
static GMutex *mutex = NULL;
@@ -109,5 +109,5 @@ test_ssh_module_open_session (gboolean writable)
DEFINE_EXTERNAL(ssh_module)
{
CK_FUNCTION_LIST_PTR funcs = gkm_ssh_store_get_functions ();
- test_p11_module (funcs, "p11-tests.conf");
+ testing_test_p11_module (funcs, "p11-tests.conf");
}
diff --git a/pkcs11/ssh-store/tests/unit-test-private-key.c b/pkcs11/ssh-store/tests/unit-test-private-key.c
index 5618929..f74783e 100644
--- a/pkcs11/ssh-store/tests/unit-test-private-key.c
+++ b/pkcs11/ssh-store/tests/unit-test-private-key.c
@@ -21,7 +21,7 @@
Author: Stef Walter <stef memberwebs com>
*/
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "test-ssh-module.h"
#include "gkm/gkm-credential.h"
@@ -57,8 +57,8 @@ DEFINE_TEST(private_key_parse_plain)
key = gkm_ssh_private_key_new (module, "my-unique");
g_assert (GKM_IS_SSH_PRIVATE_KEY (key));
- pub_path = test_data_filename ("id_dsa_plain.pub");
- priv_path = test_data_filename ("id_dsa_plain");
+ pub_path = testing_data_filename ("id_dsa_plain.pub");
+ priv_path = testing_data_filename ("id_dsa_plain");
ret = gkm_ssh_private_key_parse (key, pub_path, priv_path, NULL);
g_assert (ret == TRUE);
@@ -80,8 +80,8 @@ DEFINE_TEST(private_key_parse_and_unlock)
key = gkm_ssh_private_key_new (module, "my-unique");
g_assert (GKM_IS_SSH_PRIVATE_KEY (key));
- pub_path = test_data_filename ("id_dsa_encrypted.pub");
- priv_path = test_data_filename ("id_dsa_encrypted");
+ pub_path = testing_data_filename ("id_dsa_encrypted.pub");
+ priv_path = testing_data_filename ("id_dsa_encrypted");
ret = gkm_ssh_private_key_parse (key, pub_path, priv_path, NULL);
g_assert (ret == TRUE);
diff --git a/pkcs11/ssh-store/tests/unit-test-ssh-openssh.c b/pkcs11/ssh-store/tests/unit-test-ssh-openssh.c
index ee86cca..3ead3d9 100644
--- a/pkcs11/ssh-store/tests/unit-test-ssh-openssh.c
+++ b/pkcs11/ssh-store/tests/unit-test-ssh-openssh.c
@@ -23,7 +23,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gkm-ssh-openssh.h"
@@ -63,7 +63,7 @@ DEFINE_TEST(parse_public)
for (i = 0; i < G_N_ELEMENTS (PUBLIC_FILES); ++i) {
- data = test_data_read (PUBLIC_FILES[i], &n_data);
+ data = testing_data_read (PUBLIC_FILES[i], &n_data);
res = gkm_ssh_openssh_parse_public_key (data, n_data, &sexp, &comment);
if (res != GKM_DATA_SUCCESS) {
@@ -97,7 +97,7 @@ DEFINE_TEST(parse_private)
for (i = 0; i < G_N_ELEMENTS (PRIVATE_FILES); ++i) {
- data = test_data_read (PRIVATE_FILES[i], &n_data);
+ data = testing_data_read (PRIVATE_FILES[i], &n_data);
res = gkm_ssh_openssh_parse_private_key (data, n_data, "password", 8, &sexp);
if (res != GKM_DATA_SUCCESS) {
diff --git a/pkcs11/user-store/tests/Makefile.am b/pkcs11/user-store/tests/Makefile.am
index 4420bf4..ac1058a 100644
--- a/pkcs11/user-store/tests/Makefile.am
+++ b/pkcs11/user-store/tests/Makefile.am
@@ -1,15 +1,15 @@
-UNIT_AUTO = \
+TESTING_FILES = \
test-module.c
UNIT_PROMPT =
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/pkcs11/user-store/libgkm-user-store.la \
$(top_builddir)/pkcs11/gkm/libgkm.la \
$(top_builddir)/egg/libegg.la
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
EXTRA_DIST = \
test-data \
diff --git a/pkcs11/user-store/tests/test-module.c b/pkcs11/user-store/tests/test-module.c
index ab3562b..b99369e 100644
--- a/pkcs11/user-store/tests/test-module.c
+++ b/pkcs11/user-store/tests/test-module.c
@@ -25,10 +25,10 @@
#include "user-store/gkm-user-store.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
DEFINE_EXTERNAL(user_module)
{
CK_FUNCTION_LIST_PTR funcs = gkm_user_store_get_functions ();
- test_p11_module (funcs, "p11-tests.conf");
+ testing_test_p11_module (funcs, "p11-tests.conf");
}
diff --git a/pkcs11/wrap-layer/tests/Makefile.am b/pkcs11/wrap-layer/tests/Makefile.am
index 9fcf2b4..79e6cb7 100644
--- a/pkcs11/wrap-layer/tests/Makefile.am
+++ b/pkcs11/wrap-layer/tests/Makefile.am
@@ -1,16 +1,13 @@
-UNIT_AUTO = \
+TESTING_FILES = \
test-prompt-login.c
UNIT_PROMPT =
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/pkcs11/wrap-layer/libgkm-wrap-layer.la \
$(top_builddir)/pkcs11/gkm/libgkm.la \
$(top_builddir)/ui/libgku-prompt.la \
$(top_builddir)/egg/libegg.la
-include $(top_srcdir)/tests/gtest.make
-
-EXTRA_DIST = \
- test-data
\ No newline at end of file
+include $(top_srcdir)/testing/testing.make
\ No newline at end of file
diff --git a/pkcs11/wrap-layer/tests/test-prompt-login.c b/pkcs11/wrap-layer/tests/test-prompt-login.c
index ee2ff97..4c9c46b 100644
--- a/pkcs11/wrap-layer/tests/test-prompt-login.c
+++ b/pkcs11/wrap-layer/tests/test-prompt-login.c
@@ -21,7 +21,7 @@
#include "config.h"
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "egg/egg-secure-memory.h"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 21ec904..c90f557 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -24,5 +24,6 @@ gp11/gp11-misc.c
pkcs11/gkm/gkm-certificate.c
pkcs11/ssh-store/gkm-ssh-private-key.c
pkcs11/secret-store/gkm-secret-collection.c
+pkcs11/wrap-layer/gkm-wrap-prompt.c
ui/gku-prompt-tool.c
[type: gettext/glade]ui/gku-prompt.ui
diff --git a/tests/.gitignore b/testing/.gitignore
similarity index 100%
rename from tests/.gitignore
rename to testing/.gitignore
diff --git a/testing/Makefile.am b/testing/Makefile.am
new file mode 100644
index 0000000..82bb215
--- /dev/null
+++ b/testing/Makefile.am
@@ -0,0 +1,19 @@
+
+EXTRA_DIST = \
+ ca-example \
+ testing.c testing.h \
+ testing-build.sh \
+ testing.make
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ $(GTK_CFLAGS) \
+ $(GLIB_CFLAGS)
+
+LIBS = \
+ $(GTK_LIBS) \
+ $(GLIB_LIBS) \
+ $(GTHREAD_LIBS)
+
+noinst_PROGRAMS =
diff --git a/tests/ca-example/certs/ca.crt b/testing/ca-example/certs/ca.crt
similarity index 100%
rename from tests/ca-example/certs/ca.crt
rename to testing/ca-example/certs/ca.crt
diff --git a/tests/ca-example/certs/client.crt b/testing/ca-example/certs/client.crt
similarity index 100%
rename from tests/ca-example/certs/client.crt
rename to testing/ca-example/certs/client.crt
diff --git a/tests/ca-example/certs/email.crt b/testing/ca-example/certs/email.crt
similarity index 100%
rename from tests/ca-example/certs/email.crt
rename to testing/ca-example/certs/email.crt
diff --git a/tests/ca-example/certs/generic-dsa.crt b/testing/ca-example/certs/generic-dsa.crt
similarity index 100%
rename from tests/ca-example/certs/generic-dsa.crt
rename to testing/ca-example/certs/generic-dsa.crt
diff --git a/tests/ca-example/database.txt b/testing/ca-example/database.txt
similarity index 100%
rename from tests/ca-example/database.txt
rename to testing/ca-example/database.txt
diff --git a/tests/ca-example/keys/ca.key b/testing/ca-example/keys/ca.key
similarity index 100%
rename from tests/ca-example/keys/ca.key
rename to testing/ca-example/keys/ca.key
diff --git a/tests/ca-example/keys/client.key b/testing/ca-example/keys/client.key
similarity index 100%
rename from tests/ca-example/keys/client.key
rename to testing/ca-example/keys/client.key
diff --git a/tests/ca-example/keys/dsa.params b/testing/ca-example/keys/dsa.params
similarity index 100%
rename from tests/ca-example/keys/dsa.params
rename to testing/ca-example/keys/dsa.params
diff --git a/tests/ca-example/keys/email.key b/testing/ca-example/keys/email.key
similarity index 100%
rename from tests/ca-example/keys/email.key
rename to testing/ca-example/keys/email.key
diff --git a/tests/ca-example/keys/generic-dsa.key b/testing/ca-example/keys/generic-dsa.key
similarity index 100%
rename from tests/ca-example/keys/generic-dsa.key
rename to testing/ca-example/keys/generic-dsa.key
diff --git a/tests/ca-example/profiles/ca.conf b/testing/ca-example/profiles/ca.conf
similarity index 96%
rename from tests/ca-example/profiles/ca.conf
rename to testing/ca-example/profiles/ca.conf
index 2bb1987..f28d954 100644
--- a/tests/ca-example/profiles/ca.conf
+++ b/testing/ca-example/profiles/ca.conf
@@ -1,6 +1,6 @@
[ req ]
distinguished_name = req_distinguished_name
-x509_extensions = v3_ca
+x509_extensions = v3_ca
string_mask = nombstr
diff --git a/tests/ca-example/profiles/extensions.conf b/testing/ca-example/profiles/extensions.conf
similarity index 100%
rename from tests/ca-example/profiles/extensions.conf
rename to testing/ca-example/profiles/extensions.conf
diff --git a/tests/ca-example/profiles/request.conf b/testing/ca-example/profiles/request.conf
similarity index 100%
rename from tests/ca-example/profiles/request.conf
rename to testing/ca-example/profiles/request.conf
diff --git a/tests/ca-example/requests/client.req b/testing/ca-example/requests/client.req
similarity index 100%
rename from tests/ca-example/requests/client.req
rename to testing/ca-example/requests/client.req
diff --git a/tests/ca-example/requests/email.req b/testing/ca-example/requests/email.req
similarity index 100%
rename from tests/ca-example/requests/email.req
rename to testing/ca-example/requests/email.req
diff --git a/tests/ca-example/requests/generic-dsa.req b/testing/ca-example/requests/generic-dsa.req
similarity index 100%
rename from tests/ca-example/requests/generic-dsa.req
rename to testing/ca-example/requests/generic-dsa.req
diff --git a/tests/ca-example/serial.txt b/testing/ca-example/serial.txt
similarity index 100%
rename from tests/ca-example/serial.txt
rename to testing/ca-example/serial.txt
diff --git a/tests/prep-gtest.sh b/testing/testing-build.sh
similarity index 84%
rename from tests/prep-gtest.sh
rename to testing/testing-build.sh
index f8d0ed8..153f079 100755
--- a/tests/prep-gtest.sh
+++ b/testing/testing-build.sh
@@ -3,16 +3,16 @@
set -eu
# --------------------------------------------------------------------
-# FUNCTIONS
+# FUNCTIONS
usage()
{
- echo "usage: prep-gtest.sh -b base-name files.c ..." >&2
+ echo "usage: testing-build.sh -b base-name files.c ..." >&2
exit 2
}
# --------------------------------------------------------------------
-# SOURCE FILE
+# SOURCE FILE
file_to_name()
{
@@ -22,9 +22,9 @@ file_to_name()
build_header()
{
local _file
-
+
echo '/* This is auto-generated code. Edit at your own peril. */'
- echo '#include "tests/gtest-helpers.h"'
+ echo '#include "testing/testing.h"'
echo
for _file in $@; do
@@ -41,9 +41,9 @@ build_header()
build_source()
{
local _tcases _file _name _setup _teardown
-
+
echo '/* This is auto-generated code. Edit at your own peril. */'
- echo "#include \"tests/gtest-helpers.h\""
+ echo "#include \"testing/testing.h\""
echo "#include \"$BASE.h\""
echo
@@ -67,9 +67,9 @@ build_source()
# Include each file, and build a test case for it
_tcases=""
for _file in $@; do
- _name=`file_to_name $_file`
-
- # Calculate what our setup and teardowns are.
+ _name=`file_to_name $_file`
+
+ # Calculate what our setup and teardowns are.
_setup=`sed -ne 's/.*DEFINE_SETUP[ ]*(\([^)]\+\)).*/setup_\1/p' $_file || echo "NULL"`
if [ -z "$_setup" ]; then
_setup="NULL"
@@ -79,10 +79,10 @@ build_source()
if [ -z "$_teardown" ]; then
_teardown="NULL"
fi
-
- # Add all tests to the test case
+
+ # Add all tests to the test case
sed -ne "s/.*DEFINE_TEST[ ]*(\([^)]\+\)).*/ g_test_add(\"\/$_name\/\1\", int, NULL, $_setup, test_\1, $_teardown);/p" $_file
-
+
done
echo "}"
echo
@@ -90,7 +90,7 @@ build_source()
# External function
echo "static void run_externals (void) {"
for _file in $@; do
- sed -ne "s/.*DEFINE_EXTERNAL[ ]*(\([^)]\+\)).*/ test_external_run (\"\1\", external_\1);/p" $_file
+ sed -ne "s/.*DEFINE_EXTERNAL[ ]*(\([^)]\+\)).*/ testing_external_run (\"\1\", external_\1);/p" $_file
done
echo "}"
echo
@@ -105,7 +105,7 @@ build_source()
echo " return ret;"
echo "}"
- echo "#include \"tests/gtest-helpers.c\""
+ echo "#include \"testing/testing.c\""
}
# --------------------------------------------------------------------
@@ -118,7 +118,7 @@ while [ $# -gt 0 ]; do
-b)
BASE="$2"
shift
- ;;
+ ;;
--)
shift
break
@@ -132,6 +132,6 @@ while [ $# -gt 0 ]; do
esac
shift
done
-
+
build_header $* > $BASE.h
build_source $* > $BASE.c
diff --git a/tests/gtest-helpers.c b/testing/testing.c
similarity index 85%
rename from tests/gtest-helpers.c
rename to testing/testing.c
index e470676..5c26c5f 100644
--- a/tests/gtest-helpers.c
+++ b/testing/testing.c
@@ -33,7 +33,7 @@
#include <string.h>
#include <errno.h>
-#include "gtest-helpers.h"
+#include "testing.h"
#include "egg/egg-error.h"
#include "egg/egg-secure-memory.h"
@@ -45,7 +45,7 @@
#endif
/* Forward declaration */
-void test_p11_module (CK_FUNCTION_LIST_PTR module, const gchar *config);
+void testing_test_p11_module (CK_FUNCTION_LIST_PTR module, const gchar *config);
static const gchar *test_path = NULL;
@@ -56,7 +56,7 @@ static GMutex *wait_mutex = NULL;
static gboolean wait_waiting = FALSE;
void
-test_wait_stop (void)
+testing_wait_stop (void)
{
g_assert (wait_mutex);
g_assert (wait_condition);
@@ -67,7 +67,7 @@ test_wait_stop (void)
}
gboolean
-test_wait_until (int timeout)
+testing_wait_until (int timeout)
{
GTimeVal tv;
gboolean ret;
@@ -86,28 +86,28 @@ test_wait_until (int timeout)
g_mutex_unlock (wait_mutex);
return ret;
-}
+}
const gchar*
-test_scratch_directory (void)
+testing_scratch_directory (void)
{
return test_path;
}
gchar*
-test_scratch_filename (const gchar *basename)
+testing_scratch_filename (const gchar *basename)
{
return g_build_filename (test_path, basename, NULL);
}
gchar*
-test_data_filename (const gchar *basename)
+testing_data_filename (const gchar *basename)
{
- return g_build_filename (test_data_directory (), basename, NULL);
+ return g_build_filename (testing_data_directory (), basename, NULL);
}
const gchar*
-test_data_directory (void)
+testing_data_directory (void)
{
const gchar *dir;
gchar *cur, *env;
@@ -129,14 +129,14 @@ test_data_directory (void)
return dir;
}
-guchar*
-test_data_read (const gchar *basename, gsize *n_result)
+guchar*
+testing_data_read (const gchar *basename, gsize *n_result)
{
GError *error = NULL;
gchar *result;
gchar *file;
- file = test_data_filename (basename);
+ file = testing_data_filename (basename);
if (!g_file_get_contents (file, &result, n_result, &error)) {
g_warning ("could not read test data file: %s: %s", file,
egg_error_message (error));
@@ -157,13 +157,13 @@ on_p11_tests_log (int level, const char *section, const char *message)
} else if (level != P11_TESTS_FAIL) {
g_message ("%s: %s", section, message);
} else {
- g_print ("/%s/%s: FAIL: %s\n", test_external_name (), section, message);
- test_external_fail ();
+ g_print ("/%s/%s: FAIL: %s\n", testing_external_name (), section, message);
+ testing_external_fail ();
}
}
void
-test_p11_module (CK_FUNCTION_LIST_PTR module, const gchar *config)
+testing_test_p11_module (CK_FUNCTION_LIST_PTR module, const gchar *config)
{
p11_tests_set_log_func (on_p11_tests_log);
p11_tests_set_unexpected (1);
@@ -177,7 +177,7 @@ test_p11_module (CK_FUNCTION_LIST_PTR module, const gchar *config)
#else /* !WITH_P11_TESTS */
void
-test_p11_module (CK_FUNCTION_LIST_PTR module, const gchar *config)
+testing_test_p11_module (CK_FUNCTION_LIST_PTR module, const gchar *config)
{
g_message ("p11-tests support not built in");
}
@@ -188,7 +188,7 @@ static const gchar *external_name = NULL;
static gint external_fails = 0;
void
-test_external_run (const gchar *name, TestExternalFunc func)
+testing_external_run (const gchar *name, TestingExternalFunc func)
{
external_fails = 0;
external_name = name;
@@ -200,27 +200,27 @@ test_external_run (const gchar *name, TestExternalFunc func)
}
const gchar*
-test_external_name (void)
+testing_external_name (void)
{
return external_name;
}
void
-test_external_fail (void)
+testing_external_fail (void)
{
++external_fails;
}
-static void
+static void
chdir_base_dir (char* argv0)
{
gchar *dir, *base;
dir = g_path_get_dirname (argv0);
if (chdir (dir) < 0)
- g_warning ("couldn't change directory to: %s: %s",
+ g_warning ("couldn't change directory to: %s: %s",
dir, g_strerror (errno));
-
+
base = g_path_get_basename (dir);
if (strcmp (base, ".libs") == 0) {
if (chdir ("..") < 0)
diff --git a/tests/gtest-helpers.h b/testing/testing.h
similarity index 65%
rename from tests/gtest-helpers.h
rename to testing/testing.h
index c2d05a1..eaa7287 100644
--- a/tests/gtest-helpers.h
+++ b/testing/testing.h
@@ -1,5 +1,5 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* gtest-helpers.h: Declarations for common functions called from gtest unit tests
+/* testing.h: Declarations for common functions called from gtest unit tests
Copyright (C) 2008 Stefan Walter
@@ -21,8 +21,8 @@
Author: Stef Walter <stef memberwebs com>
*/
-#ifndef GTEST_HELPERS_H_
-#define GTEST_HELPERS_H_
+#ifndef TESTING_H_
+#define TESTING_H_
#include "config.h"
@@ -35,24 +35,36 @@
#include <string.h>
#include <unistd.h>
-gboolean test_wait_until (gint timeout);
-void test_wait_stop (void);
+gboolean testing_wait_until (gint timeout);
-const gchar* test_data_directory (void);
-const gchar* test_scratch_directory (void);
-guchar* test_data_read (const gchar *basename, gsize *n_data);
-gchar* test_scratch_filename (const gchar *basename);
-gchar* test_data_filename (const gchar *basename);
+void testing_wait_stop (void);
+
+const gchar* testing_data_directory (void);
+
+const gchar* testing_scratch_directory (void);
+
+guchar* testing_data_read (const gchar *basename,
+ gsize *n_data);
+
+gchar* testing_scratch_filename (const gchar *basename);
+
+gchar* testing_data_filename (const gchar *basename);
#ifdef CRYPTOKI_VERSION_MAJOR
-void test_p11_module (CK_FUNCTION_LIST_PTR module, const gchar *config);
+
+void testing_test_p11_module (CK_FUNCTION_LIST_PTR module,
+ const gchar *config);
+
#endif
+typedef void (*TestingExternalFunc) (void);
+
+void testing_external_run (const gchar *name,
+ TestingExternalFunc func);
-typedef void (*TestExternalFunc) (void);
-void test_external_run (const gchar *name, TestExternalFunc func);
-const gchar* test_external_name (void);
-void test_external_fail (void);
+const gchar* testing_external_name (void);
+
+void testing_external_fail (void);
#define DECLARE_SETUP(x) \
void setup_##x(int *v, gconstpointer d)
@@ -84,11 +96,9 @@ void test_external_fail (void);
#define DEFINE_EXTERNAL(x) \
void external_##x(void)
-/* #define DEFINE_ABORT(x) void abort_x(void *__unused G_GNUC_UNUSED, gconstpointer __data G_GNUC_UNUSED)' */
-
#ifndef g_assert_cmpsize
#define g_assert_cmpsize(a, o, b) \
g_assert_cmpuint ((guint)(a), o, (guint)(b))
#endif
-#endif /* GTEST_HELPERS_H_ */
+#endif /* TESTING_H_ */
diff --git a/testing/testing.make b/testing/testing.make
new file mode 100644
index 0000000..d7575a8
--- /dev/null
+++ b/testing/testing.make
@@ -0,0 +1,54 @@
+
+# The following need to be declared before this file is included:
+# TESTING_FILES A list of C files with tests
+# TESTING_LIBS Libraries to link the tests to
+# TESTING_FLAGS C flags for tests
+
+# ------------------------------------------------------------------------------
+
+INCLUDES= \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ -I$(srcdir)/.. \
+ -I$(srcdir)/../.. \
+ $(GTK_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(P11_TESTS_CFLAGS)
+
+LIBS = \
+ $(GTK_LIBS) \
+ $(GLIB_LIBS) \
+ $(GTHREAD_LIBS) \
+ $(P11_TESTS_LIBS)
+
+noinst_PROGRAMS= \
+ run-tests
+
+test-framework.h: $(TESTING_FILES) Makefile.am $(top_srcdir)/testing/testing-build.sh
+ sh $(top_srcdir)/testing/testing-build.sh -b test-framework $(TESTING_FILES)
+
+test-framework.c: test-framework.h
+
+run_tests_SOURCES = \
+ test-framework.c test-framework.h \
+ $(TESTING_FILES)
+
+run_tests_LDADD = \
+ $(TESTING_LIBS) \
+ $(DAEMON_LIBS)
+
+run_tests_CFLAGS = \
+ $(TESTING_FLAGS)
+
+BUILT_SOURCES = \
+ test-framework.c \
+ test-framework.h
+
+# ------------------------------------------------------------------------------
+# Run the tests
+
+test: $(noinst_PROGRAMS)
+ gtester --verbose -k -m=slow ./run-tests
+
+check-am: $(noinst_PROGRAMS)
+ TEST_DATA=$(srcdir)/test-data gtester -m=slow --verbose ./run-tests
diff --git a/ui/tests/Makefile.am b/ui/tests/Makefile.am
index be1422e..60b7662 100644
--- a/ui/tests/Makefile.am
+++ b/ui/tests/Makefile.am
@@ -1,14 +1,14 @@
# Test files should be listed in order they need to run
-UNIT_AUTO = \
+TESTING_FILES = \
unit-test-util.c
UNIT_PROMPT =
-UNIT_LIBS = \
+TESTING_LIBS = \
$(top_builddir)/ui/libgku-prompt.la \
$(top_builddir)/egg/libegg-prompt.la
EXTRA_DIST = \
test-data
-include $(top_srcdir)/tests/gtest.make
+include $(top_srcdir)/testing/testing.make
diff --git a/ui/tests/unit-test-util.c b/ui/tests/unit-test-util.c
index 75d7aba..af0f084 100644
--- a/ui/tests/unit-test-util.c
+++ b/ui/tests/unit-test-util.c
@@ -21,7 +21,7 @@
Author: Stef Walter <stef memberwebs com>
*/
-#include "run-auto-test.h"
+#include "test-framework.h"
#include "gku-prompt-util.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]