diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2011-02-04 23:40:06 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2011-02-04 23:40:06 +0000 |
commit | 1918e2a8442ef35c75304e8ce3b33b7a0717591a (patch) | |
tree | f4c3c721984c3d6cf0875f1b04b4c5597b169700 | |
parent | 74883f1dd7b22fdca609787300460f5550aec095 (diff) | |
download | swig-1918e2a8442ef35c75304e8ce3b33b7a0717591a.tar.gz |
Make R unittests pass failure to the Make system, otherwise failures are masked and won't be seen
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12431 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | Examples/test-suite/r/unittest.R | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Examples/test-suite/r/unittest.R b/Examples/test-suite/r/unittest.R index 81c590a3f..0633c7715 100644 --- a/Examples/test-suite/r/unittest.R +++ b/Examples/test-suite/r/unittest.R @@ -1,9 +1,17 @@ unittest <- function (x,y) { -if (x==y) print("PASS") -else print("FAIL") + if (x==y) { + print("PASS") + } else { + print("FAIL") + stop("Test failed") + } } unittesttol <- function(x,y,z) { -if (abs(x-y) < z) print("PASS") -else print("FAIL") -}
\ No newline at end of file + if (abs(x-y) < z) { + print("PASS") + } else { + print("FAIL") + stop("Test failed") + } +} |