diff --git a/tests/modules/programs/gcc/basic-configuration.nix b/tests/modules/programs/gcc/basic-configuration.nix new file mode 100644 index 000000000..50b3e5c67 --- /dev/null +++ b/tests/modules/programs/gcc/basic-configuration.nix @@ -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' + ''; + }; +} diff --git a/tests/modules/programs/gcc/default.nix b/tests/modules/programs/gcc/default.nix new file mode 100644 index 000000000..ee9277395 --- /dev/null +++ b/tests/modules/programs/gcc/default.nix @@ -0,0 +1,4 @@ +{ + gcc-basic-configuration = ./basic-configuration.nix; + gcc-with-colors = ./with-colors.nix; +} diff --git a/tests/modules/programs/gcc/with-colors.nix b/tests/modules/programs/gcc/with-colors.nix new file mode 100644 index 000000000..2a9d543f2 --- /dev/null +++ b/tests/modules/programs/gcc/with-colors.nix @@ -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"' + ''; + }; +}