Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Fixed issues with actions
Browse files Browse the repository at this point in the history
  • Loading branch information
inesiscosta committed Oct 4, 2024
1 parent 798e706 commit e48dc85
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# .github/workflows/tests.yml

name: Tests

on: [push, pull_request]
Expand All @@ -16,6 +18,11 @@ jobs:
sudo apt-get install -y make valgrind python3-pip
pip3 install lizard
- name: Build project
run: |
cd tests
make build
- name: Run tests
run: |
cd tests
Expand Down
31 changes: 18 additions & 13 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (C) 2021, Pedro Reis dos Santos
# tests/Makefile

# Existing content
.SUFFIXES: .in .out .diff
MAKEFLAGS += --no-print-directory # No entering and leaving messages
SHELL := /bin/bash # Execute command with bash
Expand All @@ -7,30 +9,33 @@ KO="\e[1;31mtest $< FAILED\e[0m"
EXE=../project
LOG=tests.log

all:: clean # run regression tests
@rm -f $(LOG)
@for i in `ls test*.in | sed -e "s/in/diff/"`; do $(MAKE) $(MFLAGS) $$i; done
@echo "`wc -l < $(LOG)` tests passed"
all:: build clean # run regression tests
@rm -f $(LOG)
@for i in `ls test*.in | sed -e "s/in/diff/"`; do $(MAKE) $(MFLAGS) $$i; done
@echo "`wc -l < $(LOG)` tests passed"

build:
gcc -o $(EXE) ../*.c

.in.diff:
@-$(EXE) < $< | diff - $*.out > $@
@-$(EXE) < $< | diff - $*.out > $@
# @-(ulimit -d 780 -t 1 && $(EXE) < $<) | diff - $*.out > $@
@if [ `wc -l < $@` -eq 0 ]; then echo -e $(OK); echo $* >> $(LOG); else echo -e $(KO); fi;
@if [ `wc -l < $@` -eq 0 ]; then echo -e $(OK); echo $* >> $(LOG); else echo -e $(KO); fi;

.in.out:
$(EXE) < $< > $@
$(EXE) < $< > $@

out::
@for i in `ls test*.in | sed -e "s/in/out/"`; do $(MAKE) $(MFLAGS) $$i; done
@for i in `ls test*.in | sed -e "s/in/out/"`; do $(MAKE) $(MFLAGS) $$i; done

clean::
@rm -f *.diff $(LOG)
@rm -f *.diff $(LOG)

cleanall:: clean
@rm -f *.out *.in
@rm -f *.out *.in

valgrind-report:
valgrind --leak-check=full $(EXE) < test01.in > valgrind-report.txt 2>&1
valgrind --leak-check=full $(EXE) < test01.in > valgrind-report.txt 2>&1

lizard-report:
lizard ../ > lizard-report.txt
lizard ../ > lizard-report.txt

0 comments on commit e48dc85

Please sign in to comment.