aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicksphere.ch>2022-01-18 00:00:00 +0000
committerNicholas Johnson <nick@nicksphere.ch>2022-01-18 00:00:00 +0000
commit3092904fe497618de2b7e71061bd109944d16ce1ba180ce4383922795cd88c0b (patch)
tree3b917133ae61b97d6bcbc84fdabe582c6e9090c44516130a49c9304613e630a0
parent40647bd2cce5ce9ca976260c12907ec166ca12904172602cc973055cf8e367b1 (diff)
Add beginnings of a test suite
-rw-r--r--.gitignore3
-rw-r--r--Makefile8
-rw-r--r--tests/test.c26
3 files changed, 34 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index a9eef2c..38c7079 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
gemini2html
-main \ No newline at end of file
+main
+test \ No newline at end of file
diff --git a/Makefile b/Makefile
index da782b6..ba7ba0e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@ CC = gcc
CFLAGS = -W
RM = rm -f
SRCDIR = src
+TESTDIR = tests
PREFIXUSER?=$(HOME)/.local
PREFIXSYS?=/usr/local
@@ -12,7 +13,7 @@ MANDIRSYS?=$(PREFIXSYS)/share/man
default: all
-all: gemini2html main
+all: gemini2html main test
gemini2html: $(SRCDIR)/gemini2html.c
$(CC) -c $(CFLAGS) -o gemini2html $(SRCDIR)/gemini2html.c
@@ -20,6 +21,9 @@ gemini2html: $(SRCDIR)/gemini2html.c
main: $(SRCDIR)/gemini2html.c $(SRCDIR)/main.c
$(CC) $(CFLAGS) -o main $(SRCDIR)/gemini2html.c $(SRCDIR)/main.c
+test: $(TESTDIR)/test.c $(SRCDIR)/gemini2html.c
+ $(CC) $(CFLAGS) -o test $(TESTDIR)/test.c $(SRCDIR)/gemini2html.c
+
install_user: all
mkdir -m755 -p $(MANDIRUSER)/man1
install -m755 main $(BINDIRUSER)/gemini2html
@@ -41,6 +45,6 @@ uninstall_sys:
uninstall: uninstall_user uninstall_sys
clean:
- $(RM) gemini2html main
+ $(RM) gemini2html main test
.PHONY: default all install_user install_sys uninstall_user uninstall_sys uninstall clean \ No newline at end of file
diff --git a/tests/test.c b/tests/test.c
new file mode 100644
index 0000000..c5f7639
--- /dev/null
+++ b/tests/test.c
@@ -0,0 +1,26 @@
+/*
+ gemini2html Converts Gemini to HTML
+ Copyright (C) 2022 Nicholas Johnson
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+#include <stdio.h>
+
+#include "../src/gemini2html.h"
+
+int main(int argc, char* argv[]) {
+ // stub
+ return 0;
+} \ No newline at end of file