gprofng: fix regression in testing for not yet installed version
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Thu, 7 Jul 2022 20:20:39 +0000 (13:20 -0700)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Thu, 7 Jul 2022 20:20:39 +0000 (13:20 -0700)
gprofng/ChangeLog
2022-07-07  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

* src/Settings.cc (Settings::read_rc): Read environment variable
GPROFNG_SYSCONFDIR.
* testsuite/lib/Makefile.skel: Export GPROFNG_SYSCONFDIR.
* testsuite/gprofng.display/display.exp: Shorten the list of tests.

gprofng/src/Settings.cc
gprofng/testsuite/gprofng.display/display.exp
gprofng/testsuite/lib/Makefile.skel

index 39cb806dd4e5485f74c284fc51ad8c4f01b09cb6..572997f8a886466afdd028c750394281233113b6 100644 (file)
@@ -407,7 +407,10 @@ Settings::read_rc (bool ipc_or_rdt_mode)
   free (rc_path);
 
   // Read system-wide file
-  rc_path = dbe_sprintf (NTXT ("%s/gprofng.rc"), SYSCONFDIR);
+  const char *sysconfdir = getenv("GPROFNG_SYSCONFDIR");
+  if (sysconfdir == NULL)
+    sysconfdir = SYSCONFDIR;
+  rc_path = dbe_sprintf (NTXT ("%s/gprofng.rc"), sysconfdir);
   if (access (rc_path, R_OK | F_OK) != 0)
     {
       StringBuilder sb;
index dfb383e9fc63e2cde5c8589a6fa854bc9ac0b943..8ba039358671f6c5bb28e4e053e349cdf77272cb 100644 (file)
@@ -30,38 +30,24 @@ switch $pltf {
     #   dir      cflags         gprofflags       Others
     set table {
       {"jsynprog" "-g -Wall"        "-p on -j on"}
-      {"mttest"   ""                ""}
-      {"mttest"   "-g -Wall"        "-p on"}
       {"mttest"   "-g -O0"          "-p on"}
-      {"mttest"   "-g -O"           "-p on"}
-      {"mttest"   "-g -O"           "-h on"}
-      {"mttest"   "-g -O"           "-h on"}
-      {"mttest"   "-g -O"           "-p on -h on"}
-      {"synprog"  ""                ""}
-      {"synprog"  "-g"              "-p on"}
+      {"mttest"   "-g -O0"          "-p on -h on"}
       {"synprog"  "-g -O0"          "-p on"}
-      {"synprog"  "-g -O"           "-p on"}
-      {"synprog"  "-g"              "-p on -h on"}
-      {"synprog"  "-g -O0"          "-p on -h on"}
-      {"synprog"  "-g -O"           "-p on -h on"}
+      {"synprog"  "-g -O0"           "-p on -h on"}
     }
   }
   aarch64 {
     set table {
       {"jsynprog" "-g -Wall"        "-p on -j on"}
-      {"mttest"   ""                ""}
-      {"mttest"   "-g -Wall"        "-p on"}
       {"mttest"   "-g -O0"          "-p on"}
-      {"mttest"   "-g -O"           "-p on"}
-      {"synprog"  ""                ""}
-      {"synprog"  "-g"              "-p on"}
-      {"synprog"  "-g -O"           "-p on"}
+      {"synprog"  "-g -O0"          "-p on"}
     }
   }
   default {
     # Columns in the table represent:
     #   dir      cflags         gprofflags       Others
     set table {
+      {"jsynprog" ""              ""}
       {"mttest"   ""              ""}
       {"synprog"  ""              ""}
     }
index 7810ba7ed7a25e4bfd26a8a4f8b0e06d97005f13..157f6f60c84adadb6e94a3eaad04d1db25eb8d9b 100644 (file)
@@ -42,6 +42,9 @@ DISPLAY_LOG = display.log
 gprofng_dir := $(shell dirname $$(find ../root -name libgprofng.so.0 | head -1))
 export LD_LIBRARY_PATH := $(gprofng_dir):$(gprofng_dir)/..
 
+# Set GPROFNG_SYSCONFDIR to find out gprofng.rc:
+export GPROFNG_SYSCONFDIR := $(srcdir)/../../../src
+
 .PHONY: all collect compare clobber clean
 
 all: compare