Commit 9ad56f6c authored by Sergej Chodarev's avatar Sergej Chodarev
Browse files

Add infrastructure for running tests with two empty test suits

parent 26668b2c
.*
*.o
notwork
tests/all_tests
CC = gcc
CFLAGS = -std=gnu11 -Wall -pedantic
LDFLAGS =
LDFLAGS =
TARGET = notwork
MODULES = wall.o post.o
TEST_TARGET = tests/all_tests
TEST_MODULES = tests/test_post.o tests/test_wall.o
# Main tasks
.PHONY: all clean
.PHONY: all test clean
all: $(TARGET)
all: $(TARGET) $(TEST_TARGET)
test: $(TEST_TARGET)
$<
clean:
rm *.o $(TARGET)
rm *.o tests/*.o $(TARGET) $(TEST_TARGET)
# Dependencies
$(TARGET): notwork.o $(MODULES)
......@@ -19,6 +24,10 @@ notwork.o: notwork.c wall.h post.h
wall.o: wall.c wall.h post.h
post.o: post.c post.h
$(TEST_TARGET): tests/all_tests.o $(TEST_MODULES) $(MODULES)
tests/test_post.o: tests/test_post.c post.h
tests/test_wall.o: tests/test_wall.c wall.h
# Machinery
%.o: %.c
$(CC) -c -o $@ $(CFLAGS) $<
......
#include "greatest.h"
extern SUITE(test_post);
extern SUITE(test_wall);
GREATEST_MAIN_DEFS();
int main(int argc, char **argv) {
GREATEST_MAIN_BEGIN();
RUN_SUITE(test_post);
RUN_SUITE(test_wall);
GREATEST_MAIN_END();
}
This diff is collapsed.
#include <stdio.h>
#include <stdlib.h>
#include "greatest.h"
#include "../post.h"
SUITE(test_post) {
}
#include <stdio.h>
#include <stdlib.h>
#include "greatest.h"
#include "../wall.h"
SUITE(test_wall) {
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment