Skip to content

Commit

Permalink
The 'miscellaneous tests' from the 'tests' directory can now be made,…
Browse files Browse the repository at this point in the history
… for at least some platforms, with 'make tests'.
  • Loading branch information
Bill-Gray committed Apr 25, 2024
1 parent 06dd84b commit 200b548
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 11 deletions.
4 changes: 4 additions & 0 deletions common/libobjs.mif
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ TERM_HEADER = $(PDCURSES_SRCDIR)/term.h

srcdir = $(PDCURSES_SRCDIR)/pdcurses
demodir = $(PDCURSES_SRCDIR)/demos
testdir = $(PDCURSES_SRCDIR)/tests

LIBOBJS = addch.$(O) addchstr.$(O) addstr.$(O) attr.$(O) beep.$(O) \
bkgd.$(O) border.$(O) clear.$(O) color.$(O) debug.$(O) delch.$(O) deleteln.$(O) \
Expand All @@ -26,3 +27,6 @@ mbrot$(E) newtest$(E) ozdemo$(E) picsview$(E) ptest$(E) rain$(E) \
speed$(E) test_pan$(E) testcurs$(E) widetest$(E) worm$(E) xmas$(E)

DEMOS = $(DEMOS_EXCEPT_TUIDEMO) tuidemo$(E)

TESTS = brk_test$(E) del_test$(E) focus$(E) ins_del$(E) keytest$(E) \
opaque$(E) restart$(E) ripoff$(E)
13 changes: 11 additions & 2 deletions fb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,25 @@ ifeq ($(shell uname -s),FreeBSD)
LDFLAGS += -L /usr/local/lib -ldrm
endif

.PHONY: all libs clean demos
.PHONY: all libs clean demos tests

all: libs

libs: $(LIBCURSES)

clean:
-$(RM) *.o trace $(LIBCURSES) $(DEMOS)
-$(RM) *.o trace $(LIBCURSES) $(DEMOS) $(TESTS)

demos: libs $(DEMOS)
ifneq ($(DEBUG),Y)
$(STRIP) $(DEMOS)
endif

tests: libs $(TESTS)
ifneq ($(DEBUG),Y)
$(STRIP) $(TESTS)
endif

$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
$(LIBEXE) $(LIBFLAGS) $@ $?
ifeq ($(LIBCURSES),lib$(LIBNAME).a)
Expand All @@ -102,6 +107,7 @@ endif

$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
$(TESTS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
tui.o tuidemo.o : $(PDCURSES_CURSES_H)
terminfo.o : $(TERM_HEADER)
panel.o ptest: $(PANEL_HEADER)
Expand All @@ -115,6 +121,9 @@ $(PDCOBJS) : %.o: $(osdir)/%.c
$(DEMOS_EXCEPT_TUIDEMO): %: $(demodir)/%.c
$(BUILD) $(DEMOFLAGS) -o$@ $< $(LDFLAGS)

$(TESTS): %: $(testdir)/%.c
$(BUILD) $(DEMOFLAGS) -o$@ $< $(LDFLAGS)

tuidemo$(E) : tuidemo.o tui.o
$(LINK) tui.o tuidemo.o -o $@ $(LDFLAGS)

Expand Down
10 changes: 9 additions & 1 deletion ncurses/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@ else
endif

demodir = ../demos
testdir = ../tests

DEMOS = calendar firework init_col mbrot newtest ozdemo picsview ptest \
rain speed testcurs test_pan widetest worm xmas

TESTS = brk_test del_test focus ins_del keytest opaque restart ripoff

all: $(DEMOS) tuidemo

tests: $(TESTS)

$(TESTS) : %: $(testdir)/%.c
$(CC) $(CFLAGS) -o$@ $< $(LIBCURSES)

$(DEMOS) : %: $(demodir)/%.c
$(CC) $(CFLAGS) -o$@ $< $(LIBCURSES)

tuidemo : $(demodir)/tuidemo.c $(demodir)/tui.c
$(CC) $(CFLAGS) -o$@ $(demodir)/tui.c $< $(LIBCURSES)

clean:
rm -f $(DEMOS) tuidemo
rm -f $(DEMOS) tuidemo $(TESTS)
13 changes: 11 additions & 2 deletions sdl1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,25 @@ LINK = $(CC)

DEMOS += sdltest

.PHONY: all libs clean demos
.PHONY: all libs clean demos tests

all: libs

libs: $(LIBCURSES) $(LIBCURSES_SO)

clean:
-$(RM) *.o trace $(LIBCURSES) $(LIBCURSES_SO) $(DEMOS)
-$(RM) *.o trace $(LIBCURSES) $(LIBCURSES_SO) $(DEMOS) $(TESTS)

demos: $(DEMOS)
ifneq ($(DEBUG),Y)
strip $(DEMOS)
endif

tests: $(TESTS)
ifneq ($(DEBUG),Y)
strip $(TESTS)
endif

install:
ifneq ($(OS),Windows_NT)
cp $(LIBCURSES_SO) /usr/local/lib
Expand All @@ -98,6 +103,7 @@ $(LIBCURSES_SO) : $(LIBOBJS) $(PDCOBJS)
$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_SDL_H)
$(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
$(TESTS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
tui.o tuidemo.o : $(PDCURSES_CURSES_H)
terminfo.o : $(TERM_HEADER)
panel.o ptest: $(PANEL_HEADER)
Expand All @@ -108,6 +114,9 @@ $(LIBOBJS) : %.o: $(srcdir)/%.c
$(PDCOBJS) : %.o: $(osdir)/%.c
$(BUILD) $(SFLAGS) -c $<

$(TESTS): %: $(testdir)/%.c
$(BUILD) $(DEMOFLAGS) -o$@ $< $(LDFLAGS)

$(DEMOS_EXCEPT_TUIDEMO): %: $(demodir)/%.c
$(BUILD) $(DEMOFLAGS) -o$@ $< $(LDFLAGS)

Expand Down
13 changes: 11 additions & 2 deletions sdl2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,25 @@ LINK = $(CC)

DEMOS += sdltest$(E)

.PHONY: all libs clean demos
.PHONY: all libs clean demos tests

all: libs

libs: $(LIBCURSES)

clean:
-$(RM) *.o trace $(CLEAN) $(DEMOS)
-$(RM) *.o trace $(CLEAN) $(DEMOS) $(TESTS)

demos: $(DEMOS)
ifneq ($(DEBUG),Y)
$(PREFIX)-strip $(DEMOS)
endif

tests: $(TESTS)
ifneq ($(DEBUG),Y)
$(PREFIX)-strip $(TESTS)
endif

install:
ifneq ($(OS),Windows_NT)
cp lib$(DLLNAME).so /usr/local/lib
Expand All @@ -162,6 +167,7 @@ pdcurses.o: $(common)/pdcurses.rc
$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_SDL_H)
$(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
$(TESTS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
tui.o tuidemo.o : $(PDCURSES_CURSES_H)
terminfo.o : $(TERM_HEADER)
panel.o ptest$(E) test_pan$(E): $(PANEL_HEADER)
Expand All @@ -172,6 +178,9 @@ $(LIBOBJS) : %.o: $(srcdir)/%.c
$(PDCOBJS) : %.o: $(osdir)/%.c
$(BUILD) $(SFLAGS) -c $<

$(TESTS): %: $(testdir)/%.c
$(BUILD) $(DEMOFLAGS) -o$@ $< $(LDFLAGS)

$(DEMOS_EXCEPT_TUIDEMO): %: $(demodir)/%.c
$(BUILD) $(DEMOFLAGS) -o$@ $< $(LDFLAGS)

Expand Down
13 changes: 11 additions & 2 deletions vt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,25 @@ LINK = $(CC)
LDFLAGS = $(LIBCURSES)
RANLIB = $(PREFIX)ranlib

.PHONY: all libs clean demos
.PHONY: all libs clean demos tests

all: libs

libs: $(LIBCURSES)

clean:
-$(RM) *.o trace $(LIBCURSES) $(DEMOS)
-$(RM) *.o trace $(LIBCURSES) $(DEMOS) $(TESTS)

demos: libs $(DEMOS)
ifneq ($(DEBUG),Y)
$(STRIP) $(DEMOS)
endif

tests: libs $(TESTS)
ifneq ($(DEBUG),Y)
$(STRIP) $(TESTS)
endif

$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
$(LIBEXE) $(LIBFLAGS) $@ $?
ifeq ($(LIBCURSES),$(LIBNAME).a)
Expand All @@ -128,6 +133,7 @@ endif

$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
$(TESTS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
tui.o tuidemo.o : $(PDCURSES_CURSES_H)
terminfo.o : $(TERM_HEADER)
panel.o ptest: $(PANEL_HEADER)
Expand All @@ -141,6 +147,9 @@ $(PDCOBJS) : %.o: $(osdir)/%.c
$(DEMOS_EXCEPT_TUIDEMO): %: $(demodir)/%.c
$(BUILD) $(DEMOFLAGS) -o$@ $< $(LDFLAGS)

$(TESTS): %: $(testdir)/%.c
$(BUILD) $(DEMOFLAGS) -o$@ $< $(LDFLAGS)

tuidemo$(E) : tuidemo.o tui.o
$(LINK) tui.o tuidemo.o -o $@ $(LDFLAGS)

Expand Down
10 changes: 9 additions & 1 deletion wincon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ endif
CLEAN = *.a
endif

.PHONY: all libs clean demos dist
.PHONY: all libs clean demos dist tests

all: libs

Expand All @@ -143,6 +143,11 @@ ifneq ($(DEBUG),Y)
$(STRIP) *.exe
endif

tests: libs $(TESTS)
ifneq ($(DEBUG),Y)
$(STRIP) $(TESTS)
endif

$(LIBCURSES) : $(LIBDEPS)
$(LIBEXE) $(LIBFLAGS) $@ $? $(LIBSADDED)
$(CP) $(LIBNAME).a panel.a
Expand All @@ -161,6 +166,9 @@ $(PDCOBJS) : %.o: $(osdir)/%.c
$(DEMOS_EXCEPT_TUIDEMO): %.exe: $(demodir)/%.c
$(CC) $(CFLAGS) -o$@ $< $(LIBCURSES) $(EXELIBS)

$(TESTS): %.exe: $(testdir)/%.c
$(CC) $(CFLAGS) -mwindows -o$@ $< $(LIBCURSES) $(EXELIBS)

tuidemo.exe: tuidemo.o tui.o
$(LINK) $(LDFLAGS) -o$@ tuidemo.o tui.o $(LIBCURSES) $(EXELIBS)

Expand Down
10 changes: 9 additions & 1 deletion wingui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ endif
CLEAN = *.a
endif

.PHONY: all libs clean demos dist
.PHONY: all libs clean demos dist tests

all: libs

Expand All @@ -139,6 +139,11 @@ ifneq ($(DEBUG),Y)
$(STRIP) *.exe
endif

tests: libs $(TESTS)
ifneq ($(DEBUG),Y)
$(STRIP) $(TESTS)
endif

$(LIBCURSES) : $(LIBDEPS)
$(LIBEXE) $(LIBFLAGS) $@ $? $(LIBSADDED)
$(CP) $(LIBNAME).a panel.a
Expand All @@ -157,6 +162,9 @@ $(PDCOBJS) : %.o: $(osdir)/%.c
$(DEMOS_EXCEPT_TUIDEMO): %.exe: $(demodir)/%.c
$(CC) $(CFLAGS) -mwindows -o$@ $< $(LIBCURSES) $(EXELIBS)

$(TESTS): %.exe: $(testdir)/%.c
$(CC) $(CFLAGS) -mwindows -o$@ $< $(LIBCURSES) $(EXELIBS)

tuidemo.exe: tuidemo.o tui.o
$(LINK) $(LDFLAGS) -mwindows -o$@ tuidemo.o tui.o $(LIBCURSES) $(EXELIBS)

Expand Down

0 comments on commit 200b548

Please sign in to comment.