Last active
March 1, 2017 13:29
-
-
Save dsilen/d181aa18d1a003ac1e0cd987c62d3fbb to your computer and use it in GitHub Desktop.
Run EUnit on all Erlang files in a directory. The tasks.json file is used to build+test with VSCode using Ctrl+Shift+B (Cmd+Shift+B on Mac).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
main([]) -> | |
{ok, Filenames} = file:list_dir("."), | |
[run_eunit(File) || File <- Filenames, string:right(File,10) == "_tests.erl", File =/= "run_tests.erl" ], | |
erlang:halt(0). | |
run_eunit(File) -> | |
compile:file(File), | |
Module = list_to_atom(filename:basename(File, ".erl")), | |
io:format("Testing ~-12s", [Module]), | |
eunit:test(Module). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.1.0", | |
"command": "escript", | |
"isShellCommand": false, | |
"args": ["run_tests.erl"], | |
"showOutput": "always" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Testing assignment1 All 5 tests passed. | |
Testing cut All 4 tests passed. | |
Testing fac 2 tests passed. | |
Testing fib All 3 tests passed. | |
Testing first Test passed. | |
Testing listfunc All 7 tests passed. | |
Testing second There were no tests to run. | |
Testing third All 3 tests passed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment