tests: link them dynamically by default

. so that functionality is tested
	. add test63 that actually tests dlopen(), dlsym(),
	  etc. functionality; only built if clang supports it
	. also test10 test to copy more of the executable
This commit is contained in:
Ben Gras
2012-04-08 19:22:02 +02:00
parent 4b999f1962
commit 0c8e5ecc2e
6 changed files with 117 additions and 7 deletions

27
test/mod.c Normal file
View File

@@ -0,0 +1,27 @@
/* Code for module to be loaded by test63. */
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
#include "magic.h"
long cookie = 0;
void exithandler(void);
long modfunction(long v1, long *argcookie, long v2) {
if(v1 != MAGIC4 || v2 != MAGIC5) {
fprintf(stderr, "wrong args to modfunction\n");
exit(1);
}
*argcookie = MAGIC3;
cookie = MAGIC2;
atexit(exithandler);
return MAGIC1;
}
void exithandler(void) {
/* OK */
}