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 61c6e57 commit 26fb7b4
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 3 deletions.
8 changes: 7 additions & 1 deletion buildscripts/criterion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ rm -f ./${criterion_target}

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

timeout 10 ./${criterion_target} || exit 2
out_file="./$(dirname ${criterion_target})/Testing/$(basename ${criterion_target}).out"

timeout 10 ./${criterion_target} > ${out_file} 2>&1 || {
tail -n 10 ${out_file}
rm -f ${out_file}
exit 2
}
1 change: 1 addition & 0 deletions src/libraries/test_cpp_lib/include/test_cpp_lib.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void sayyeah();
9 changes: 9 additions & 0 deletions src/libraries/test_cpp_lib/test_cpp_lib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "include/test_cpp_lib.hpp"

#include <iostream>

using std::cout, std::endl;

void sayyeah() {
cout << "Yeah!" << endl;
}
2 changes: 1 addition & 1 deletion src/programs/c_endless_loop/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ int main(int argc, char ** argv) {
unsigned long ticker=0;
while(1) {
if(++ticker%80==0) {
printf("%d\n",ticker/100);
printf("%lu\n",ticker/100);
}
}
}
1 change: 1 addition & 0 deletions src/programs/cpp_program_00/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_cpp_lib
5 changes: 5 additions & 0 deletions src/programs/cpp_program_00/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <test_cpp_lib.hpp>

int main(int argc, char ** argv) {
sayyeah();
}
1 change: 1 addition & 0 deletions tests/criterion/criterion_cpp/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_cpp_lib
9 changes: 9 additions & 0 deletions tests/criterion/criterion_cpp/test00.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <cmath>
#include <criterion/criterion.h>

#include <test_cpp_lib.hpp>

Test(cpp, sayyeah) {
sayyeah();
cr_assert(1);
}
1 change: 1 addition & 0 deletions tests/criterion/criterion_echo/deps.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test_c_lib
m
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#include <cmath>
#include <math.h>
#include <criterion/criterion.h>
#include <test_c_lib.h>

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

Test(misc, pi) { cr_assert(fabs(M_PI - 3.141) < 0.01); }

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

0 comments on commit 26fb7b4

Please sign in to comment.