[svn-commits] mnicholson: branch mnicholson/asttest r167241 - in /team/mnicholson/asttest/a...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Jan 5 12:02:24 CST 2009
Author: mnicholson
Date: Mon Jan 5 12:02:24 2009
New Revision: 167241
URL: http://svn.digium.com/view/asterisk?view=rev&rev=167241
Log:
Renamed test_suite to testsuite
* asttest/include/asttest/testsuite.h: rename struct test_suite to struct
testsuite
* asttest/lib/testsuite.c: updated
* asttest/asttest.c: updated
Modified:
team/mnicholson/asttest/asttest/asttest.c
team/mnicholson/asttest/asttest/include/asttest/testsuite.h
team/mnicholson/asttest/asttest/lib/testsuite.c
Modified: team/mnicholson/asttest/asttest/asttest.c
URL: http://svn.digium.com/view/asterisk/team/mnicholson/asttest/asttest/asttest.c?view=diff&rev=167241&r1=167240&r2=167241
==============================================================================
--- team/mnicholson/asttest/asttest/asttest.c (original)
+++ team/mnicholson/asttest/asttest/asttest.c Mon Jan 5 12:02:24 2009
@@ -69,7 +69,7 @@
* }
* \endcode
*/
-void process_test_result(struct test_suite *ts, const char *test_name, lua_State *L) {
+void process_test_result(struct testsuite *ts, const char *test_name, lua_State *L) {
if (lua_isstring(L, -1)) {
/* this is not a test result, log the error */
ts_log(ts, test_name, "error: %s\n", lua_tostring(L, -1));
@@ -125,7 +125,7 @@
}
}
-int run_test(struct test_suite *ts, const char *test_name, const char *test_dir_path) {
+int run_test(struct testsuite *ts, const char *test_name, const char *test_dir_path) {
char test_file_path[1024];
lua_State *L = luaL_newstate();
if (!L) {
@@ -177,7 +177,7 @@
int process_tests_in_dir(const char *path) {
DIR *main_dir = opendir(path);
char full_path[1024];
- struct test_suite ts;
+ struct testsuite ts;
struct dirent *ent;
if (!main_dir) {
Modified: team/mnicholson/asttest/asttest/include/asttest/testsuite.h
URL: http://svn.digium.com/view/asterisk/team/mnicholson/asttest/asttest/include/asttest/testsuite.h?view=diff&rev=167241&r1=167240&r2=167241
==============================================================================
--- team/mnicholson/asttest/asttest/include/asttest/testsuite.h (original)
+++ team/mnicholson/asttest/asttest/include/asttest/testsuite.h Mon Jan 5 12:02:24 2009
@@ -19,7 +19,7 @@
#ifndef ASTTEST_TESTSUITE_H
#define ASTTEST_TESTSUITE_H
-struct test_suite {
+struct testsuite {
unsigned int pass;
unsigned int fail;
unsigned int xfail;
@@ -28,17 +28,17 @@
FILE *log;
};
-int ts_init(struct test_suite *ts, const char *log_file_path);
-void ts_cleanup(struct test_suite *ts);
+int ts_init(struct testsuite *ts, const char *log_file_path);
+void ts_cleanup(struct testsuite *ts);
-void ts_print(struct test_suite *ts);
+void ts_print(struct testsuite *ts);
-int ts_log_va(struct test_suite *ts, const char *test_name, const char *fmt, va_list ap);
-int __attribute__((format(printf, 3, 4))) ts_log(struct test_suite *ts, const char *test_name, const char *fmt, ...);
+int ts_log_va(struct testsuite *ts, const char *test_name, const char *fmt, va_list ap);
+int __attribute__((format(printf, 3, 4))) ts_log(struct testsuite *ts, const char *test_name, const char *fmt, ...);
-void ts_pass(struct test_suite *ts, const char *test_name);
-void ts_fail(struct test_suite *ts, const char *test_name);
-void ts_xfail(struct test_suite *ts, const char *test_name);
-void ts_skip(struct test_suite *ts, const char *test_name);
+void ts_pass(struct testsuite *ts, const char *test_name);
+void ts_fail(struct testsuite *ts, const char *test_name);
+void ts_xfail(struct testsuite *ts, const char *test_name);
+void ts_skip(struct testsuite *ts, const char *test_name);
#endif
Modified: team/mnicholson/asttest/asttest/lib/testsuite.c
URL: http://svn.digium.com/view/asterisk/team/mnicholson/asttest/asttest/lib/testsuite.c?view=diff&rev=167241&r1=167240&r2=167241
==============================================================================
--- team/mnicholson/asttest/asttest/lib/testsuite.c (original)
+++ team/mnicholson/asttest/asttest/lib/testsuite.c Mon Jan 5 12:02:24 2009
@@ -24,8 +24,8 @@
#include "asttest/testsuite.h"
-int ts_init(struct test_suite *ts, const char *log_file_path) {
- memset(ts, 0, sizeof(struct test_suite));
+int ts_init(struct testsuite *ts, const char *log_file_path) {
+ memset(ts, 0, sizeof(struct testsuite));
ts->log = fopen(log_file_path, "w");
if (!ts->log) {
@@ -36,13 +36,13 @@
return 0;
}
-void ts_cleanup(struct test_suite *ts) {
+void ts_cleanup(struct testsuite *ts) {
if (ts->log) {
fclose(ts->log);
}
}
-void ts_print(struct test_suite *ts) {
+void ts_print(struct testsuite *ts) {
printf("Test results:\n");
printf(" tests passed: %d\n", ts->pass);
printf(" test failures: %d\n", ts->fail);
@@ -52,14 +52,14 @@
printf("Total test run: %d\n", ts->total);
}
-int ts_log_va(struct test_suite *ts, const char *test_name, const char *fmt, va_list ap) {
+int ts_log_va(struct testsuite *ts, const char *test_name, const char *fmt, va_list ap) {
int res;
res = fprintf(ts->log, "%s: ", test_name);
res += vfprintf(ts->log, fmt, ap);
return res;
}
-int __attribute__((format(printf, 3, 4))) ts_log(struct test_suite *ts, const char *test_name, const char *fmt, ...) {
+int __attribute__((format(printf, 3, 4))) ts_log(struct testsuite *ts, const char *test_name, const char *fmt, ...) {
va_list ap;
int res;
va_start(ap, fmt);
@@ -68,28 +68,28 @@
return res;
}
-void ts_pass(struct test_suite *ts, const char *test_name) {
+void ts_pass(struct testsuite *ts, const char *test_name) {
ts->pass++;
ts->total++;
ts_log(ts, test_name, "test passed\n");
}
-void ts_fail(struct test_suite *ts, const char *test_name) {
+void ts_fail(struct testsuite *ts, const char *test_name) {
ts->fail++;
ts->total++;
ts_log(ts, test_name, "test failed\n");
}
-void ts_xfail(struct test_suite *ts, const char *test_name) {
+void ts_xfail(struct testsuite *ts, const char *test_name) {
ts->xfail++;
ts->total++;
ts_log(ts, test_name, "expected failure\n");
}
-void ts_skip(struct test_suite *ts, const char *test_name) {
+void ts_skip(struct testsuite *ts, const char *test_name) {
ts->skip++;
ts->total++;
More information about the svn-commits
mailing list