6 hashes="$location/hashes"
7 options="$location/options"
9 #download required things
10 download_list=$(wget -qO- ${list})
11 download_hashes=$(wget -qO- ${hashes})
12 download_options=$(wget -qO- ${options})
15 pushd ~/.gmqcc/testsuite > /dev/null
16 echo "$download_list" | while read -r line
18 echo "downloading $line ..."
19 wget -q "${location}/$line"
22 echo "$download_hashes" > ~/.gmqcc/testsuite/hashes
23 echo "$download_options" > ~/.gmqcc/testsuite/options
28 if [ -z "$download_list" -o -z "$download_hashes" -o -z "$download_options" ]; then
29 echo "failed to download required information to check projects."
31 if [ "$(ping -q -c1 "${host}")" ]; then
32 echo "host ${host} seems to be up but missing required files."
33 echo "please file bug report at: github.com/graphitemaster/gmqcc"
35 echo "host ${host} seems to be down, please try again later."
42 # we have existing contents around
43 if [ -f ~/.gmqcc/testsuite/hashes -a -f ~/.gmqcc/testsuite/options ]; then
44 echo "$download_hashes" > /tmp/gmqcc_download_hashes
45 echo "$download_options" > /tmp/gmqcc_download_options
47 diff -u ~/.gmqcc/testsuite/hashes /tmp/gmqcc_download_hashes > /dev/null
49 diff -u ~/.gmqcc/testsuite/options /tmp/gmqcc_download_options > /dev/null
52 if [ $check_hash -ne 0 -o $check_opts -ne 0 ]; then
53 echo "consistency errors in hashes (possible update), obtaining fresh contents"
54 rm -rf ~/.gmqcc/testsuite/projects
55 rm ~/.gmqcc/testsuite/*.zip
60 # do we even have the directory
61 echo "preparing project testsuite for the first time"
62 if [ ! -d ~/.gmqcc/testsuite ]; then
63 mkdir -p ~/.gmqcc/testsuite
69 if [ ! -d ~/.gmqcc/testsuite/projects ]; then
70 mkdir -p ~/.gmqcc/testsuite/projects
71 pushd ~/.gmqcc/testsuite/projects > /dev/null
72 echo "$(ls ../ | cat | grep -v '^hashes$' | grep -v '^projects$' | grep -v '^options$')" | while read -r line
74 echo "extracting project $line"
75 mkdir "$(echo "$line" | sed 's/\(.*\)\..*/\1/')"
76 unzip -qq "../$line" -d $(echo "$line" | sed 's/\(.*\)\..*/\1/')
80 echo "previous state exists, using it"
83 # compile projects in those directories
85 env -i type gmqcc 1>/dev/null 2>&1 || {
86 if [ -f ../gmqcc ]; then
87 echo "previous build of gmqcc exists, using it"
88 gmqcc_bin="$(pwd)/../gmqcc"
89 elif [ -f ./gmqcc ]; then
90 echo "previous build of gmqcc exists, using it"
91 gmqcc_bin="$(pwd)/gmqcc"
93 echo "gmqcc not installed and previous build doesn't exist"
94 echo "please run make, or make install"
99 pushd ~/.gmqcc/testsuite/projects > /dev/null
100 find . -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | while read -r line
103 echo -n "compiling $line... "
104 pushd "$line" > /dev/null
106 # does the project have multiple subprojects?
108 cat dirs | while read -r dir
110 # change to subproject
111 pushd "$dir" > /dev/null
112 "$gmqcc_bin" $(cat ../../../options | grep "$line:" | awk '{print $2}') > /dev/null 2>&1
113 if [ $? -ne 0 ]; then
118 # nope only one project
120 "$gmqcc_bin" $(cat ../../options | grep "$line:" | awk '{print $2}') > /dev/null 2>&1
121 if [ $? -ne 0 ]; then
127 if [ $error -ne 0 ]; then