[svn:parrot] r45014 - trunk/t/dynpmc

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Thu Mar 18 16:23:15 UTC 2010


Author: dukeleto
Date: Thu Mar 18 16:23:14 2010
New Revision: 45014
URL: https://trac.parrot.org/parrot/changeset/45014

Log:
[t] Fix the Rational PMC tests on Parrots without GMP

Modified:
   trunk/t/dynpmc/rational.t

Modified: trunk/t/dynpmc/rational.t
==============================================================================
--- trunk/t/dynpmc/rational.t	Thu Mar 18 14:57:15 2010	(r45013)
+++ trunk/t/dynpmc/rational.t	Thu Mar 18 16:23:14 2010	(r45014)
@@ -19,19 +19,27 @@
 .sub main :main
     .include 'test_more.pir'
     .include 'iglobals.pasm'
-    loadlib $P1, 'rational'
     .local pmc config_hash, interp
 
-    plan(55)
     interp = getinterp
     config_hash = interp[.IGLOBALS_CONFIG_HASH]
     $S0 = config_hash['gmp']
 
-    test_init()
-    test_version()
+    unless $S0 goto no_gmp
+    plan(55)
+    goto gmp_tests
+
+  no_gmp:
+    # seems like plan(0) is not supported currently
+    plan(1)
+    ok(1,'GMP not found, skipping Rational tests')
+    .return()
 
     # The following tests only run if GMP is installed
-    unless $S0 goto done
+ gmp_tests:
+    loadlib $P1, 'rational'
+    test_init()
+    test_version()
     test_set_get_native_int()
     test_set_get_native_float()
     test_set_get_native_string()
@@ -69,8 +77,6 @@
     test_abs()
     test_cmp()
     #test_equal_tt1517()
-  done:
-    .return()
 .end
 
 .sub test_neg


More information about the parrot-commits mailing list