| 1 |
CRIU ?= criu |
| 2 |
CC ?= gcc |
| 3 |
|
| 4 |
all: test clean |
| 5 |
|
| 6 |
test: test-imgs |
| 7 |
@echo "Running BATS tests..." |
| 8 |
bats checkpointctl.bats |
| 9 |
|
| 10 |
test-junit: test-imgs |
| 11 |
@echo "Running BATS tests with JUnit results..." |
| 12 |
bats -F junit checkpointctl.bats > junit.xml |
| 13 |
|
| 14 |
test-imgs: piggie/piggie |
| 15 |
$(eval PID := $(shell export TEST_ENV=BAR TEST_ENV_EMPTY=; piggie/piggie --tcp-socket)) |
| 16 |
mkdir -p $@ |
| 17 |
$(CRIU) dump --tcp-established -v4 -o dump.log -D $@ -t $(PID) || cat $@/dump.log |
| 18 |
|
| 19 |
piggie/piggie: piggie/piggie.c |
| 20 |
$(CC) $^ -o $@ |
| 21 |
|
| 22 |
clean: |
| 23 |
@echo "Cleaning up test files..." |
| 24 |
@rm -rf test-imgs piggie/piggie |
| 25 |
|
| 26 |
.PHONY: all test test-junit clean |