Debian Codegraph @

script/TESTINSTALL.bat

raw
1 @echo off
2
3 :: installation path can be passed as argument
4 if [%1]==[] (
5 set "installpath=%ProgramFiles%\Environment Modules"
6 ) else (
7 set "installpath=%~1"
8 )
9
10 :: initialize Modules if not already done
11 if not defined MODULES_CMD (
12 call "%installpath%\init\cmd.cmd"
13 )
14
15 set FIND=%SYSTEMROOT%\system32\find
16
17 :: check commands exist
18 where /Q module.cmd
19 if errorlevel 1 (
20 echo "'module' command not found"
21 exit /b 1
22 )
23 where /Q ml.cmd
24 if errorlevel 1 (
25 echo "'ml' command not found"
26 exit /b 1
27 )
28 where /Q envml.cmd
29 if errorlevel 1 (
30 echo "'envml' command not found"
31 exit /b 1
32 )
33
34 module -V 2>&1 | %FIND% "Modules Release"
35 if errorlevel 1 (
36 echo "'module -V' test failed"
37 exit /b 1
38 )
39 module list 2>&1 | %FIND% "No Modulefiles Currently Loaded."
40 if errorlevel 1 (
41 echo "'module list' test failed"
42 exit /b 1
43 )
44 ml 2>&1 | %FIND% "No Modulefiles Currently Loaded."
45 if errorlevel 1 (
46 echo "'ml' test failed"
47 exit /b 1
48 )
49
50 call module load null
51
52 module list -t 2>&1 | %FIND% "null"
53 if errorlevel 1 (
54 echo "'module list -t' test failed"
55 exit /b 1
56 )
57 ml -t 2>&1 | %FIND% "null"
58 if errorlevel 1 (
59 echo "'ml -t' test failed"
60 exit /b 1
61 )
62
63 call ml -null
64
65 module list 2>&1 | %FIND% "No Modulefiles Currently Loaded."
66 if errorlevel 1 (
67 echo "'module list' test failed"
68 exit /b 1
69 )
70 ml 2>&1 | %FIND% "No Modulefiles Currently Loaded."
71 if errorlevel 1 (
72 echo "'ml' test failed"
73 exit /b 1
74 )