Debian Codegraph @

debian/tests/upstream-testsuite

raw
1 #!/bin/sh
2 set -e
3
4 mock=$AUTOPKGTEST_TMP/lmod-src-mock
5 mkdir $mock
6
7 export PATH=$PATH:$(pwd)/hermes/bin
8
9 # use the files shipped in the .deb
10 cp -as /usr/share/lmod/lmod/* $mock/
11 mv $mock/libexec $mock/src
12 rm $mock/src/print_os.sh
13 mv $mock/init/env_modules_python.py $mock/init/env_modules_python.py.in
14 mv $mock/settarg/settarg_cmd $mock/settarg/settarg_cmd.in.lua
15 mv $mock/src/check_module_tree_syntax $mock/src/check_module_tree_syntax.in.lua
16 mv $mock/src/clearLMOD_cmd $mock/src/clearLMOD_cmd.in.lua
17 mv $mock/src/lmod $mock/src/lmod.in.lua
18 mv $mock/src/sh_to_modulefile $mock/src/sh_to_modulefile.in.lua
19 mv $mock/src/spider $mock/src/spider.in.lua
20
21 # these are not shipped in the .deb
22 cp -a Hermes.db MF proj_mgmt rt $mock/
23 cp -a src/chkJson $mock/src/
24
25 # can't use these files from the .deb since they have all placeholders
26 # substituted, while the reference solutions expect unsubstituted
27 # placeholders in the output
28 cp --remove-destination -a src/lmod.in.lua $mock/src/
29 cp --remove-destination -a src/Configuration.lua $mock/src/
30 cp --remove-destination -a src/myGlobals.lua $mock/src/
31
32 show_diff()
33 {
34 local dir
35 for dir in */
36 do
37 echo ">>>> ${dir}err.txt"
38 diff -u ${dir}t1/*/_err.left ${dir}t1/*/_err.right || echo
39 echo ">>>> ${dir}out.txt"
40 diff -u ${dir}out.txt ${dir}t1/*/out.txt || echo
41 done
42 id
43 return $1
44 }
45
46 cd $mock/rt
47 tm . || show_diff $?