Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Ulmer committed Nov 18, 2024
1 parent 63269ba commit e683d2f
Show file tree
Hide file tree
Showing 41 changed files with 58 additions and 71 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
tests/io_tests/*/*.IS
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(cmake_test_template)
INCLUDE(CTest)

Expand Down
2 changes: 1 addition & 1 deletion buildscripts/criterion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ rm -f ./${criterion_target}

cmake --build . --target $(basename ${criterion_target})

./${criterion_target} || exit 2
timeout 10 ./${criterion_target} || exit 2
10 changes: 5 additions & 5 deletions buildscripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ shift
}


${CMD} < ${IN_FILE} > ${OUT_FILE}.IS 2> ${ERR_FILE}.IS
timeout 10 ${CMD} < ${IN_FILE} > ${OUT_FILE}.IS 2> ${ERR_FILE}.IS

diff ${OUT_FILE} ${OUT_FILE}.IS > /dev/null
out_result=$?

echo "STDOUT DIFF lines marked with - are missing one with + are excessive"
diff -u ${OUT_FILE} ${OUT_FILE}.IS | tail +4 | sed s/^/">>>"/ | sed s/$/'\\n'/
echo "Last 10 lines of STDOUT DIFF lines marked with - are missing one with + are excessive"
diff -u ${OUT_FILE} ${OUT_FILE}.IS | tail +4 | tail -n 10 | sed s/^/">>>"/ | sed s/$/'\\n'/

rm -f ${OUT_FILE}.IS

diff ${ERR_FILE} ${ERR_FILE}.IS > /dev/null
err_result=$?

echo "STDERR DIFF lines marked with - are missing one with + are excessive"
diff -u ${ERR_FILE} ${ERR_FILE}.IS | tail +4 | sed s/^/">>>"/ | sed s/$/'\\n'/
echo "Last 10 lines of STDERR DIFF lines marked with - are missing one with + are excessive"
diff -u ${ERR_FILE} ${ERR_FILE}.IS | tail +4 | tail -n 10 | sed s/^/">>>"/ | sed s/$/'\\n'/

rm -f ${ERR_FILE}.IS

Expand Down
1 change: 1 addition & 0 deletions compile_commands.json
8 changes: 0 additions & 8 deletions src/libraries/Echo/echo.cpp

This file was deleted.

7 changes: 0 additions & 7 deletions src/libraries/Echo/include/echo.h

This file was deleted.

File renamed without changes.
8 changes: 8 additions & 0 deletions src/libraries/test_c_lib/test_c_lib.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "include/test_c_lib.h"

#include <stdio.h>

void say_hello() {
printf("Say ");
printf("hello!\n");
}
1 change: 1 addition & 0 deletions src/programs/c_endless_loop/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
m
10 changes: 10 additions & 0 deletions src/programs/c_endless_loop/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <stdio.h>

int main(int argc, char ** argv) {
unsigned long ticker=0;
while(1) {
if(++ticker%80==0) {
printf("%d\n",ticker/100);
}
}
}
1 change: 1 addition & 0 deletions src/programs/c_program_00/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
m
6 changes: 6 additions & 0 deletions src/programs/c_program_00/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

int main(int argc, char **argv) {
printf("This program was called with %d arguments.\n", argc);
printf("Hello World!\n");
}
2 changes: 2 additions & 0 deletions src/programs/c_program_01/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test_c_lib

9 changes: 9 additions & 0 deletions src/programs/c_program_01/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <stdio.h>

#include <test_c_lib.h>

int main(int argc, char **argv) {
printf("Trying to confirm.\n");
say_hello();
return 0;
}
3 changes: 0 additions & 3 deletions src/programs/hello_c/main.c

This file was deleted.

2 changes: 0 additions & 2 deletions src/programs/hello_world/deps.txt

This file was deleted.

8 changes: 0 additions & 8 deletions src/programs/hello_world/hello.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions src/programs/hello_world/main.cpp

This file was deleted.

6 changes: 0 additions & 6 deletions src/programs/say_hello/main.cpp

This file was deleted.

1 change: 0 additions & 1 deletion tests/criterion/criterion_echo/deps.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Echo
m
19 changes: 3 additions & 16 deletions tests/criterion/criterion_echo/test00.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
#include <criterion/criterion.h>
#include <echo.h>
#include <cmath>
#include <criterion/criterion.h>

Test(misc, echo) {
echo("Test");
}

Test(misc, echo2) {
echo2();
}

Test(misc, passing) {
cr_assert(1);
}
Test(misc, passing) { cr_assert(1); }

Test(misc, pi) {
cr_assert(fabs(M_PI -3.141) < 0.01);
}
Test(misc, pi) { cr_assert(fabs(M_PI - 3.141) < 0.01); }
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tests/io_tests/c_endless_loop/00.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Willfailisfortestingendlessloop.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/io_tests/c_program_00/00.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This program was called with 1 arguments.
Hello World!
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/io_tests/c_program_00/01.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This program was called with 1 arguments.
Hello World!
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/io_tests/c_program_00/02.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This program was called with 1 arguments.
Hello World!
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions tests/io_tests/c_program_01/00.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Trying to confirm.
Say hello!
1 change: 0 additions & 1 deletion tests/io_tests/hello_world/00.out

This file was deleted.

1 change: 0 additions & 1 deletion tests/io_tests/hello_world/01.out

This file was deleted.

1 change: 0 additions & 1 deletion tests/io_tests/hello_world/02.out

This file was deleted.

1 change: 0 additions & 1 deletion tests/io_tests/say_hello/00.err

This file was deleted.

0 comments on commit e683d2f

Please sign in to comment.