diff options
Diffstat (limited to 'examples/scala-js/TESTING')
-rw-r--r-- | examples/scala-js/TESTING | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/examples/scala-js/TESTING b/examples/scala-js/TESTING new file mode 100644 index 0000000..7d393a4 --- /dev/null +++ b/examples/scala-js/TESTING @@ -0,0 +1,67 @@ +This file contains test cases that should be manually executed. + +## CLI Distribution + +For each major Scala version on a *NIX distro and a Windows distro: + +1. Download packaged Scala from scala-lang.org +2. Build Scala.js CLI distribution (e.g. `./assemble-cli.sh 2.10`) +3. Unpack Scala and Scala.js distro +4. Add `bin/` directories of both distributions to path (`export PATH=$PATH:<scala path>/bin:<scala.js path>/bin`) +5. Create a temporary directory and do: + + mkdir bin + echo 'import scala.scalajs.js.JSApp + object Foo extends JSApp { + + def main() = { + println(s"asdf ${1 + 1}") + new A + } + + class A + }' > foo.scala + scalajsc -d bin foo.scala + + scalajsp bin/Foo$.sjsir + # Verify output + scalajsp bin/Foo\$A.sjsir + # Verify output + + scalajsld -o test.js bin + # Verify output + + echo "Foo().main()" >> test.js + node test.js # Or your favorite thing to run JS + + # Expect "asdf 2" + +## HTML-Runners + +The following HTML-runners/testers must be manually tested: + + examples/helloworld/helloworld-{2.10|2.11}{|-fastopt}.html + examples/reversi/reversi-{2.10|2.11}{|-fastopt}.html + examples/testing/testing-{2.10|2.11}{|-fastopt}.html + test-suite/scalajs-test-suite-{2.10|2.11}{|-fastopt}.html + +## Sourcemaps + +To test source maps, do the following on: + + examples/reversi/reversi-{2.10|2.11}{|-fastopt}.html + +1. Open the respective file in Google Chrome +2. Set a break-point in the HTML launcher on the `new Reversi` statement +3. Step over calls to jQuery into constructor +4. Step into the call to `Array.tabulate` and verify that source maps + to Scala standard library sources work (should point to GitHub) +5. Single step through constructor, until you reach `buildUI()` +6. Step into `buildUI()` + + +## When releasing only + +Once all tests pass, tag the revision and verify that source maps to +Scala.js sources work correctly (should point to GitHub), following +the steps described in the section Sourcemaps. |