kripken/emscripten — Issue #118: Tests fail on OS X using Homebrewed dependencies. 
Author: mjfwest
Created: 2011-11-16 00:53:56+00:00
State: open

Hello

I installed the dependencies using homebrew.
```
sudo brew install llvm --HEAD --with-clang
sudo brew install closure-compiler
sudo brew install V8
sudo brew install SpiderMonkey
```
This places symlinks to everything in /usr/local/bin

```
which V8
/usr/local/bin/V8
which js
/usr/local/bin/js
which clang
/usr/bin/clang
which llvm-gcc
/usr/bin/llvm-gcc
```
Checking which version I have of llvm I got the -HEAD

```
llvm-gcc --version
i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.6)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
Clang version
```
clang --version
Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)
Target: x86_64-apple-darwin10
Thread model: posix
```
V8 version is 3.7.6
```
V8 version 3.7.6 [sample shell]
```
and SpiderMonkey is 1.8.0
```
js> version()
185
js> help()
JavaScript-C 1.8.0 pre-release 1 2007-10-03
```
I set up the ~/.emscripten file as follows, both with and without COMPILER_OPTS = ['-m32']

```
# This file will be copied to ~/.emscripten if that file doesn't exist.
# IMPORTANT: Edit it with the right paths!

EMSCRIPTEN_ROOT=os.path.expanduser("~/emscripten/emscripten/") # TODO: Use this

TEMP_DIR=os.path.expanduser('~/emscripten/temp')

LLVM_ROOT=os.path.expanduser('/usr/local/bin/')

COMPILER_OPTS = ['-m32']

SPIDERMONKEY_ENGINE = [os.path.expanduser('/usr/local/bin/js'), '-m', '-n']
V8_ENGINE = [os.path.expanduser('/usr/local/bin/v8')]

#COMPILER_ENGINE=SPIDERMONKEY_ENGINE
COMPILER_ENGINE=V8_ENGINE

JS_ENGINE=V8_ENGINE

TIMEOUT = None

# Tools

CLOSURE_COMPILER = os.path.expanduser('/usr/local/bin/')
```

None of the tests pass, as an example:

```
python tests/runner.py -v clang_0_0.test_hello_world
Running Emscripten tests...
test_hello_world (__main__.clang_0_0) ... ERROR

======================================================================
ERROR: test_hello_world (__main__.clang_0_0)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/runner.py", line 283, in test_hello_world
self.do_run(src, 'hello, world!')
File "tests/runner.py", line 254, in do_run
self.assertContained(expected_output, js_output)
File "tests/runner.py", line 181, in assertContained
limit_size(''.join([a.rstrip()+'\n' for a in difflib.unified_diff(value.split('\n'), string.split('\n'), fromfile='expected', tofile='actual')]))
Exception: Expected to find 'hello, world!' in 'JavaScript-C 1.8.0 pre-release 1 2007-10-03
usage: js [-zKPswWxCij] [-t timeoutSeconds] [-c stackchunksize] [-o option] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile] [scriptarg...]
', diff:

--- expected
+++ actual
@@ -1,1 +1,3 @@
-hello, world!
+JavaScript-C 1.8.0 pre-release 1 2007-10-03
+usage: js [-zKPswWxCij] [-t timeoutSeconds] [-c stackchunksize] [-o option] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile] [scriptarg...]
+

----------------------------------------------------------------------
Ran 1 test in 1.850s
```

Any ideas? I'm sorry if I've ignored your build instructions, but it would be very nice to get things working with easily installed homebrew recipies. I could then contribuite a complete recipe for emscripten.