[erlang-getopt] Finally fixed tests on EL5

Peter Lemenkov peter at fedoraproject.org
Thu Oct 11 14:53:42 UTC 2012


commit a051755b144c889c91bdcb26c12b245a69f0b426
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Thu Oct 11 18:53:34 2012 +0400

    Finally fixed tests on EL5
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 ...-getopt-0001-No-such-type-boolean-in-R12B.patch |   48 +------------------
 ...No-such-function-lists-keyfind-3-in-R12B5.patch |    2 +-
 erlang-getopt.spec                                 |   13 +++---
 3 files changed, 11 insertions(+), 52 deletions(-)
---
diff --git a/erlang-getopt-0001-No-such-type-boolean-in-R12B.patch b/erlang-getopt-0001-No-such-type-boolean-in-R12B.patch
index 758cb83..f072468 100644
--- a/erlang-getopt-0001-No-such-type-boolean-in-R12B.patch
+++ b/erlang-getopt-0001-No-such-type-boolean-in-R12B.patch
@@ -1,13 +1,12 @@
-From 4b864b76812d2143f55ffccd5fba476d85e13257 Mon Sep 17 00:00:00 2001
+From 09b286ed0b22f9a88c38f46a1b9f3d3d19f5f191 Mon Sep 17 00:00:00 2001
 From: Peter Lemenkov <lemenkov at gmail.com>
 Date: Tue, 15 May 2012 22:42:30 +0400
 Subject: [PATCH 1/2] No such type - boolean() in R12B
 
 Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
 ---
- src/getopt.erl       | 19 +++++++++----------
- test/getopt_test.erl | 10 +++++-----
- 2 files changed, 14 insertions(+), 15 deletions(-)
+ src/getopt.erl | 19 +++++++++----------
+ 1 file changed, 9 insertions(+), 10 deletions(-)
 
 diff --git a/src/getopt.erl b/src/getopt.erl
 index f4773bd..e37f90b 100644
@@ -91,47 +90,6 @@ index f4773bd..e37f90b 100644
  is_non_neg_float_arg([Head | Tail]) when (Head >= $0 andalso Head =< $9) orelse Head =:= $. ->
      is_non_neg_float_arg(Tail);
  is_non_neg_float_arg([_Head | _Tail]) ->
-diff --git a/test/getopt_test.erl b/test/getopt_test.erl
-index cbfd851..0b8f1cf 100644
---- a/test/getopt_test.erl
-+++ b/test/getopt_test.erl
-@@ -33,23 +33,23 @@ parse_main_test_() ->
-     Short3          = {short3,             $c,        undefined,            undefined,                      "Third option with only short form and no argument"},
-     ShortArg        = {short_arg,          $d,        undefined,            string,                         "Option with only short form and argument"},
-     ShortDefArg     = {short_def_arg,      $e,        undefined,            {string, "default-short"},      "Option with only short form and default argument"},
--    ShortBool       = {short_bool,         $f,        undefined,            boolean,                        "Option with only short form and boolean argument"},
-+    ShortBool       = {short_bool,         $f,        undefined,            bool,                        "Option with only short form and bool argument"},
-     ShortInt        = {short_int,          $g,        undefined,            integer,                        "Option with only short form and integer argument"},
-     ShortFloat      = {short_float,        $h,        undefined,            float,                          "Option with only short form and float argument"},
-     Long            = {long,               undefined, "long",               undefined,                      "Option with only long form and no argument"},
-     LongArg         = {long_arg,           undefined, "long-arg",           string,                         "Option with only long form and argument"},
-     LongDefArg      = {long_def_arg,       undefined, "long-def-arg",       {string, "default-long"},       "Option with only long form and default argument"},
--    LongBool        = {long_bool,          undefined, "long-bool",          boolean,                        "Option with only long form and boolean argument"},
-+    LongBool        = {long_bool,          undefined, "long-bool",          bool,                        "Option with only long form and bool argument"},
-     LongInt         = {long_int,           undefined, "long-int",           integer,                        "Option with only long form and integer argument"},
-     LongFloat       = {long_float,         undefined, "long-float",         float,                          "Option with only long form and float argument"},
-     ShortLong       = {short_long,         $i,        "short-long",         undefined,                      "Option with short form, long form and no argument"},
-     ShortLongArg    = {short_long_arg,     $j,        "short-long-arg",     string,                         "Option with short form, long form and argument"},
-     ShortLongDefArg = {short_long_def_arg, $k,        "short-long-def-arg", {string, "default-short-long"}, "Option with short form, long form and default argument"},
--    ShortLongBool   = {short_long_bool,    $l,        "short-long-bool",    boolean,                        "Option with short form, long form and boolean argument"},
-+    ShortLongBool   = {short_long_bool,    $l,        "short-long-bool",    bool,                        "Option with short form, long form and bool argument"},
-     ShortLongInt    = {short_long_int,     $m,        "short-long-int",     integer,                        "Option with short form, long form and integer argument"},
-     ShortLongFloat  = {short_long_float,   $n,        "short-long-float",   float,                          "Option with short form, long form and float argument"},
-     NonOptArg       = {non_opt_arg,        undefined, undefined,            undefined,                      "Non-option argument"},
--    NonOptBool      = {non_opt_bool,       undefined, undefined,            boolean,                        "Non-option boolean argument"},
-+    NonOptBool      = {non_opt_bool,       undefined, undefined,            bool,                        "Non-option bool argument"},
-     NonOptInt       = {non_opt_int,        undefined, undefined,            integer,                        "Non-option integer argument"},
-     NonOptFloat     = {non_opt_float,      undefined, undefined,            float,                          "Non-option float argument"},
-     CombinedOptSpecs =
-@@ -225,7 +225,7 @@ parse_multiple_repetitions_test_() ->
-          {define,      $D,        "define",      string,                "Define a variable"},
-          {debug,       $d,        "debug",       integer,               "Debug level"},
-          {offset,      $o,        "offset",      float,                 "Offset"},
--         {verbose,     $v,        "verbose",     boolean,               "Enable verbose output"}
-+         {verbose,     $v,        "verbose",     bool,               "Enable verbose output"}
-         ],
-     [
-      {"Multiple repetitions of the same option",
 -- 
 1.7.12
 
diff --git a/erlang-getopt-0002-No-such-function-lists-keyfind-3-in-R12B5.patch b/erlang-getopt-0002-No-such-function-lists-keyfind-3-in-R12B5.patch
index d3cb08d..85b14fd 100644
--- a/erlang-getopt-0002-No-such-function-lists-keyfind-3-in-R12B5.patch
+++ b/erlang-getopt-0002-No-such-function-lists-keyfind-3-in-R12B5.patch
@@ -1,4 +1,4 @@
-From dc29e4a91da23a78db631ac12b1926c841d7e2ca Mon Sep 17 00:00:00 2001
+From fd56477fa16ab741d44b0d02610b2a7b6576bcf8 Mon Sep 17 00:00:00 2001
 From: Peter Lemenkov <lemenkov at gmail.com>
 Date: Fri, 1 Jun 2012 10:26:25 +0400
 Subject: [PATCH 2/2] No such function lists:keyfind/3 in R12B5
diff --git a/erlang-getopt.spec b/erlang-getopt.spec
index 9cddfcf..f43f082 100644
--- a/erlang-getopt.spec
+++ b/erlang-getopt.spec
@@ -7,7 +7,7 @@
 
 Name:		erlang-%{realname}
 Version:	0.5.2
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	Erlang module to parse command line arguments using the GNU getopt syntax
 Group:		Development/Libraries
 License:	BSD
@@ -46,11 +46,8 @@ rebar doc -v
 
 
 %check
-%if 0%{?el5}
-echo "skip testing for EL5 (broken for now although app is working)"
-%else
-rebar eunit -v || true
-%endif
+# BEWARE rebar needs bootstrapping
+rebar eunit -v
 
 
 %install
@@ -72,6 +69,10 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Thu Oct 11 2012 Peter Lemenkov <lemenkov at gmail.com> - 0.5.2-2
+- Rebuild with tests
+- Finally fixed tests on EL5
+
 * Thu Oct 11 2012 Peter Lemenkov <lemenkov at gmail.com> - 0.5.2-1
 - Ver. 0.5.2
 


More information about the scm-commits mailing list