summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-01-27 12:25:51 +0000
committerSimon Josefsson <simon@josefsson.org>2006-01-27 12:25:51 +0000
commitfbac6dd1760b19e7aca0bd33c949d5f38a164840 (patch)
tree773542c4a71575bc848d133445e160aed6cb8f2d /tests
parent4df91eef65ff073e59504cdd14e05bee483e457a (diff)
downloadlibtasn1-fbac6dd1760b19e7aca0bd33c949d5f38a164840.tar.gz
libtasn1-fbac6dd1760b19e7aca0bd33c949d5f38a164840.tar.bz2
libtasn1-fbac6dd1760b19e7aca0bd33c949d5f38a164840.zip
Fix make check for objdir != srcdir, reported by Bernard Leak <bernard@brenda-arkle.demon.co.uk>.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/Test_parser.c9
-rw-r--r--tests/Test_tree.c8
3 files changed, 18 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e79017b..0ac13af 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -9,3 +9,7 @@ Test_parser_LDADD = ../lib/libtasn1.la
Test_tree_SOURCES = Test_tree.c
Test_tree_LDADD = ../lib/libtasn1.la
+
+TESTS_ENVIRONMENT = \
+ ASN1PARSER=$(srcdir)/Test_parser.asn \
+ ASN1TREE=$(srcdir)/Test_tree.asn
diff --git a/tests/Test_parser.c b/tests/Test_parser.c
index 12f6cb5..ef7a1f0 100644
--- a/tests/Test_parser.c
+++ b/tests/Test_parser.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2002 Fabio Fiorina
+ * Copyright (C) 2006 Simon Josefsson
*
* This file is part of LIBTASN1.
*
@@ -38,7 +39,7 @@ typedef struct{
char *errorDescription;
} test_type;
-char fileCorrectName[]="Test_parser.asn";
+char *fileCorrectName;
char fileErroredName[]="Test_parser_ERROR.asn";
#define _FILE_ "Test_parser_ERROR.asn"
@@ -149,10 +150,14 @@ main(int argc,char *argv[])
test_type *test;
int errorCounter=0,testCounter=0;
+ fileCorrectName = getenv ("ASN1PARSER");
+ if (!fileCorrectName)
+ fileCorrectName="Test_parser.asn";
+
printf("\n\n/****************************************/\n");
printf( "/* Test sequence : Test_parser */\n");
printf( "/****************************************/\n\n");
-
+ printf("ASN1PARSER: %s\n", fileCorrectName);
result=asn1_parser2tree(fileCorrectName,&definitions,errorDescription);
diff --git a/tests/Test_tree.c b/tests/Test_tree.c
index 7cdd068..fccbc36 100644
--- a/tests/Test_tree.c
+++ b/tests/Test_tree.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2002 Fabio Fiorina
+ * Copyright (C) 2006 Simon Josefsson
*
* This file is part of LIBTASN1.
*
@@ -415,17 +416,22 @@ main(int argc,char *argv[])
int k;
int start,end;
const char *str_p=NULL;
+ const char *treefile = getenv ("ASN1TREE");
+
+ if (!treefile)
+ treefile = "Test_tree.asn";
printf("\n\n/****************************************/\n");
printf( "/* Test sequence : Test_tree */\n");
printf( "/****************************************/\n\n");
+ printf("ASN1TREE: %s\n", treefile);
/* Check version */
if(asn1_check_version("0.2.11")==NULL)
printf("\nLibrary version check ERROR:\n actual version: %s\n\n",asn1_check_version(NULL));
if(1)
- result=asn1_parser2tree("Test_tree.asn",&definitions,errorDescription);
+ result=asn1_parser2tree(treefile,&definitions,errorDescription);
else
result=asn1_array2tree(Test_tree_asn1_tab,&definitions,errorDescription);