Multiple test files for testing
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,4 +2,3 @@
|
|||||||
*.d
|
*.d
|
||||||
debugus
|
debugus
|
||||||
test
|
test
|
||||||
.debugusrc1.js
|
|
||||||
|
|||||||
11
Makefile
11
Makefile
@@ -6,17 +6,14 @@ SRCS=debugus.c linenoise.c hash.c pmparser.c
|
|||||||
OBJS=$(patsubst %.c,%.o,$(SRCS))
|
OBJS=$(patsubst %.c,%.o,$(SRCS))
|
||||||
DEPS=$(patsubst %.c,%.d,$(SRCS))
|
DEPS=$(patsubst %.c,%.d,$(SRCS))
|
||||||
|
|
||||||
all: debugus .debugusrc1.js test
|
all: debugus test
|
||||||
|
|
||||||
test: test.o
|
test: test.o test2.o
|
||||||
$(CC) $(CFLAGS) -o $@ $^
|
$(CC) -o $@ $^
|
||||||
|
|
||||||
debugus: $(OBJS) ./mujs/build/debug/libmujs.o ./libelfin_wrap.o
|
debugus: $(OBJS) ./mujs/build/debug/libmujs.o ./libelfin_wrap.o
|
||||||
$(CC) -o $@ $^ $(LDFLAGS)
|
$(CC) -o $@ $^ $(LDFLAGS)
|
||||||
|
|
||||||
.debugusrc1.js: test .debugusrc1.js.txt
|
|
||||||
cat .debugusrc1.js.txt | sed "s/@DUPA_ADDR/0x$$(nm ./test | grep 'dupa' | awk '{ print $$1 }')/g" > .debugusrc1.js
|
|
||||||
|
|
||||||
./mujs/build/debug/libmujs.o:
|
./mujs/build/debug/libmujs.o:
|
||||||
make -C mujs -j$(shell nproc)
|
make -C mujs -j$(shell nproc)
|
||||||
|
|
||||||
@@ -25,7 +22,7 @@ debugus: $(OBJS) ./mujs/build/debug/libmujs.o ./libelfin_wrap.o
|
|||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|
||||||
clean: $(OBJS) test.o $(DEPS) .debugusrc1.js
|
clean: $(OBJS) test.o test2.o $(DEPS)
|
||||||
rm -f $^
|
rm -f $^
|
||||||
make -C mujs clean
|
make -C mujs clean
|
||||||
|
|
||||||
|
|||||||
4
test.c
4
test.c
@@ -2,6 +2,8 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
extern void dupa2(void);
|
||||||
|
|
||||||
void dupa(void) {
|
void dupa(void) {
|
||||||
printf("a\n");
|
printf("a\n");
|
||||||
printf("b\n");
|
printf("b\n");
|
||||||
@@ -19,6 +21,8 @@ int main(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dupa2();
|
||||||
|
|
||||||
int *a = NULL;
|
int *a = NULL;
|
||||||
*a = 6969;
|
*a = 6969;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user