Make a host version of acc for testing.
Don't run the code we've compiled unless the -R option is present.
diff --git a/libacc/tests/main.cpp b/libacc/tests/main.cpp
index acee09d..d624cbb 100644
--- a/libacc/tests/main.cpp
+++ b/libacc/tests/main.cpp
@@ -32,6 +32,7 @@
int main(int argc, char** argv) {
const char* inFile = NULL;
bool printListing;
+ bool runResults = false;
FILE* in = stdin;
int i;
for (i = 1; i < argc; i++) {
@@ -41,6 +42,9 @@
case 'S':
printListing = true;
break;
+ case 'R':
+ runResults = true;
+ break;
default:
fprintf(stderr, "Unrecognized flag %s\n", arg);
return 3;
@@ -108,7 +112,7 @@
accGetScriptLabel(script, "main", (ACCvoid**) & mainPointer);
result = accGetError(script);
- if (result == ACC_NO_ERROR) {
+ if (result == ACC_NO_ERROR && runResults) {
fprintf(stderr, "Executing compiled code:\n");
int codeArgc = argc - i + 1;
char** codeArgv = argv + i - 1;