int CXXTest::doTests() { LOG_INFO("Running CXX tests"); if (testInit() != TEST_PASS) { FAIL("C++ init test failed"); } if (testCreate() != TEST_PASS) { FAIL("pthread_create test failed"); } if (testSelf() != TEST_PASS) { FAIL("pthread_self test failed"); } if (testExit() != TEST_PASS) { FAIL("pthread_exit test failed"); } return TEST_PASS; }
int main(int argc, String *argv) { if (argc == 1) { osInit(); sxiInit(); sxiReadEvalPrintLoop(osStdin, osStdout, SXRW_Default); } else { osInit(); dbInit(); while (--argc) testSelf(*++argv); dbFini(); } return EXIT_SUCCESS; }
local int cmdDoOptDeveloper(String arg) { int rc = 0; if (!arg[0]) rc = -1; if (strAEqual("trap", arg)) { cmdTrapFlag = true; } else if (strAEqual("check", arg)) { _dont_assert = false; /* Test assertions. */ stoCtl(StoCtl_Wash, true); /* Initialize of store. */ } else if (strAEqual("no-fatal", arg)) _fatal_assert = false; /* Make assertions non-fatal. */ else if (strAEqual("runtime", arg)) genSetRuntime(); else if (strEqual("debug", arg)) genSetDebugWanted(true); else if (strEqual("debugger", arg)) genSetDebuggerWanted(true); else if (strEqual("depend", arg)) emitSetDependsWanted(true); else if (strEqual("small-hcodes", arg)) genSetSmallHashCodes(true); else if (strEqual("lazy-catch", arg)) gfSetLazyCatch(true); else if (strEqual("dumb-import", arg)) stabSetDumbImport(true); else if (strEqual("trace-cfuns", arg)) gencSetTraceFuns(true); else if (strEqual("no-where", arg)) NoWhereHack = true; else if (strAEqual("runtime-hashcheck", arg)) genSetHashcheck(); else if (strAIsPrefix("keyword", arg)) { String darg = cmdDGetOptArg(arg, "keyword", NULL); cmdDoKeywordStatus(darg, true); } else if (strAIsPrefix("no-keyword", arg)) { String darg = cmdDGetOptArg(arg, "no-keyword", NULL); cmdDoKeywordStatus(darg, false); } else if (strEqual("no-negated-tests", arg)) jflowSetNegate(false); else if (strAEqual("audit", arg)) foamAuditSetAll(); else if (strAEqual("nhash", arg)) genSetAxiomAx(true); else if (strAEqual("missing-ok", arg)) tiSetSoftMissing(true); else if (strAEqual("sexpr", arg)) { cmdSExprFlag = true; } else if (strAEqual("seval", arg)) { cmdSEvalFlag = true; } else if (strAEqual("no-gc", arg)) { /* Handled already - no action need be taken here */ } else if (strAEqual("gc", arg)) { /* Handled already - no action need be taken here */ cmdGcFlag = true; } else if (strAEqual("gcfile", arg)) { /* Handled already - no action need be taken here */ cmdGcFileFlag = true; } else if (strAEqual("loops", arg)) { optSetLoopOption(); } else if (strAEqual("emerge-noalias", arg)) { emSetNoAlias(); } else if (strAIsPrefix("test", arg)) { String darg = cmdDGetOptArg(arg, "test", NULL); testSelf(darg); exitSuccess(); } else if (strAIsPrefix("rtcache", arg)) { String darg = cmdDGetOptArg(arg, "rtcache", NULL); long rtsize; extern void gen0SetRtCacheSize(AInt); sscanf(darg, "%ld", &rtsize); gen0SetRtCacheSize((AInt)rtsize); } else if (strAIsPrefix("D", arg)) { char sep; String darg = cmdDGetOptArg(arg, "D", &sep); rc = cmdDDebug(darg, sep == '+'); } else if (strAIsPrefix("T", arg)) { rc = phTraceOption(arg+strlen("T")); } else if (strAIsPrefix("name", arg)) { String darg = cmdDGetOptArg(arg, "name", NULL); emitSetFileIdName(darg); } else if (strAIsPrefix("prefix", arg)) { String darg = cmdDGetOptArg(arg, "prefix", NULL); emitSetFileIdPrefix(darg); } else if (strAEqual("floatrep", arg)) { cmdFloatRepFlag = true; } else rc = -1; return rc; }