danderson@11: // vim: set sts=8 ts=2 sw=2 tw=99 et: danderson@11: // danderson@11: // Copyright (C) 2013, David Anderson and AlliedModders LLC danderson@11: // All rights reserved. danderson@11: // danderson@11: // Redistribution and use in source and binary forms, with or without danderson@11: // modification, are permitted provided that the following conditions are met: danderson@11: // danderson@11: // * Redistributions of source code must retain the above copyright notice, this danderson@11: // list of conditions and the following disclaimer. danderson@11: // * Redistributions in binary form must reproduce the above copyright notice, danderson@11: // this list of conditions and the following disclaimer in the documentation danderson@11: // and/or other materials provided with the distribution. danderson@11: // * Neither the name of AlliedModders LLC nor the names of its contributors danderson@11: // may be used to endorse or promote products derived from this software danderson@11: // without specific prior written permission. danderson@11: // danderson@11: // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" danderson@11: // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE danderson@11: // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE danderson@11: // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE danderson@11: // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR danderson@11: // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF danderson@11: // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS danderson@11: // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN danderson@11: // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) danderson@11: // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE danderson@11: // POSSIBILITY OF SUCH DAMAGE. danderson@11: danderson@11: #include danderson@11: #include danderson@11: #include danderson@12: #include danderson@11: #include "runner.h" danderson@11: danderson@11: using namespace ke; danderson@11: danderson@11: Test *Test::head = NULL; danderson@11: danderson@11: int main(int argc, char **argv) danderson@11: { danderson@11: Test *test = Test::first(); danderson@11: while (test) { danderson@12: if (argc >= 2 && strcmp(argv[1], test->name()) != 0) { danderson@12: test = test->next(); danderson@12: continue; danderson@12: } danderson@11: fprintf(stdout, "Testing %s... \n", test->name()); danderson@11: if (!test->Run()) { danderson@11: fprintf(stdout, "TEST:%s FAIL\n", test->name()); danderson@11: break; danderson@11: } danderson@11: fprintf(stdout, "TEST:%s OK\n", test->name()); danderson@11: test = test->next(); danderson@11: } danderson@11: } danderson@11: danderson@11: #if defined(__GNUC__) danderson@11: extern "C" void __cxa_pure_virtual() danderson@11: { danderson@11: abort(); danderson@11: } danderson@11: danderson@11: void *operator new(size_t amount) danderson@11: { danderson@11: return malloc(amount); danderson@11: } danderson@11: danderson@12: void *operator new[](size_t amount) danderson@12: { danderson@12: return malloc(amount); danderson@12: } danderson@12: danderson@11: void operator delete(void *p) danderson@11: { danderson@11: free(p); danderson@11: } danderson@12: danderson@12: void operator delete[](void *p) danderson@12: { danderson@12: free(p); danderson@12: } danderson@11: #endif