Fix bugs in scripts
MODIFY
scripts/opt-alive.sh
scripts/opt-alive.sh
@@ -15,4 +15,11 @@ for p in $PASSES; do
done
done
-timeout 1000 $HOME/llvm/build/bin/opt -load=$HOME/alive2/build/tv/tv.so -tv-exit-on-error $TV $@ $TV -tv-smt-to=10000 -tv-report-dir=$HOME/alive2/build/logs -tv-smt-stats
+if [[ "$OSTYPE" == "darwin"* ]]; then
+ # Mac
+ TV_SHAREDLIB=tv.dylib
+else
+ # Linux, Cygwin/Msys, or Win32?
+ TV_SHAREDLIB=tv.so
+fi
+timeout 1000 $HOME/llvm/build/bin/opt -load=$HOME/alive2/build/tv/$TV_SHAREDLIB -tv-exit-on-error $TV $@ $TV -tv-smt-to=10000 -tv-report-dir=$HOME/alive2/build/logs -tv-smt-stats

MODIFY
scripts/stats.php
scripts/stats.php
@@ -11,7 +11,7 @@ $stats = array();
$knownfns = array();
$unsupported = array();
-foreach (glob("logs/*.txt") as $f) {
+foreach (glob("$logs/*.txt") as $f) {
$txt = file_get_contents($f);
preg_match_all('/ERROR: (.+)/S', $txt, $m);
foreach($m[1] as $err) {

MODIFY
tests/lit/lit/formats/alive2test.py
tests/lit/lit/formats/alive2test.py
@@ -104,8 +104,8 @@ class Alive2Test(TestFormat):
return lit.Test.FAIL, out + err
if exitCode != 0:
- if expect_err != None and string.find(err, expect_err.group(1)) != -1:
+ if expect_err != None and err.find(expect_err.group(1)) != -1:
return lit.Test.PASS, ''
- if xfail != None and string.find(err, xfail.group(1)) != -1:
+ if xfail != None and err.find(xfail.group(1)) != -1:
return lit.Test.XFAIL, ''
return lit.Test.FAIL, out + err

Fix bugs in scripts (#180)