]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
run_tests: pass OPENSSL_ROOT_DIR into perl tests 108/head
authorVitaly Chikunov <vt@altlinux.org>
Thu, 24 Jan 2019 03:59:39 +0000 (06:59 +0300)
committerVitaly Chikunov <vt@altlinux.org>
Fri, 25 Jan 2019 22:50:38 +0000 (01:50 +0300)
If OPENSSL_ROOT_DIR is specified pass it to the perl tests, and set its
value as LD_LIBRARY_PATH, if unset. This allows to run tests for custom
openssl build without manually setting proper env.

CMakeLists.txt
test/run_tests

index b4be930d3181ae1651d905940550372ebb821ca9..408da4d00b93d576d75d22f7d6786baf3e5344e2 100644 (file)
@@ -155,9 +155,10 @@ add_test(NAME gost89
        COMMAND test_gost89)
 
 add_test(NAME engine
-        COMMAND perl run_tests
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
-set_tests_properties(engine PROPERTIES ENVIRONMENT OPENSSL_ENGINES=${OUTPUT_DIRECTORY})
+       COMMAND perl run_tests
+       WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
+set_tests_properties(engine PROPERTIES ENVIRONMENT
+       "OPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR};OPENSSL_ENGINES=${OUTPUT_DIRECTORY}")
 
 add_executable(sign benchmark/sign.c)
 target_link_libraries(sign gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY})
index 3578d0a62073556833fb224785cc1b319815922c..3dfa90c8bebb5488d0a7c13880ef5399e55ee48b 100644 (file)
@@ -1,5 +1,9 @@
 #!/usr/bin/perl
 use TAP::Harness;
 
+if(defined $ENV{'OPENSSL_ROOT_DIR'} && !defined $ENV{'LD_LIBRARY_PATH'}) {
+  $ENV{'LD_LIBRARY_PATH'} = $ENV{'OPENSSL_ROOT_DIR'};
+  $ENV{'PATH'} = "$ENV{'OPENSSL_ROOT_DIR'}/apps:$ENV{'PATH'}";
+}
 my $harness = TAP::Harness->new();
 exit ($harness->runtests(glob("*.t"))->all_passed() ? 0 : 1);