aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/hipe_testsuite_driver.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-05-26 14:17:04 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-05-26 14:17:04 +0200
commit4d7b24dcb8f10ea8ddaa002601916fb389f0e87e (patch)
treefe7e75608465adbffd81e22ad7943b567a3caab4 /lib/hipe/test/hipe_testsuite_driver.erl
parent1081e3881e3994f381d122600d5db129c0ad0266 (diff)
parentf833a900897faae48230bc8c1e7572fb470a4a6f (diff)
downloadotp-4d7b24dcb8f10ea8ddaa002601916fb389f0e87e.tar.gz
otp-4d7b24dcb8f10ea8ddaa002601916fb389f0e87e.tar.bz2
otp-4d7b24dcb8f10ea8ddaa002601916fb389f0e87e.zip
Merge branch 'margnus1/hipe/maps-is_key-opts/PR-1069/OTP-13625'
* margnus1/hipe/maps-is_key-opts/PR-1069/OTP-13625: hipe: Add test suite for verifying optimisations Added elimination of maps:is_key/2 calls to HiPE
Diffstat (limited to 'lib/hipe/test/hipe_testsuite_driver.erl')
-rw-r--r--lib/hipe/test/hipe_testsuite_driver.erl24
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/hipe/test/hipe_testsuite_driver.erl b/lib/hipe/test/hipe_testsuite_driver.erl
index 64c5c0a7c9..03ec7adfd0 100644
--- a/lib/hipe/test/hipe_testsuite_driver.erl
+++ b/lib/hipe/test/hipe_testsuite_driver.erl
@@ -1,6 +1,6 @@
-module(hipe_testsuite_driver).
--export([create_all_suites/0, run/3]).
+-export([create_all_suites/1, run/3]).
-include_lib("kernel/include/file.hrl").
@@ -16,25 +16,17 @@
outputfile :: file:io_device(),
testcases :: [testcase()]}).
--spec create_all_suites() -> 'ok'.
+-spec create_all_suites([string()]) -> 'ok'.
-create_all_suites() ->
- {ok, Cwd} = file:get_cwd(),
- Suites = get_suites(Cwd),
+create_all_suites(SuitesWithSuiteSuffix) ->
+ Suites = get_suites(SuitesWithSuiteSuffix),
lists:foreach(fun create_suite/1, Suites).
--spec get_suites(file:filename()) -> [string()].
+-spec get_suites([string()]) -> [string()].
-get_suites(Dir) ->
- case file:list_dir(Dir) of
- {error, _} -> [];
- {ok, Filenames} ->
- FullFilenames = [filename:join(Dir, F) || F <- Filenames],
- Dirs = [suffix(filename:basename(F), ?suite_data) ||
- F <- FullFilenames,
- file_type(F) =:= {ok, 'directory'}],
- [S || {yes, S} <- Dirs]
- end.
+get_suites(SuitesWithSuiteSuffix) ->
+ Prefixes = [suffix(F, ?suite_suffix) || F <- SuitesWithSuiteSuffix],
+ [S || {yes, S} <- Prefixes].
suffix(String, Suffix) ->
case string:rstr(String, Suffix) of