Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove outdated TODO comment and fix fibonacci test #2

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ define TEST_template =
@if [ -e $$(@D).log ]; then \
cmp $$(TESTTMPDIR)/$(testname).log $$(@D).log || ( \
echo "Failed test $$(@D)"; \
echo "Was expecting on STDOUT:"; \
cat $$(@D).log; \
echo "Observed on STDOUT:"; \
cat $$(TESTTMPDIR)/$(testname).log; \
diff -u $$(@D).log $$(TESTTMPDIR)/$(testname).log; \
exit 1; \
); \
elif [ -s $$(TESTTMPDIR)/$(testname).log ]; then \
Expand All @@ -104,10 +101,7 @@ define TEST_template =
@if [ -e $$(@D).out ]; then \
cmp $$(TESTTMPDIR)/$(testname).out $$(@D).out || ( \
echo "Failed test $$(@D)"; \
echo "Was expecting on STDOUT:"; \
cat $$(@D).out; \
echo "Observed on STDOUT:"; \
cat $$(TESTTMPDIR)/$(testname).out; \
diff -u $$(@D).out $$(TESTTMPDIR)/$(testname).out; \
exit 1; \
); \
elif [ -s $$(TESTTMPDIR)/$(testname).out ]; then \
Expand All @@ -121,10 +115,7 @@ define TEST_template =
@if [ -e $$(@D).err ]; then \
cmp $$(TESTTMPDIR)/$(testname).err $$(@D).err || ( \
echo "Failed test $$(@D)"; \
echo "Was expecting on STDERR:"; \
cat $$(@D).err; \
echo "Observed on STDERR:"; \
cat $$(TESTTMPDIR)/$(testname).err; \
diff -u $$(@D).err $$(TESTTMPDIR)/$(testname).err; \
exit 1; \
); \
elif [ -s $$(TESTTMPDIR)/$(testname).err ]; then \
Expand Down
3 changes: 0 additions & 3 deletions t3.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ struct message *stderr_head = NULL;
struct message *stderr_tail = NULL;
int stderr_queuelen = 0;

// Mutex for thread-safe access to the queues
// TODO: remove because we are not using threads

static void usage(const int rc) {
printf("Usage: t3 [OPTION] FILE -- COMMAND ARGS ...\n");
printf("Invoke provided command and write its colorized, "
Expand Down
2 changes: 1 addition & 1 deletion tests/fibonacci.args
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-- sh -c 'n=100; x=0; y=1; z=$x; function out() { if [ `expr $1 % 2` -eq 0 ]; then echo "$1: evens to stdout"; else echo "$1: odds to stderr" 1>&2; fi }; for i in `seq 1 $n`; do x=`expr $x + $y`; y=$z; z=$x; out $x; done'
-- bash -c 'n=100; x=0; y=1; z=$x; function out() { if [ `expr $1 % 2` -eq 0 ]; then echo "$1: evens to stdout"; else echo "$1: odds to stderr" 1>&2; fi }; for i in `seq 1 $n`; do x=`expr $x + $y`; y=$z; z=$x; out $x; done'