trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnol...@apache.org
Subject [trafficserver] branch 8.1.x updated: Fix uri_signing unit test for out of source builds (#8041)
Date Mon, 19 Jul 2021 23:33:06 GMT
This is an automated email from the ASF dual-hosted git repository.

bnolsen pushed a commit to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/8.1.x by this push:
     new 5a1697d  Fix uri_signing unit test for out of source builds (#8041)
5a1697d is described below

commit 5a1697d23d200ce27f06abbe9aca394fb779ad60
Author: Brian Neradt <brian.neradt@gmail.com>
AuthorDate: Mon Jul 19 19:32:54 2021 -0400

    Fix uri_signing unit test for out of source builds (#8041)
    
    The URI signing plugin unit test accesses a config file in the source
    directory. This works fine for in-source builds, but did not for out of
    source. This updates the Makefile and unit test so that the file is
    accessible for out of source builds.
---
 configure.ac                                                    | 2 +-
 plugins/experimental/uri_signing/Makefile.inc                   | 7 ++++++-
 plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc | 4 ++--
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 266036c..38705ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1319,7 +1319,7 @@ TS_CHECK_BROTLI
 TS_CHECK_LUAJIT
 
 #
-# Enable experimental/uri_singing plugin
+# Enable experimental/uri_signing plugin
 # This is here, instead of above, because it needs to know if PCRE is available.
 #
 
diff --git a/plugins/experimental/uri_signing/Makefile.inc b/plugins/experimental/uri_signing/Makefile.inc
index 7632c49..fd2eae3 100644
--- a/plugins/experimental/uri_signing/Makefile.inc
+++ b/plugins/experimental/uri_signing/Makefile.inc
@@ -30,7 +30,12 @@ experimental_uri_signing_uri_signing_la_LIBADD = @LIBJANSSON@ @LIBCJOSE@
@LIBPCR
 
 check_PROGRAMS += experimental/uri_signing/test_uri_signing
 
-experimental_uri_signing_test_uri_signing_CPPFLAGS = $(AM_CPPFLAGS) -I$(abs_top_srcdir)/tests/include
-DURI_SIGNING_UNIT_TEST
+experimental_uri_signing_test_uri_signing_CPPFLAGS = \
+  $(AM_CPPFLAGS) \
+  -I$(abs_top_srcdir)/tests/include \
+  -DURI_SIGNING_UNIT_TEST \
+  -DSRCDIR=\"$(srcdir)\"
+
 experimental_uri_signing_test_uri_signing_LDADD = @LIBJANSSON@ @LIBCJOSE@ @LIBPCRE@ -lm -lcrypto
 experimental_uri_signing_test_uri_signing_SOURCES = \
 	experimental/uri_signing/unit_tests/uri_signing_test.cc \
diff --git a/plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc b/plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc
index 20b2104..a34877b 100644
--- a/plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc
+++ b/plugins/experimental/uri_signing/unit_tests/uri_signing_test.cc
@@ -571,7 +571,7 @@ TEST_CASE("7", "[TestsConfig]")
 
   SECTION("Config Loading ID Field")
   {
-    struct config *cfg = read_config("experimental/uri_signing/unit_tests/testConfig.config");
+    struct config *cfg = read_config(SRCDIR "/experimental/uri_signing/unit_tests/testConfig.config");
     REQUIRE(cfg != NULL);
     REQUIRE(strcmp(config_get_id(cfg), "tester") == 0);
     config_delete(cfg);
@@ -603,7 +603,7 @@ jws_validation_helper(const char *url, const char *package, struct config
*cfg)
 TEST_CASE("8", "[TestsWithConfig]")
 {
   INFO("TEST 8, Tests Involving Validation with Config");
-  struct config *cfg = read_config("experimental/uri_signing/unit_tests/testConfig.config");
+  struct config *cfg = read_config(SRCDIR "/experimental/uri_signing/unit_tests/testConfig.config");
 
   SECTION("Validation of Valid Aud String in JWS")
   {

Mime
View raw message