mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
tests/gcc: add tests
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
78fda50bd6
commit
c2e3f1cacd
3 changed files with 38 additions and 0 deletions
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"'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue