From 395cb44c010beb0b72f9c81e334813c1c0d0e973 Mon Sep 17 00:00:00 2001
From: ajmorton <ajmorton2@gmail.com>
Date: Mon, 16 Sep 2019 20:36:01 +1000
Subject: [PATCH] Changes to work with swen_tourney
---
.gitlab-ci.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++
Makefile | 4 ++--
run_tests.sh | 14 ++++++++++++++
3 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 .gitlab-ci.yml
create mode 100755 run_tests.sh
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..6691648
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,45 @@
+stages:
+ - check_elig
+ - validate_tests
+ - validate_progs
+ - submit
+
+check_submitter_eligibility:
+ stage: check_elig
+ only:
+ - master
+ tags:
+ - "swen90006-tourney"
+ script:
+ - python3 ~/swen_tourney/frontend.py check_eligibility $(realpath $(pwd))
+ allow_failure: false
+
+validate_tests:
+ stage: validate_tests
+ only:
+ - master
+ tags:
+ - "swen90006-tourney"
+ script:
+ - python3 ~/swen_tourney/frontend.py validate_tests $(realpath $(pwd))
+ allow_failure: false
+
+validate_progs:
+ stage: validate_progs
+ only:
+ - master
+ tags:
+ - "swen90006-tourney"
+ script:
+ - python3 ~/swen_tourney/frontend.py validate_progs $(realpath $(pwd))
+ allow_failure: false
+
+submit:
+ stage: submit
+ only:
+ - master
+ tags:
+ - "swen90006-tourney"
+ script:
+ - python3 ~/swen_tourney/frontend.py submit $(realpath $(pwd))
+ allow_failure: false
diff --git a/Makefile b/Makefile
index 37e475b..b251200 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ SRC=src
BIN=bin
INCLUDE=$(SRC)/include
-VERSIONS=original vuln-1 vuln-2 vuln-3 vuln-4 vuln-5
+VERSIONS ?= original vuln-1 vuln-2 vuln-3 vuln-4 vuln-5
VBINARIES=$(VERSIONS:%=%/$(BINARY))
BIN_TARGETS=$(VBINARIES:%=%-san) $(VBINARIES:%=%-fuzz) $(VBINARIES:%=%-cov)
@@ -54,5 +54,5 @@ $(BIN)/%-cov: $(SRC)/%.c $(HEADERS)
$(CLANG) $< $(CFLAGS) $(LDFLAGS) $(COV_FLAGS) $(NO_STRICT_OVERFLOW_CFLAGS) -o $@
clean:
- rm -f $(TARGETS) *.profraw *.profdata
+ rm -rf bin/* *.profraw *.profdata
diff --git a/run_tests.sh b/run_tests.sh
new file mode 100755
index 0000000..444ff7b
--- /dev/null
+++ b/run_tests.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+PROGRAM=$1
+USE_POC=$2
+
+if [ "$USE_POC" = "--use-poc" ]; then
+ # test program with its proof of concept test
+ ./bin/${PROGRAM}/passbook-san ./poc/${PROGRAM}.poc
+ exit $?
+else
+ # fuzz program with all tests in the tests/ folder
+ ./bin/${PROGRAM}/passbook-san ./tests/*
+ exit $?
+fi
--
GitLab