| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent afc59cd commit a8547bb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,15 @@ On OS X, you will also need: | |||
| 24 | 24 | this under the menu `Xcode -> Preferences -> Downloads` | |
| 25 | 25 | * This step will install `gcc` and the related toolchain containing `make` | |
| 26 | 26 | ||
| 27 | + * You may want to setup [firewall rules](tools/macosx-firewall.sh) to avoid | ||
| 28 | + popups asking to accept incoming network connections when running tests: | ||
| 29 | + | ||
| 30 | + ```console | ||
| 31 | + $ sudo ./tools/macosx-firewall.sh | ||
| 32 | + ``` | ||
| 33 | + Running this script will add rules for the executable `node` in the out | ||
| 34 | + directory and the symbolic `node` link in the projects root directory. | ||
| 35 | + | ||
| 27 | 36 | On FreeBSD and OpenBSD, you may also need: | |
| 28 | 37 | * libexecinfo | |
| 29 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,48 @@ | |||
| 1 | + #!/bin/bash | ||
| 2 | + # Script that adds rules to Mac OS X Socket Firewall to avoid | ||
| 3 | + # popups asking to accept incoming network connections when | ||
| 4 | + # running tests. | ||
| 5 | + SFW="/usr/libexec/ApplicationFirewall/socketfilterfw" | ||
| 6 | + TOOLSDIR="`dirname \"$0\"`" | ||
| 7 | + TOOLSDIR="`( cd \"$TOOLSDIR\" && pwd) `" | ||
| 8 | + ROOTDIR="`( cd \"$TOOLSDIR/..\" && pwd) `" | ||
| 9 | + OUTDIR="$TOOLSDIR/../out" | ||
| 10 | + # Using cd and pwd here so that the path used for socketfilterfw does not | ||
| 11 | + # contain a '..', which seems to cause the rules to be incorrectly added | ||
| 12 | + # and they are not removed when this script is re-run. Instead the new | ||
| 13 | + # rules are simply appended. By using pwd we can get the full path | ||
| 14 | + # without '..' and things work as expected. | ||
| 15 | + OUTDIR="`( cd \"$OUTDIR\" && pwd) `" | ||
| 16 | + NODE_RELEASE="$OUTDIR/Release/node" | ||
| 17 | + NODE_DEBUG="$OUTDIR/Debug/node" | ||
| 18 | + NODE_LINK="$ROOTDIR/node" | ||
| 19 | + CCTEST_RELEASE="$OUTDIR/Release/cctest" | ||
| 20 | + CCTEST_DEBUG="$OUTDIR/Debug/cctest" | ||
| 21 | + | ||
| 22 | + if [ -f $SFW ]; | ||
| 23 | + then | ||
| 24 | + # Duplicating these commands on purpose as the symbolic link node might be | ||
| 25 | + # linked to either out/Debug/node or out/Release/node depending on the | ||
| 26 | + # BUILDTYPE. | ||
| 27 | + $SFW --remove "$NODE_DEBUG" | ||
| 28 | + $SFW --remove "$NODE_DEBUG" | ||
| 29 | + $SFW --remove "$NODE_RELEASE" | ||
| 30 | + $SFW --remove "$NODE_RELEASE" | ||
| 31 | + $SFW --remove "$NODE_LINK" | ||
| 32 | + $SFW --remove "$CCTEST_DEBUG" | ||
| 33 | + $SFW --remove "$CCTEST_RELEASE" | ||
| 34 | + | ||
| 35 | + $SFW --add "$NODE_DEBUG" | ||
| 36 | + $SFW --add "$NODE_RELEASE" | ||
| 37 | + $SFW --add "$NODE_LINK" | ||
| 38 | + $SFW --add "$CCTEST_DEBUG" | ||
| 39 | + $SFW --add "$CCTEST_RELEASE" | ||
| 40 | + | ||
| 41 | + $SFW --unblock "$NODE_DEBUG" | ||
| 42 | + $SFW --unblock "$NODE_RELEASE" | ||
| 43 | + $SFW --unblock "$NODE_LINK" | ||
| 44 | + $SFW --unblock "$CCTEST_DEBUG" | ||
| 45 | + $SFW --unblock "$CCTEST_RELEASE" | ||
| 46 | + else | ||
| 47 | + echo "SocketFirewall not found in location: $SFW" | ||
| 48 | + fi | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments