Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcawood committed Dec 10, 2024
1 parent 9e2b344 commit 64ee19a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rt/unload/mf/Core/C/1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
setenv{"A", "A", mode={"load"}}
setenv{"A", "B", mode={"unload"}}
pushenv{"STACK_VAR", "load_value", mode={"load"}}
pushenv{"STACK_VAR", "unload_value", mode={"unload"}}

-- Path operation tests
prepend_path{"PATH_TEST", "/first", mode={"load"}}
prepend_path{"PATH_TEST", "/unload_first", mode={"unload"}}

append_path{"PATH_TEST", "/last", mode={"load"}}
append_path{"PATH_TEST", "/unload_last", mode={"unload"}}

-- Test remove during specific modes
remove_path{"PATH_TEST", "/to_remove", mode={"unload"}}


--setenv{"AA", "X", mode={"load", "unload"}}
--prepend_path{"FOO", "BAR", mode={"unload", "load"}}
--append_path{"X", "Y", mode={"unload"}}
--load{"D", mode={"unload"}}
--try_load{"J", mode={"unload"}}
4 changes: 4 additions & 0 deletions rt/unload/mf/Core/D/1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Test module D
load{"E", mode={"load"}}
-- load{"A", "B", "C", mode="unload"}
setenv("D_LOADED", "yes")
2 changes: 2 additions & 0 deletions rt/unload/mf/Core/E/1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Test module E
setenv("E_LOADED", "yes")
2 changes: 2 additions & 0 deletions rt/unload/mf/Core/F/1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Test module F
setenv("F_LOADED", "yes")
9 changes: 9 additions & 0 deletions rt/unload/unload.tdesc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ testdescript = {
runLmod unload intel # 7
runLmod load B # 8
runLmod unload B # 9
runLmod load C # 10
runLmod unload C # 11
# Test mode-specific load functionality
runLmod load F # 12 (Load F first for unload test)
runLmod load D # 13 (Should load E, not affect F)
runLmod list # 14 (Should show D, E, and F loaded)
runLmod unload D # 15 (Should unload F, keep E)
runLmod list # 16 (Should show only E loaded)
HOME=$ORIG_HOME
Expand Down

0 comments on commit 64ee19a

Please sign in to comment.