2020-02-21 19:11:58 +01:00
|
|
|
{
|
2022-01-02 10:22:50 +01:00
|
|
|
debug = { pkgs, config, lib, ... }:
|
|
|
|
lib.mkIf config.test.enableBig {
|
|
|
|
home.enableDebugInfo = true;
|
|
|
|
home.packages = with pkgs; [ curl gdb ];
|
2020-02-21 19:11:58 +01:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
nmt.script = ''
|
|
|
|
[ -L $TESTED/home-path/lib/debug/curl ] \
|
|
|
|
|| fail "Debug-symbols for pkgs.curl should exist in \`/home-path/lib/debug'!"
|
2020-02-21 19:11:58 +01:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
#source $TESTED/home-path/etc/profile.d/hm-session-vars.sh
|
|
|
|
#[[ "$NIX_DEBUG_INFO_DIRS" =~ /lib/debug$ ]] \
|
|
|
|
#|| fail "Invalid NIX_DEBUG_INFO_DIRS!"
|
|
|
|
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
|
|
|
|
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
|
|
|
'NIX_DEBUG_INFO_DIRS=.*/lib/debug'
|
2020-02-21 19:11:58 +01:00
|
|
|
|
2023-01-24 11:30:04 +01:00
|
|
|
# We need to override NIX_DEBUG_INFO_DIRS here as $HOME evaluates to the home
|
2022-01-02 10:22:50 +01:00
|
|
|
# of the user who executes this testcase :/
|
|
|
|
{ echo quit | PATH="$TESTED/home-path/bin''${PATH:+:}$PATH" NIX_DEBUG_INFO_DIRS=$TESTED/home-path/lib/debug \
|
|
|
|
gdb curl 2>&1 | \
|
|
|
|
grep 'Reading symbols from ${builtins.storeDir}/'; \
|
|
|
|
} || fail "Failed to read debug symbols from curl in gdb"
|
|
|
|
'';
|
|
|
|
};
|
2020-02-21 19:11:58 +01:00
|
|
|
}
|