Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a cmake option to disable McMini tests, and rename some existing ones
[simgrid.git] / tools / jenkins / DynamicAnalysis.sh
1 #!/usr/bin/env sh
2
3 die() {
4     echo "$@"
5     exit 1
6 }
7
8 [ -n "$WORKSPACE" ] || die "No WORKSPACE"
9 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
10
11 echo "XXXX Cleanup previous attempts. Remaining content of /tmp:"
12 rm -f /tmp/cc*
13 rm -f /tmp/simgrid-mc-*
14 rm -f /tmp/*.so
15 rm -f /tmp/*.so.*
16 ls /tmp
17 df -h
18 echo "XXXX Let's go"
19
20 set -e
21
22 ### Check the node installation
23
24 pkg_check() {
25   for pkg
26   do
27     if command -v "$pkg"
28     then
29        echo "$pkg is installed. Good."
30     else
31        die "please install $pkg before proceeding"
32     fi
33   done
34 }
35
36 pkg_check valgrind pcregrep
37
38 ### Cleanup previous runs
39
40 do_cleanup() {
41   for d
42   do
43     if [ -d "$d" ]
44     then
45       rm -rf "$d" || die "Could not remove $d"
46     fi
47     mkdir "$d" || die "Could not create $d"
48   done
49   find "$WORKSPACE" -name "memcheck_test_*.memcheck" -exec rm {} \;
50 }
51
52 do_cleanup "$WORKSPACE/build" "$WORKSPACE/memcheck"
53
54 NUMPROC="$(nproc)" || NUMPROC=1
55
56 cd "$WORKSPACE"/build
57
58 ### Proceed with the tests
59 ctest -D ExperimentalStart || true
60
61 cmake -Denable_documentation=OFF -Denable_python=OFF \
62       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
63       -Denable_mallocators=OFF \
64       -Denable_smpi=ON -Denable_testsuite_smpi_MPICH3=OFF -Denable_testsuite_McMini=OFF -Denable_model-checking=OFF \
65       -Denable_ns3=ON \
66       -Denable_memcheck_xml=ON -DLTO_EXTRA_FLAG="auto" "$WORKSPACE"
67
68
69 make -j$NUMPROC tests
70 ctest --no-compress-output -D ExperimentalTest -j$NUMPROC || true
71
72 cd "$WORKSPACE"/build
73 if [ -f Testing/TAG ] ; then
74    find "$WORKSPACE" -iname "*.memcheck" -exec mv {} "$WORKSPACE"/memcheck \;
75    #remove all "empty" files
76    grep -r -L "error>" "$WORKSPACE"/memcheck | xargs rm -f
77    mv Testing/"$(head -n 1 < Testing/TAG)"/Test.xml  "$WORKSPACE"/DynamicAnalysis.xml
78 fi