From 7441d5250e8fc1df9019c7dc5dd840db0a732126 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 15 Mar 2019 12:51:22 -0400 Subject: [PATCH] Partially address #338: Provide simple method for interactive testing This adds a basic repl-like console webpage that can be used for testing of the local pyodide install. It removes the broken examples based on standalone iodide. --- Makefile | 25 +--- README.md | 13 +- src/console.html | 49 +++++++ src/matplotlib-sideload.html | 60 ++------ src/matplotlib.html | 209 --------------------------- src/python.html | 267 ----------------------------------- src/python_dev.html | 68 --------- 7 files changed, 72 insertions(+), 619 deletions(-) create mode 100644 src/console.html delete mode 100644 src/matplotlib.html delete mode 100644 src/python.html delete mode 100644 src/python_dev.html diff --git a/Makefile b/Makefile index d59e43601..5b6f7b1e9 100644 --- a/Makefile +++ b/Makefile @@ -50,10 +50,7 @@ all: build/pyodide.asm.js \ build/pyodide.asm.data \ build/pyodide.js \ build/pyodide_dev.js \ - build/python.html \ - build/python_dev.html \ - build/matplotlib.html \ - build/matplotlib-sideload.html \ + build/console.html \ build/renderedhtml.css \ build/test.data \ build/packages.json \ @@ -91,26 +88,14 @@ build/pyodide.js: src/pyodide.js sed -i -e "s#{{ABI}}#$(PYODIDE_PACKAGE_ABI)#g" $@ -build/python.html: src/python.html - cp $< $@ - - -build/python_dev.html: src/python_dev.html - cp $< $@ - - -build/matplotlib.html: src/matplotlib.html - cp $< $@ - - -build/matplotlib-sideload.html: src/matplotlib-sideload.html - cp $< $@ - - build/test.html: src/test.html cp $< $@ +build/console.html: src/console.html + cp $< $@ + + build/renderedhtml.css: src/renderedhtml.less lessc $< $@ diff --git a/README.md b/README.md index d23868c96..2737485f2 100644 --- a/README.md +++ b/README.md @@ -66,24 +66,27 @@ on your `PATH`. # Manual Testing -The port 8000 of the docker environment and the host system are automatically +The port 8000 of the docker environment and the host system are automatically binded when ``./run_docker`` is run. -This can be used to test the ``pyodide`` builds running within the docker +This can be used to test the ``pyodide`` builds running within the docker environment using external browser programs on the host system. To do this, simply run ``./bin/pyodide serve`` This serves the ``build`` directory of the ``pyodide`` project on port 8000. -* To serve a different directory, use the ``--build_dir`` argument followed by +* To serve a different directory, use the ``--build_dir`` argument followed by the path of the directory -* To serve on a different port, use the ``--port`` argument followed by the +* To serve on a different port, use the ``--port`` argument followed by the desired port number -Make sure that the port passed in ``--port`` argument is same as the one +Make sure that the port passed in ``--port`` argument is same as the one defined as ``DOCKER_PORT`` in the ``run_docker`` script. +Once the webserver is running, for simple interactive testing, visit the URL +[http://localhost:8000/console.html](http://localhost:8000/console.html) + # Benchmarking Install the same dependencies as for testing. diff --git a/src/console.html b/src/console.html new file mode 100644 index 000000000..fe50ec47c --- /dev/null +++ b/src/console.html @@ -0,0 +1,49 @@ + + + + + + + + + + + + + diff --git a/src/matplotlib-sideload.html b/src/matplotlib-sideload.html index 20821d279..30b8d165b 100644 --- a/src/matplotlib-sideload.html +++ b/src/matplotlib-sideload.html @@ -2,45 +2,9 @@ -Python - iodide - +Loading matplotlib example... - -
- - - diff --git a/src/python.html b/src/python.html deleted file mode 100644 index cf58601a6..000000000 --- a/src/python.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - -Python - iodide - - - - -
- - - diff --git a/src/python_dev.html b/src/python_dev.html deleted file mode 100644 index 1db6f0219..000000000 --- a/src/python_dev.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - -Python - iodide - - - - -
- - -