diff --git a/buildscripts/criterion.sh b/buildscripts/criterion.sh index a27c9e3..a3bfc18 100755 --- a/buildscripts/criterion.sh +++ b/buildscripts/criterion.sh @@ -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 +} diff --git a/src/libraries/test_cpp_lib/include/test_cpp_lib.hpp b/src/libraries/test_cpp_lib/include/test_cpp_lib.hpp new file mode 100644 index 0000000..2415fd2 --- /dev/null +++ b/src/libraries/test_cpp_lib/include/test_cpp_lib.hpp @@ -0,0 +1 @@ +void sayyeah(); \ No newline at end of file diff --git a/src/libraries/test_cpp_lib/test_cpp_lib.cpp b/src/libraries/test_cpp_lib/test_cpp_lib.cpp new file mode 100644 index 0000000..20095f8 --- /dev/null +++ b/src/libraries/test_cpp_lib/test_cpp_lib.cpp @@ -0,0 +1,9 @@ +#include "include/test_cpp_lib.hpp" + +#include + +using std::cout, std::endl; + +void sayyeah() { + cout << "Yeah!" << endl; +} \ No newline at end of file diff --git a/src/programs/c_endless_loop/main.c b/src/programs/c_endless_loop/main.c index dd6ea8a..7730710 100644 --- a/src/programs/c_endless_loop/main.c +++ b/src/programs/c_endless_loop/main.c @@ -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); } } } \ No newline at end of file diff --git a/src/programs/cpp_program_00/deps.txt b/src/programs/cpp_program_00/deps.txt new file mode 100644 index 0000000..c2c3b7b --- /dev/null +++ b/src/programs/cpp_program_00/deps.txt @@ -0,0 +1 @@ +test_cpp_lib diff --git a/src/programs/cpp_program_00/main.cpp b/src/programs/cpp_program_00/main.cpp new file mode 100644 index 0000000..8b1c8d5 --- /dev/null +++ b/src/programs/cpp_program_00/main.cpp @@ -0,0 +1,5 @@ +#include + +int main(int argc, char ** argv) { + sayyeah(); +} \ No newline at end of file diff --git a/tests/criterion/criterion_cpp/deps.txt b/tests/criterion/criterion_cpp/deps.txt new file mode 100644 index 0000000..c2c3b7b --- /dev/null +++ b/tests/criterion/criterion_cpp/deps.txt @@ -0,0 +1 @@ +test_cpp_lib diff --git a/tests/criterion/criterion_cpp/test00.cpp b/tests/criterion/criterion_cpp/test00.cpp new file mode 100644 index 0000000..d7e37c0 --- /dev/null +++ b/tests/criterion/criterion_cpp/test00.cpp @@ -0,0 +1,9 @@ +#include +#include + +#include + +Test(cpp, sayyeah) { + sayyeah(); + cr_assert(1); +} diff --git a/tests/criterion/criterion_echo/deps.txt b/tests/criterion/criterion_echo/deps.txt index 28ce6a8..c2b5120 100644 --- a/tests/criterion/criterion_echo/deps.txt +++ b/tests/criterion/criterion_echo/deps.txt @@ -1 +1,2 @@ +test_c_lib m diff --git a/tests/criterion/criterion_echo/test00.cpp b/tests/criterion/criterion_echo/test00.c similarity index 55% rename from tests/criterion/criterion_echo/test00.cpp rename to tests/criterion/criterion_echo/test00.c index 2c0dfb7..b11e3a9 100644 --- a/tests/criterion/criterion_echo/test00.cpp +++ b/tests/criterion/criterion_echo/test00.c @@ -1,6 +1,12 @@ -#include +#include #include +#include 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); +} \ No newline at end of file