Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Apr 29, 2022
1 parent 21d2c2f commit 3f1d44b
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 50 deletions.
42 changes: 21 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ build
/.emscripten_sanity_wasm

# Tags files that get generated at runtime
/emscripten-releases-tot.txt
emsdkpy/emscripten-releases-tot.txt

# File that get download/extracted by emsdk itself
/ccache
/gnu
/upstream
/fastcomp
/fastcomp-clang/
/llvm
/ninja
/releases
/clang
/emscripten
/git
/node
/python
/temp
/zips
/crunch
/java
/mingw
/spidermonkey
/binaryen
emsdkpy/ccache
emsdkpy/gnu
emsdkpy/upstream
emsdkpy/fastcomp
emsdkpy/fastcomp-clang/
emsdkpy/llvm
emsdkpy/ninja
emsdkpy/releases
emsdkpy/clang
emsdkpy/emscripten
emsdkpy/git
emsdkpy/node
emsdkpy/python
emsdkpy/temp
emsdkpy/zips
emsdkpy/crunch
emsdkpy/java
emsdkpy/mingw
emsdkpy/spidermonkey
emsdkpy/binaryen
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ That explains how to use the emsdk to get the latest binary builds (without
compiling from source). Basically, that amounts to

```
./emsdk install latest
./emsdk activate latest
emsdkpy/emsdk install latest
emsdkpy/emsdk activate latest
```

## SDK Concepts
Expand Down Expand Up @@ -100,8 +100,8 @@ available tools, run `emsdk list`.
* If a tool/SDK is currently active, a star * will be shown next to it.
* If a tool/SDK is currently active, but the terminal your are calling emsdk
from does not have `PATH` and environment set up to utilize that tool, a star
in parentheses (\*) will be shown next to it. Run `emsdk_env.bat` (Windows) or
`source ./emsdk_env.sh` (Linux and OS X) to set up the environment for the
in parentheses (\*) will be shown next to it. Run `emsdkpy/emsdk_env.bat` (Windows) or
`source emsdkpy/emsdk_env.sh` (Linux and OS X) to set up the environment for the
calling terminal.

### How do I install a tool/SDK version?
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ COPY . ${EMSDK}

RUN echo "## Install Emscripten" \
&& cd ${EMSDK} \
&& ./emsdk install ${EMSCRIPTEN_VERSION} \
&& emsdkpy/emsdk install ${EMSCRIPTEN_VERSION} \
&& echo "## Done"

# This generates configuration that contains all valid paths according to installed SDK
# TODO(sbc): We should be able to use just emcc -v here but it doesn't
# currently create the sanity file.
RUN cd ${EMSDK} \
&& echo "## Generate standard configuration" \
&& ./emsdk activate ${EMSCRIPTEN_VERSION} \
&& emsdkpy/emsdk activate ${EMSCRIPTEN_VERSION} \
&& chmod 777 ${EMSDK}/upstream/emscripten \
&& chmod -R 777 ${EMSDK}/upstream/emscripten/cache \
&& echo "int main() { return 0; }" > hello.c \
Expand All @@ -41,7 +41,7 @@ RUN cd ${EMSDK} \

# Cleanup Emscripten installation and strip some symbols
RUN echo "## Aggressive optimization: Remove debug symbols" \
&& cd ${EMSDK} && . ./emsdk_env.sh \
&& cd ${EMSDK} && . emsdkpy/emsdk_env.sh \
# Remove debugging symbols from embedded node (extra 7MB)
&& strip -s `which node` \
# Tests consume ~80MB disc space
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions emsdkpy/emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3158,7 +3158,7 @@ def print_tools(t):

print('Items marked with * are activated for the current user.')
if has_partially_active_tools[0]:
env_cmd = 'emsdk_env.bat' if WINDOWS else 'source ./emsdk_env.sh'
env_cmd = 'emsdk_env.bat' if WINDOWS else 'source emsdkpy/emsdk_env.sh'
print('Items marked with (*) are selected for use, but your current shell environment is not configured to use them. Type "' + env_cmd + '" to set up your current shell to use them' + (', or call "emsdk activate --permanent <name_of_sdk>" to permanently activate them.' if WINDOWS else '.'))
if not arg_old:
print('')
Expand All @@ -3168,7 +3168,7 @@ def print_tools(t):
if is_emsdk_sourced_from_github():
print('Run "git pull" to pull in the latest list.')
else:
print('Run "./emsdk update" to pull in the latest list.')
print('Run "emsdkpy/emsdk update" to pull in the latest list.')

return 0
elif cmd == 'construct_env':
Expand Down
4 changes: 2 additions & 2 deletions emsdkpy/emsdk_env.csh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# because it won't have any effect then.
# That is, always run this script with
#
# source ./emsdk_env.csh
# source emsdkpy/emsdk_env.csh
#
# instead of just plainly running with
#
# ./emsdk_env.csh
# emsdkpy/emsdk_env.csh
#
# which won't have any effect.
set SRC=($_)
Expand Down
2 changes: 1 addition & 1 deletion emsdkpy/emsdk_env.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#In your Fish configuration, add this line:
#alias emsdk_setup ". /path/to/emsdk/emsdk_env.fish"
#alias emsdk_setup ". /path/to/emsdk/emsdkpy/emsdk_env.fish"
#Now, when you want to use the SDK, run this alias first to set up
#your environment.

Expand Down
6 changes: 3 additions & 3 deletions emsdkpy/emsdk_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
# because it won't have any effect then.
# That is, always run this script with
#
# . /path/to/emsdk_env.sh
# . /path/to/emsdkpy/emsdk_env.sh
#
# or
#
# source /path/to/emsdk_env.sh
# source /path/to/emsdkpy/emsdk_env.sh
#
# instead of just plainly running with
#
# ./emsdk_env.sh
# emsdkpy/emsdk_env.sh
#
# which won't have any effect.

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ console_scripts =
emsdk = emsdkpy.emsdk:main

[options.package_data]
emsdkpy = *.txt, *.bat, *.csh, *.fish, *.ps1, *.sh, *.json
emsdkpy = emsdk, *.txt, *.bat, *.csh, *.fish, *.ps1, *.sh, *.json
6 changes: 3 additions & 3 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
emconfig = os.environ['EM_CONFIG']
upstream_emcc = os.path.join('upstream', 'emscripten', 'emcc')
fastcomp_emcc = os.path.join('fastcomp', 'emscripten', 'emcc')
emsdk = './emsdk'
emsdk = 'emsdkpy/emsdk'
if WINDOWS:
upstream_emcc += '.bat'
fastcomp_emcc += '.bat'
emsdk = 'emsdk.bat'
emsdk = 'emsdkpy/emsdk.bat'
else:
emsdk = './emsdk'
emsdk = 'emsdkpy/emsdk'

# Utilities

Expand Down
18 changes: 9 additions & 9 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ set -e

# Test that arbitrary (non-released) versions can be installed and
# activated.
./emsdk install sdk-upstream-5c776e6a91c0cb8edafca16a652ee1ee48f4f6d2
./emsdk activate sdk-upstream-5c776e6a91c0cb8edafca16a652ee1ee48f4f6d2
source ./emsdk_env.sh
emsdkpy/emsdk install sdk-upstream-5c776e6a91c0cb8edafca16a652ee1ee48f4f6d2
emsdkpy/emsdk activate sdk-upstream-5c776e6a91c0cb8edafca16a652ee1ee48f4f6d2
source emsdkpy/emsdk_env.sh
which emcc
emcc -v

# Install an older version of the SDK that requires EM_CACHE to be
# set in the environment, so that we can test it is later removed
./emsdk install sdk-fastcomp-3b8cff670e9233a6623563add831647e8689a86b
./emsdk activate sdk-fastcomp-3b8cff670e9233a6623563add831647e8689a86b
source ./emsdk_env.sh
emsdkpy/emsdk install sdk-fastcomp-3b8cff670e9233a6623563add831647e8689a86b
emsdkpy/emsdk activate sdk-fastcomp-3b8cff670e9233a6623563add831647e8689a86b
source emsdkpy/emsdk_env.sh
which emcc
emcc -v
test -n "$EM_CACHE"

# Install the latest version of the SDK which is the expected precondition
# of test.py.
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh --build=Release
emsdkpy/emsdk install latest
emsdkpy/emsdk activate latest
source emsdkpy/emsdk_env.sh --build=Release
# Test that EM_CACHE was unset
test -z "$EM_CACHE"

Expand Down
2 changes: 1 addition & 1 deletion test/test_source_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mkdir -p "$ABS_LINK_DIR"
(cd $DIR/.. && ln -s `pwd` "$ABS_LINK_DIR/emsdk")
(cd $DIR/.. && ln -s `pwd`/emsdk_env.sh "$ABS_LINK_DIR")

PATH1="$DIR/../emsdk_env.sh"
PATH1="$DIR/emsdk_env.sh"
PATH2="$REL_LINK_DIR/emsdk/emsdk_env.sh"
PATH3="$REL_LINK_DIR/emsdk_env.sh"
PATH4="$ABS_LINK_DIR/emsdk/emsdk_env.sh"
Expand Down

0 comments on commit 3f1d44b

Please sign in to comment.