mirror of
https://github.com/correl/elm.git
synced 2024-12-18 11:06:17 +00:00
Add test running wrappers
This commit is contained in:
parent
7ddb1b57c6
commit
cb3e064605
52 changed files with 151 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@ bin/configlet
|
|||
bin/configlet.exe
|
||||
elm-stuff
|
||||
CHECKLIST
|
||||
build.js
|
||||
|
|
|
@ -11,7 +11,8 @@ do
|
|||
mv "$exercise_dir/$exercise.example" "$exercise_dir/$exercise.elm"
|
||||
echo '-------------------------------------------------------'
|
||||
echo "Testing $exercise"
|
||||
elm-test $exercise_dir/*Tests.elm
|
||||
|
||||
elm-make $exercise_dir/*Tests.elm --output build.js && node build.js
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
TEST_RESULT=1
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
The simplest way to install Elm is via Node.js/NPM.
|
||||
|
||||
If you don't already have Node.js installed on your computer, you can download it from [the official site](https://nodejs.org/). Once you have Node.js up and running, follow these steps to install the Elm platform and elm-test.
|
||||
If you don't already have Node.js installed on your computer, you can download it from [the official site](https://nodejs.org/). Once you have Node.js up and running, follow these steps to install the Elm platform.
|
||||
|
||||
```bash
|
||||
$ npm install --global elm elm-test
|
||||
$ npm install --global elm
|
||||
```
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
Elm exercises within your exercism project directory can be run by changing to the exercise directory, and running `elm-test NameOfTests.elm`.
|
||||
Elm exercises within your exercism project directory can be run by changing to the exercise directory, and running `./runtests.sh` (or `runtests.bat` on Windows).
|
||||
|
||||
```bash
|
||||
$ cd exercism/project/directory/elm/hello-world
|
||||
$ elm-test HelloWorldTests.elm
|
||||
$ ./runtests.sh
|
||||
```
|
||||
|
||||
When you first run `elm-test` for an exercise it will prompt you to install the test library dependencies. If you type "y" and hit enter, the script should take care of the rest.
|
||||
|
||||
## Hints and tips
|
||||
|
||||
### Coding the exercise
|
||||
|
|
4
exercises/accumulate/runtests.bat
Executable file
4
exercises/accumulate/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/accumulate/runtests.sh
Executable file
2
exercises/accumulate/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/allergies/runtests.bat
Executable file
4
exercises/allergies/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/allergies/runtests.sh
Executable file
2
exercises/allergies/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/anagram/runtests.bat
Executable file
4
exercises/anagram/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/anagram/runtests.sh
Executable file
2
exercises/anagram/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/bob/runtests.bat
Executable file
4
exercises/bob/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/bob/runtests.sh
Executable file
2
exercises/bob/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/difference-of-squares/runtests.bat
Executable file
4
exercises/difference-of-squares/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/difference-of-squares/runtests.sh
Executable file
2
exercises/difference-of-squares/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/grade-school/runtests.bat
Executable file
4
exercises/grade-school/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/grade-school/runtests.sh
Executable file
2
exercises/grade-school/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/hamming/runtests.bat
Executable file
4
exercises/hamming/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/hamming/runtests.sh
Executable file
2
exercises/hamming/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/hello-world/runtests.bat
Executable file
4
exercises/hello-world/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/hello-world/runtests.sh
Executable file
2
exercises/hello-world/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/leap/runtests.bat
Executable file
4
exercises/leap/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/leap/runtests.sh
Executable file
2
exercises/leap/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/list-ops/runtests.bat
Executable file
4
exercises/list-ops/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/list-ops/runtests.sh
Executable file
2
exercises/list-ops/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/nucleotide-count/runtests.bat
Executable file
4
exercises/nucleotide-count/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/nucleotide-count/runtests.sh
Executable file
2
exercises/nucleotide-count/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/pangram/runtests.bat
Executable file
4
exercises/pangram/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/pangram/runtests.sh
Executable file
2
exercises/pangram/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/phone-number/runtests.bat
Executable file
4
exercises/phone-number/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/phone-number/runtests.sh
Executable file
2
exercises/phone-number/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/raindrops/runtests.bat
Executable file
4
exercises/raindrops/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/raindrops/runtests.sh
Executable file
2
exercises/raindrops/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/rna-transcription/runtests.bat
Executable file
4
exercises/rna-transcription/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/rna-transcription/runtests.sh
Executable file
2
exercises/rna-transcription/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/robot-simulator/runtests.bat
Executable file
4
exercises/robot-simulator/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/robot-simulator/runtests.sh
Executable file
2
exercises/robot-simulator/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/run-length-encoding/runtests.bat
Executable file
4
exercises/run-length-encoding/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/run-length-encoding/runtests.sh
Executable file
2
exercises/run-length-encoding/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/series/runtests.bat
Executable file
4
exercises/series/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/series/runtests.sh
Executable file
2
exercises/series/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/space-age/runtests.bat
Executable file
4
exercises/space-age/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/space-age/runtests.sh
Executable file
2
exercises/space-age/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/strain/runtests.bat
Executable file
4
exercises/strain/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/strain/runtests.sh
Executable file
2
exercises/strain/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/sublist/runtests.bat
Executable file
4
exercises/sublist/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/sublist/runtests.sh
Executable file
2
exercises/sublist/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/sum-of-multiples/runtests.bat
Executable file
4
exercises/sum-of-multiples/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/sum-of-multiples/runtests.sh
Executable file
2
exercises/sum-of-multiples/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/triangle/runtests.bat
Executable file
4
exercises/triangle/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/triangle/runtests.sh
Executable file
2
exercises/triangle/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
4
exercises/word-count/runtests.bat
Executable file
4
exercises/word-count/runtests.bat
Executable file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
for %%f in (*Tests.elm) do (
|
||||
elm-make %%f --yes --output build.js && node build.js
|
||||
)
|
2
exercises/word-count/runtests.sh
Executable file
2
exercises/word-count/runtests.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
elm-make *Tests.elm --yes --output build.js && node build.js
|
Loading…
Reference in a new issue