summaryrefslogtreecommitdiff
path: root/egg
diff options
context:
space:
mode:
Diffstat (limited to 'egg')
-rw-r--r--egg/Makefile.am58
-rw-r--r--egg/fixtures/dh-params.pem (renamed from egg/tests/files/dh-params.pem)0
-rw-r--r--egg/fixtures/echo-script.sh (renamed from egg/tests/files/echo-script.sh)0
-rw-r--r--egg/fixtures/pem-rsa-enc.key (renamed from egg/tests/files/pem-rsa-enc.key)0
-rw-r--r--egg/fixtures/test-certificate-1.der (renamed from egg/tests/files/test-certificate-1.der)bin813 -> 813 bytes
-rw-r--r--egg/fixtures/test-personalname-invalid.der (renamed from egg/tests/files/test-personalname-invalid.der)0
-rw-r--r--egg/fixtures/test-pkcs12-1.der (renamed from egg/tests/files/test-pkcs12-1.der)bin2824 -> 2824 bytes
-rwxr-xr-xegg/fixtures/test-pkcs7-1.der (renamed from egg/tests/files/test-pkcs7-1.der)bin1002 -> 1002 bytes
-rwxr-xr-xegg/fixtures/test-pkcs7-2.der (renamed from egg/tests/files/test-pkcs7-2.der)bin1002 -> 1002 bytes
-rw-r--r--egg/fixtures/test-pkcs8-1.der (renamed from egg/tests/files/test-pkcs8-1.der)bin335 -> 335 bytes
-rw-r--r--egg/fixtures/test-rsakey-1.der (renamed from egg/tests/files/test-rsakey-1.der)bin609 -> 609 bytes
-rw-r--r--egg/test-armor.c (renamed from egg/tests/test-armor.c)0
-rw-r--r--egg/test-asn1.c (renamed from egg/tests/test-asn1.c)2
-rw-r--r--egg/test-asn1x.c (renamed from egg/tests/test-asn1x.c)14
-rw-r--r--egg/test-cleanup.c (renamed from egg/tests/test-cleanup.c)0
-rw-r--r--egg/test-dh.c (renamed from egg/tests/test-dh.c)0
-rw-r--r--egg/test-dn.c (renamed from egg/tests/test-dn.c)2
-rw-r--r--egg/test-hex.c (renamed from egg/tests/test-hex.c)0
-rw-r--r--egg/test-hkdf.c (renamed from egg/tests/test-hkdf.c)0
-rw-r--r--egg/test-oid.c (renamed from egg/tests/test-oid.c)0
-rw-r--r--egg/test-openssl.c (renamed from egg/tests/test-openssl.c)2
-rw-r--r--egg/test-padding.c (renamed from egg/tests/test-padding.c)0
-rw-r--r--egg/test-secmem.c (renamed from egg/tests/test-secmem.c)0
-rw-r--r--egg/test-spawn.c (renamed from egg/tests/test-spawn.c)10
-rw-r--r--egg/test-symkey.c (renamed from egg/tests/test-symkey.c)0
-rw-r--r--egg/test.asn (renamed from egg/tests/test.asn)0
-rw-r--r--egg/test.asn.h (renamed from egg/tests/test.asn.h)0
-rw-r--r--egg/tests/.gitignore1
-rw-r--r--egg/tests/Makefile.am54
29 files changed, 67 insertions, 76 deletions
diff --git a/egg/Makefile.am b/egg/Makefile.am
index 0e59577b..6b50242d 100644
--- a/egg/Makefile.am
+++ b/egg/Makefile.am
@@ -12,8 +12,10 @@ noinst_LTLIBRARIES = \
libegg-test.la
INCLUDES = \
+ -I$(top_builddir) \
-I$(top_srcdir) \
- -I$(top_builddir)
+ -DSRCDIR="\"@abs_srcdir@\"" \
+ $(GLIB_CFLAGS)
libegg_la_CFLAGS = \
$(LIBTASN1_CFLAGS) \
@@ -120,11 +122,55 @@ libegg_test_la_CFLAGS = \
libegg_test_la_LIBS = \
$(GLIB_LIBS)
-# -------------------------------------------------------------------
-
-SUBDIRS = . tests
-
asn:
asn1Parser -o pk.asn.h pk.asn
asn1Parser -o pkix.asn.h pkix.asn
- sed -i 's|#include.*|/* \0 */|' pk.asn.h pkix.asn.h \ No newline at end of file
+ sed -i 's|#include.*|/* \0 */|' pk.asn.h pkix.asn.h
+ asn1Parser -o test.asn.h test.asn
+ sed -i 's|#include.*|/* \0 */|' test.asn.h
+
+# -------------------------------------------------------------------
+# TESTS
+
+LDADD = \
+ $(top_builddir)/egg/libegg.la \
+ $(LIBGCRYPT_LIBS) \
+ $(GTHREAD_LIBS) \
+ $(GLIB_LIBS)
+
+TEST_PROGS = \
+ test-asn1 \
+ test-asn1x \
+ test-dn \
+ test-cleanup \
+ test-hex \
+ test-hkdf \
+ test-oid \
+ test-secmem \
+ test-padding \
+ test-symkey \
+ test-armor \
+ test-openssl \
+ test-dh \
+ test-spawn
+
+test_asn1_SOURCES = \
+ test-asn1.c \
+ test.asn.h
+
+test_asn1x_LDADD = \
+ $(top_builddir)/egg/libegg-asn1x.la \
+ $(LDADD)
+
+check_PROGRAMS = $(TEST_PROGS)
+
+test: $(TEST_PROGS)
+ gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS)
+
+check-local: test
+
+all-local: $(check_PROGRAMS)
+
+EXTRA_DIST += \
+ test.asn \
+ fixtures
diff --git a/egg/tests/files/dh-params.pem b/egg/fixtures/dh-params.pem
index cc0afd87..cc0afd87 100644
--- a/egg/tests/files/dh-params.pem
+++ b/egg/fixtures/dh-params.pem
diff --git a/egg/tests/files/echo-script.sh b/egg/fixtures/echo-script.sh
index aa0f7a93..aa0f7a93 100644
--- a/egg/tests/files/echo-script.sh
+++ b/egg/fixtures/echo-script.sh
diff --git a/egg/tests/files/pem-rsa-enc.key b/egg/fixtures/pem-rsa-enc.key
index 65439fe6..65439fe6 100644
--- a/egg/tests/files/pem-rsa-enc.key
+++ b/egg/fixtures/pem-rsa-enc.key
diff --git a/egg/tests/files/test-certificate-1.der b/egg/fixtures/test-certificate-1.der
index 1c084370..1c084370 100644
--- a/egg/tests/files/test-certificate-1.der
+++ b/egg/fixtures/test-certificate-1.der
Binary files differ
diff --git a/egg/tests/files/test-personalname-invalid.der b/egg/fixtures/test-personalname-invalid.der
index 60d5d8c4..60d5d8c4 100644
--- a/egg/tests/files/test-personalname-invalid.der
+++ b/egg/fixtures/test-personalname-invalid.der
diff --git a/egg/tests/files/test-pkcs12-1.der b/egg/fixtures/test-pkcs12-1.der
index 285d8dd5..285d8dd5 100644
--- a/egg/tests/files/test-pkcs12-1.der
+++ b/egg/fixtures/test-pkcs12-1.der
Binary files differ
diff --git a/egg/tests/files/test-pkcs7-1.der b/egg/fixtures/test-pkcs7-1.der
index d45b9e0e..d45b9e0e 100755
--- a/egg/tests/files/test-pkcs7-1.der
+++ b/egg/fixtures/test-pkcs7-1.der
Binary files differ
diff --git a/egg/tests/files/test-pkcs7-2.der b/egg/fixtures/test-pkcs7-2.der
index d45b9e0e..d45b9e0e 100755
--- a/egg/tests/files/test-pkcs7-2.der
+++ b/egg/fixtures/test-pkcs7-2.der
Binary files differ
diff --git a/egg/tests/files/test-pkcs8-1.der b/egg/fixtures/test-pkcs8-1.der
index 8b61684e..8b61684e 100644
--- a/egg/tests/files/test-pkcs8-1.der
+++ b/egg/fixtures/test-pkcs8-1.der
Binary files differ
diff --git a/egg/tests/files/test-rsakey-1.der b/egg/fixtures/test-rsakey-1.der
index 878fda5b..878fda5b 100644
--- a/egg/tests/files/test-rsakey-1.der
+++ b/egg/fixtures/test-rsakey-1.der
Binary files differ
diff --git a/egg/tests/test-armor.c b/egg/test-armor.c
index 3e5cc658..3e5cc658 100644
--- a/egg/tests/test-armor.c
+++ b/egg/test-armor.c
diff --git a/egg/tests/test-asn1.c b/egg/test-asn1.c
index a4373557..598d26a3 100644
--- a/egg/tests/test-asn1.c
+++ b/egg/test-asn1.c
@@ -1747,7 +1747,7 @@ setup (Test *test, gconstpointer unused)
{
GBytes *bytes;
- if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der",
+ if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der",
(gchar**)&test->data, &test->n_data, NULL))
g_assert_not_reached ();
diff --git a/egg/tests/test-asn1x.c b/egg/test-asn1x.c
index cce6fe8e..879def2a 100644
--- a/egg/tests/test-asn1x.c
+++ b/egg/test-asn1x.c
@@ -74,11 +74,11 @@ typedef struct {
} Fixture;
static const Fixture parse_test_fixtures[] = {
- { pkix_asn1_tab, SRCDIR "/files/test-certificate-1.der", "Certificate" },
- { pkix_asn1_tab, SRCDIR "/files/test-pkcs8-1.der", "pkcs-8-PrivateKeyInfo" },
- { pk_asn1_tab, SRCDIR "/files/test-rsakey-1.der", "RSAPrivateKey" },
- { pkix_asn1_tab, SRCDIR "/files/test-pkcs7-1.der", "pkcs-7-ContentInfo" },
- { pkix_asn1_tab, SRCDIR "/files/test-pkcs7-2.der", "pkcs-7-ContentInfo" },
+ { pkix_asn1_tab, SRCDIR "/fixtures/test-certificate-1.der", "Certificate" },
+ { pkix_asn1_tab, SRCDIR "/fixtures/test-pkcs8-1.der", "pkcs-8-PrivateKeyInfo" },
+ { pk_asn1_tab, SRCDIR "/fixtures/test-rsakey-1.der", "RSAPrivateKey" },
+ { pkix_asn1_tab, SRCDIR "/fixtures/test-pkcs7-1.der", "pkcs-7-ContentInfo" },
+ { pkix_asn1_tab, SRCDIR "/fixtures/test-pkcs7-2.der", "pkcs-7-ContentInfo" },
};
static void
@@ -191,9 +191,9 @@ main (int argc, char **argv)
g_free (name);
}
- g_test_add ("/asn1x/pkcs12-decode/1", Test, SRCDIR "/files/test-pkcs12-1.der",
+ g_test_add ("/asn1x/pkcs12-decode/1", Test, SRCDIR "/fixtures/test-pkcs12-1.der",
setup, test_pkcs12_decode, teardown);
- g_test_add ("/asn1x/pkcs5-personal-name/invalid", Test, SRCDIR "/files/test-personalname-invalid.der",
+ g_test_add ("/asn1x/pkcs5-personal-name/invalid", Test, SRCDIR "/fixtures/test-personalname-invalid.der",
setup, test_personal_name_invalid, teardown);
return g_test_run ();
diff --git a/egg/tests/test-cleanup.c b/egg/test-cleanup.c
index a83c4868..a83c4868 100644
--- a/egg/tests/test-cleanup.c
+++ b/egg/test-cleanup.c
diff --git a/egg/tests/test-dh.c b/egg/test-dh.c
index 10d612e1..10d612e1 100644
--- a/egg/tests/test-dh.c
+++ b/egg/test-dh.c
diff --git a/egg/tests/test-dn.c b/egg/test-dn.c
index d1b6f729..347a5cdf 100644
--- a/egg/tests/test-dn.c
+++ b/egg/test-dn.c
@@ -46,7 +46,7 @@ setup (Test *test, gconstpointer unused)
{
GBytes *bytes;
- if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der",
+ if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der",
(gchar**)&test->data, &test->n_data, NULL))
g_assert_not_reached ();
diff --git a/egg/tests/test-hex.c b/egg/test-hex.c
index 773b2008..773b2008 100644
--- a/egg/tests/test-hex.c
+++ b/egg/test-hex.c
diff --git a/egg/tests/test-hkdf.c b/egg/test-hkdf.c
index e5518a63..e5518a63 100644
--- a/egg/tests/test-hkdf.c
+++ b/egg/test-hkdf.c
diff --git a/egg/tests/test-oid.c b/egg/test-oid.c
index 2c013457..2c013457 100644
--- a/egg/tests/test-oid.c
+++ b/egg/test-oid.c
diff --git a/egg/tests/test-openssl.c b/egg/test-openssl.c
index 91622b93..4f511265 100644
--- a/egg/tests/test-openssl.c
+++ b/egg/test-openssl.c
@@ -53,7 +53,7 @@ setup (Test *test, gconstpointer unused)
gchar *contents;
gsize length;
- if (!g_file_get_contents (SRCDIR "/files/pem-rsa-enc.key", &contents, &length, NULL))
+ if (!g_file_get_contents (SRCDIR "/fixtures/pem-rsa-enc.key", &contents, &length, NULL))
g_assert_not_reached ();
test->input = g_bytes_new_take (contents, length);
diff --git a/egg/tests/test-padding.c b/egg/test-padding.c
index aecdd378..aecdd378 100644
--- a/egg/tests/test-padding.c
+++ b/egg/test-padding.c
diff --git a/egg/tests/test-secmem.c b/egg/test-secmem.c
index 58b0d35f..58b0d35f 100644
--- a/egg/tests/test-secmem.c
+++ b/egg/test-secmem.c
diff --git a/egg/tests/test-spawn.c b/egg/test-spawn.c
index 7c0d1e11..347f9ba4 100644
--- a/egg/tests/test-spawn.c
+++ b/egg/test-spawn.c
@@ -175,7 +175,7 @@ test_sync (void)
data.parent_pid = getpid();
data.index = 80;
- ret = egg_spawn_sync_with_callbacks (SRCDIR "/files",
+ ret = egg_spawn_sync_with_callbacks (SRCDIR "/fixtures",
echo_argv, NULL, 0, &pid,
&echo_callbacks, &data,
&exit_status, &error);
@@ -196,7 +196,7 @@ test_sync_error (void)
GError *error = NULL;
gboolean ret;
- ret = egg_spawn_sync_with_callbacks (SRCDIR "/files",
+ ret = egg_spawn_sync_with_callbacks (SRCDIR "/fixtures",
error_argv, NULL, 0, NULL,
NULL, NULL,
NULL, &error);
@@ -219,7 +219,7 @@ test_async (void)
data.index = 80;
data.is_async = TRUE;
- ret = egg_spawn_async_with_callbacks (SRCDIR "/files",
+ ret = egg_spawn_async_with_callbacks (SRCDIR "/fixtures",
echo_argv, NULL, 0, &pid,
&echo_callbacks, &data,
NULL, &error);
@@ -246,7 +246,7 @@ test_async_none (void)
data.parent_pid = getpid();
data.is_async = TRUE;
- ret = egg_spawn_async_with_callbacks (SRCDIR "/files",
+ ret = egg_spawn_async_with_callbacks (SRCDIR "/fixtures",
echo_argv, NULL, 0, NULL,
&null_callbacks, &data,
NULL, &error);
@@ -267,7 +267,7 @@ test_async_error (void)
GError *error = NULL;
guint ret;
- ret = egg_spawn_async_with_callbacks (SRCDIR "/files",
+ ret = egg_spawn_async_with_callbacks (SRCDIR "/fixtures",
error_argv, NULL, 0, NULL,
NULL, NULL,
NULL, &error);
diff --git a/egg/tests/test-symkey.c b/egg/test-symkey.c
index 90211d68..90211d68 100644
--- a/egg/tests/test-symkey.c
+++ b/egg/test-symkey.c
diff --git a/egg/tests/test.asn b/egg/test.asn
index 05676d70..05676d70 100644
--- a/egg/tests/test.asn
+++ b/egg/test.asn
diff --git a/egg/tests/test.asn.h b/egg/test.asn.h
index f2983e9b..f2983e9b 100644
--- a/egg/tests/test.asn.h
+++ b/egg/test.asn.h
diff --git a/egg/tests/.gitignore b/egg/tests/.gitignore
deleted file mode 100644
index 1ddfbd97..00000000
--- a/egg/tests/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/asn1-def-test.h
diff --git a/egg/tests/Makefile.am b/egg/tests/Makefile.am
deleted file mode 100644
index a1d45552..00000000
--- a/egg/tests/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@
-include $(top_srcdir)/Makefile.decl
-
-INCLUDES = \
- -I$(top_builddir) \
- -I$(top_srcdir) \
- -DSRCDIR="\"@abs_srcdir@\"" \
- $(GLIB_CFLAGS)
-
-LDADD = \
- $(top_builddir)/egg/libegg.la \
- $(LIBGCRYPT_LIBS) \
- $(GTHREAD_LIBS) \
- $(GLIB_LIBS)
-
-TEST_PROGS = \
- test-asn1 \
- test-asn1x \
- test-dn \
- test-cleanup \
- test-hex \
- test-hkdf \
- test-oid \
- test-secmem \
- test-padding \
- test-symkey \
- test-armor \
- test-openssl \
- test-dh \
- test-spawn
-
-test_asn1_SOURCES = \
- test-asn1.c \
- test.asn.h
-
-test_asn1x_LDADD = \
- $(top_builddir)/egg/libegg-asn1x.la \
- $(LDADD)
-
-check_PROGRAMS = $(TEST_PROGS)
-
-test: $(TEST_PROGS)
- gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS)
-
-check-local: test
-
-all-local: $(check_PROGRAMS)
-
-EXTRA_DIST = \
- test.asn \
- files
-
-asn:
- asn1Parser -o test.asn.h test.asn
- sed -i 's|#include.*|/* \0 */|' test.asn.h