mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
tests/gcc: add tests
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
13
tests/modules/programs/gcc/basic-configuration.nix
Normal file
13
tests/modules/programs/gcc/basic-configuration.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
config = {
|
||||
programs.gcc = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
# Verify no GCC_COLORS environment variable is set when colors is empty
|
||||
hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
|
||||
assertFileNotRegex $hmEnvFile 'GCC_COLORS'
|
||||
'';
|
||||
};
|
||||
}
|
||||
4
tests/modules/programs/gcc/default.nix
Normal file
4
tests/modules/programs/gcc/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
gcc-basic-configuration = ./basic-configuration.nix;
|
||||
gcc-with-colors = ./with-colors.nix;
|
||||
}
|
||||
21
tests/modules/programs/gcc/with-colors.nix
Normal file
21
tests/modules/programs/gcc/with-colors.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
config = {
|
||||
programs.gcc = {
|
||||
enable = true;
|
||||
colors = {
|
||||
error = "01;31";
|
||||
warning = "01;33";
|
||||
note = "01;36";
|
||||
caret = "01;32";
|
||||
locus = "01";
|
||||
quote = "01";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
|
||||
assertFileExists $hmEnvFile
|
||||
assertFileRegex $hmEnvFile 'export GCC_COLORS="caret=01;32:error=01;31:locus=01:note=01;36:quote=01:warning=01;33"'
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user