This makes it possible to identify the test as big in the test file itself. It also seems like a more natural way to control the test running.main
parent
adaea605db
commit
5f00024e75
@ -0,0 +1,13 @@ |
||||
{ lib, ... }: |
||||
|
||||
{ |
||||
options.test.enableBig = lib.mkOption { |
||||
type = lib.types.bool; |
||||
default = true; |
||||
description = '' |
||||
Whether to enable <quote>big</quote> tests. These are tests that require |
||||
more resources than typical tests. For example, tests that depend on large |
||||
packages or tests that take long to run. |
||||
''; |
||||
}; |
||||
} |
@ -1,25 +1,26 @@ |
||||
{ |
||||
debug = { pkgs, config, lib, ... }: { |
||||
home.enableDebugInfo = true; |
||||
home.packages = with pkgs; [ curl gdb ]; |
||||
debug = { pkgs, config, lib, ... }: |
||||
lib.mkIf config.test.enableBig { |
||||
home.enableDebugInfo = true; |
||||
home.packages = with pkgs; [ curl gdb ]; |
||||
|
||||
nmt.script = '' |
||||
[ -L $TESTED/home-path/lib/debug/curl ] \ |
||||
|| fail "Debug-symbols for pkgs.curl should exist in \`/home-path/lib/debug'!" |
||||
nmt.script = '' |
||||
[ -L $TESTED/home-path/lib/debug/curl ] \ |
||||
|| fail "Debug-symbols for pkgs.curl should exist in \`/home-path/lib/debug'!" |
||||
|
||||
#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' |
||||
#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' |
||||
|
||||
# We need to override NIX_DEBUG_INFO_DIRS here as $HOME evalutes to the home |
||||
# 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" |
||||
''; |
||||
}; |
||||
# We need to override NIX_DEBUG_INFO_DIRS here as $HOME evalutes to the home |
||||
# 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" |
||||
''; |
||||
}; |
||||
} |
||||
|
Loading…
Reference in new issue