]> gitweb.michael.orlitzky.com - octave.git/blobdiff - run-tests.m
Output totals at the end of the test suite.
[octave.git] / run-tests.m
index 1f6d561f00904f5e9852d224d7d117695d5125bc..0bf037f4e207c3c3645fa44881fc9546c1504baf 100755 (executable)
@@ -1,44 +1,21 @@
 #!/usr/bin/octave --silent
+#
+# You'll need to use the .octaverc in this directory to get the proper
+# paths.
+#
 
-unit_init(1, {});
-
-unit_test_equals("sin[0] == 0", ...
-                0, ...
-                divided_difference(@sin, 0));
-
-unit_test_equals("sin[0, pi] == 0", ...
-                0, ...
-                divided_difference(@sin, [0,pi]));
-
-unit_test_equals("sin[0, pi, 2*pi] == 0", ...
-                0, ...
-                divided_difference(@sin, [0,pi,2*pi]));
+addpath('./unit_test');
 
-unit_test_equals("zero order divided_difference_coefficients", ...
-                [1], ...
-                divided_difference_coefficients([0]));
+global unittest_results;
 
-unit_test_equals("first order divided_difference_coefficients", ...
-                [-1, 1] / pi, ...
-                divided_difference_coefficients([0, pi]));
-
-unit_test_equals("second order divided_difference_coefficients", ...
-                [1, -2, 1] / (2*pi^2), ...
-                divided_difference_coefficients([0, pi, 2*pi]));
-
-
-unit_test_equals("1 is odd", ...
-                true, ...
-                odd(1));
+unit_init(1, {});
 
-unit_test_equals("1 is not even", ...
-                false, ...
-                even(1));
+test_files = glob('tests/*.m');
 
-unit_test_equals("2 is not odd", ...
-                false, ...
-                odd(2));
+## Source every file that matches the glob above.
+cellfun(@source, test_files);
 
-unit_test_equals("2 is even", ...
-                true, ...
-                even(2));
+fprintf('\n');
+fprintf('Total tests attempted: %d\n', unittest_results.total);
+fprintf('Total tests passed: %d\n', unittest_results.pass);
+fprintf('Total tests failed: %d\n', unittest_results.fail);