diff options
author | Erik Norgren <[email protected]> | 2014-06-09 14:12:08 +0200 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2016-05-23 18:03:09 +0200 |
commit | f833a900897faae48230bc8c1e7572fb470a4a6f (patch) | |
tree | 582c8c3d2fdf6e8db36d0b61c98f18a59768495d /lib/hipe/test/hipe_testsuite_driver.erl | |
parent | b9068c94921e97cc918e9c8664c252af33bfaf39 (diff) | |
download | otp-f833a900897faae48230bc8c1e7572fb470a4a6f.tar.gz otp-f833a900897faae48230bc8c1e7572fb470a4a6f.tar.bz2 otp-f833a900897faae48230bc8c1e7572fb470a4a6f.zip |
hipe: Add test suite for verifying optimisations
* Added a suite opt_verify_SUITE.erl to HiPE that tests for the results
of optimisations, with a single testcase that checks that the
icode_call_elim optimisation pass does remove calls to maps:is_key/2
where sound and not otherwise.
* Made hipe_testsuite_driver only create explicitly listed suites.
Diffstat (limited to 'lib/hipe/test/hipe_testsuite_driver.erl')
-rw-r--r-- | lib/hipe/test/hipe_testsuite_driver.erl | 24 |
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 9f5d7421b4..15b267b72e 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 |