This website requires JavaScript.
Explore
Help
Sign in
max
/
nix-super
Watch
1
Star
0
Fork
You've already forked nix-super
0
mirror of
https://github.com/privatevoid-net/nix-super.git
synced
2024-11-15 10:46:15 +02:00
Code
Issues
Projects
Releases
Packages
Wiki
Activity
Actions
d1e0bae55a
nix-super
/
tests
/
functional
/
user-envs.sh
6 lines
73 B
Bash
Raw
Normal View
History
Unescape
Escape
Ensure all functional scripts are (a) executable (b) have shebang This is good for shebang, and also good for future build system simplifications
2024-05-28 19:43:04 +03:00
#!/usr/bin/env bash
tests: simplify initialisation and wiring pararameterisation is not actually needed the way things are currently set up, and it confused me when trying to understand what the code does. all but one test sources vars-and-functions.sh, which nominally only defines variables, but in practice is always coupled with the actual initialisation. while the cleaner way of making this more legible would be to source variables and initialisation separately, this would produce a huge diff. the change requires a few small fixes to keep the tests working: - only create test home directory during initialisation that vars-and-functions.sh wrote to the file system seems not write - fix creation of the test directory due to statefulness, the test home directory was implicitly creating the test root, too. decoupling that made it apparent that this was probably not intentional, and certainly confusing. - only source vars-and-functions.sh if init.sh is not needed there is one test case that only needs a helper function but no initialisation side effects - remove some unnecessary cleanups and split parts of re-used test code there were confusing bits in how initialisation code was repurposed, which break if trying to refactor the outer layers naively...
2024-05-06 16:42:49 +03:00
source
./common.sh
* Make it easy to run individual tests from the command line.
2006-03-01 14:15:33 +02:00
tests: simplify initialisation and wiring pararameterisation is not actually needed the way things are currently set up, and it confused me when trying to understand what the code does. all but one test sources vars-and-functions.sh, which nominally only defines variables, but in practice is always coupled with the actual initialisation. while the cleaner way of making this more legible would be to source variables and initialisation separately, this would produce a huge diff. the change requires a few small fixes to keep the tests working: - only create test home directory during initialisation that vars-and-functions.sh wrote to the file system seems not write - fix creation of the test directory due to statefulness, the test home directory was implicitly creating the test root, too. decoupling that made it apparent that this was probably not intentional, and certainly confusing. - only source vars-and-functions.sh if init.sh is not needed there is one test case that only needs a helper function but no initialisation side effects - remove some unnecessary cleanups and split parts of re-used test code there were confusing bits in how initialisation code was repurposed, which break if trying to refactor the outer layers naively...
2024-05-06 16:42:49 +03:00
source
./user-envs-test-case.sh
Reference in a new issue
Copy permalink