diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-28 20:29:21 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-28 20:31:55 +0200 |
commit | 99ef2719fb3d703fe38c4113cd7f5adec516dd3a (patch) | |
tree | 2c1f77cb41b60ccbf8faa77a3640491a3546b546 /test/testsuite.h | |
parent | 543308f6c46cf2edf8a524bc9c631e472570fe72 (diff) |
test: remove test suite
The test suite is now a developed in a separate git repository.
See here:
http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng-test.git
The test suite should be just like every other software compiled
with the cross-toolchain. In the past strange problems where found
when the test suite got build in the toolchain creation step.
Diffstat (limited to 'test/testsuite.h')
-rw-r--r-- | test/testsuite.h | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/test/testsuite.h b/test/testsuite.h deleted file mode 100644 index 84c78156a..000000000 --- a/test/testsuite.h +++ /dev/null @@ -1,101 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * Some simple macros for use in test applications. - * Copyright (C) 2000-2006 by Erik Andersen <andersen@uclibc.org> - * - * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ - -#ifndef TESTSUITE_H -#define TESTSUITE_H - -#ifdef __NO_TESTCODE__ -extern size_t test_number; -#endif - -extern void init_testsuite(const char* testname); -extern void done_testing(void) __attribute__((noreturn)); -extern void success_msg(int result, const char* command); -extern void error_msg(int result, int line, const char* file, const char* command); - -#ifndef __NO_TESTCODE__ - -size_t test_number = 0; -static int failures = 0; - -void error_msg(int result, int line, const char* file, const char* command) -{ - failures++; - - printf("\nFAILED TEST %lu: \n\t%s\nResult: %d", - (unsigned long)test_number, command, result); - printf("AT LINE: %d, FILE: %s\n\n", line, file); -} - -void success_msg(int result __attribute__((unused)), const char* command __attribute__((unused))) -{ -#if 0 - printf("passed test: %s == 0\n", command); -#endif -} - -void done_testing(void) -{ - if (0 < failures) { - printf("Failed %d tests\n", failures); - exit(EXIT_FAILURE); - } else { - printf("All functions tested sucessfully\n"); - exit(EXIT_SUCCESS); - } -} - -void init_testsuite(const char* testname) -{ - printf("%s", testname); - test_number = 0; - failures = 0; -#if !defined(__UCLIBC__) || defined(__UCLIBC_DYNAMIC_ATEXIT__) - atexit(done_testing); -#endif -} - -#endif /* __NO_TESTCODE__ */ - - -#define TEST_STRING_OUTPUT(command, expected_result) \ - do { \ - int result = strcmp(command, expected_result); \ - test_number++; \ - if (result == expected_result) { \ - success_msg(result, "command"); \ - } else { \ - error_msg(result, __LINE__, __FILE__, command); \ - }; \ - } while (0) - -#define TEST_NUMERIC(command, expected_result) \ - do { \ - int result = (command); \ - test_number++; \ - if (result == expected_result) { \ - success_msg(result, # command); \ - } else { \ - error_msg(result, __LINE__, __FILE__, # command); \ - }; \ - } while (0) - -#define TEST(command) \ - do { \ - int result = (command); \ - test_number++; \ - if (result == 1) { \ - success_msg(result, # command); \ - } else { \ - error_msg(result, __LINE__, __FILE__, # command); \ - }; \ - } while (0) - -#define STR_CMD(cmd) cmd - -#endif /* TESTSUITE_H */ |