diff options
| author | Michael Bebenita <[email protected]> | 2010-09-07 18:26:19 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-09-07 18:41:08 -0700 |
| commit | a6aebdaedd4abb95b040c9cd09cfdb6b9b940789 (patch) | |
| tree | c143ba57b7ac8cf5a93f6871abb8a496f50e6fe6 /src/rt/test/rust_test_harness.cpp | |
| parent | Small updates to util classes. (diff) | |
| download | rust-a6aebdaedd4abb95b040c9cd09cfdb6b9b940789.tar.xz rust-a6aebdaedd4abb95b040c9cd09cfdb6b9b940789.zip | |
Started work on a framework for writing runtime tests, added some simple test cases.
Diffstat (limited to 'src/rt/test/rust_test_harness.cpp')
| -rw-r--r-- | src/rt/test/rust_test_harness.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/rt/test/rust_test_harness.cpp b/src/rt/test/rust_test_harness.cpp new file mode 100644 index 00000000..c33e170e --- /dev/null +++ b/src/rt/test/rust_test_harness.cpp @@ -0,0 +1,37 @@ +#include "../rust_internal.h" + +bool +rust_test::run() { + return false; +} + +const char * +rust_test::name() { + return "untitled"; +} + +rust_test_suite::rust_test_suite() { + tests.append(new rust_array_list_test()); + tests.append(new rust_synchronized_indexed_list_test()); +} + +rust_test_suite::~rust_test_suite() { + +} + +bool +rust_test_suite::run() { + bool pass = true; + for (size_t i = 0; i < tests.size(); i++) { + rust_test *test = tests[i]; + printf("test: %s running ... \n", test->name()); + if (tests[i]->run() == false) { + printf("test: %s FAILED\n", test->name()); + pass = false; + } else { + printf("test: %s PASSED\n", test->name()); + } + } + return pass; +} + |