From 2f5d9509070fc0883752ecf48b171064d640ea66 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Sun, 14 May 2017 11:13:42 +0200 Subject: [PATCH] tests: rename gpiod-unit to gpiod-test The testing framework will be reused for all kinds of tests. Also: the tests we have are not really separated, but use external components so calling them unit tests is wrong anyway. Signed-off-by: Bartosz Golaszewski --- .gitignore | 2 +- README.md | 4 ++-- tests/Makefile.am | 8 ++++---- tests/{gpiod-unit.c => gpiod-test.c} | 6 +++--- tests/{gpiod-unit.h => gpiod-test.h} | 8 ++++---- tests/tests-chip.c | 2 +- tests/tests-event.c | 2 +- tests/tests-iter.c | 2 +- tests/tests-line.c | 2 +- tests/tests-misc.c | 2 +- tests/tests-simple-api.c | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) rename tests/{gpiod-unit.c => gpiod-test.c} (99%) rename tests/{gpiod-unit.h => gpiod-test.h} (97%) diff --git a/.gitignore b/.gitignore index 0e57f63..bb8451e 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ m4/ stamp-h1 # unit tests -gpiod-unit +gpiod-test diff --git a/README.md b/README.md index 5860c06..e21dbc8 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Examples: TESTING ------- -A comprehensive unit testing framework is included with the library and can be +A comprehensive testing framework is included with the library and can be used to test both the library code and the linux kernel user-space interface. The minimum kernel version required to run the tests is 4.11. The tests work @@ -119,7 +119,7 @@ As opposed to standard autotools projects, libgpiod doesn't execute any tests when invoking 'make check'. Instead the user must run them manually with superuser privileges: - sudo ./tests/gpiod-unit + sudo ./tests/gpiod-test CONTRIBUTING ------------ diff --git a/tests/Makefile.am b/tests/Makefile.am index 4772216..d327bc3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,10 +11,10 @@ AM_CFLAGS += -Wall -Wextra -g $(KMOD_CFLAGS) $(UDEV_CFLAGS) AM_LDFLAGS = -pthread LDADD = ../src/lib/libgpiod.la $(KMOD_LIBS) $(UDEV_LIBS) -check_PROGRAMS = gpiod-unit +check_PROGRAMS = gpiod-test -gpiod_unit_SOURCES = gpiod-unit.c \ - gpiod-unit.h \ +gpiod_test_SOURCES = gpiod-test.c \ + gpiod-test.h \ tests-chip.c \ tests-event.c \ tests-iter.c \ @@ -24,7 +24,7 @@ gpiod_unit_SOURCES = gpiod-unit.c \ check: check-am @echo " ********************************************************" - @echo " * Unit tests have been built as tests/gpio-unit. *" + @echo " * Tests have been built as tests/gpio-test. *" @echo " * *" @echo " * They require linux kernel version >=v4.11 and the *" @echo " * gpio-mockup module (must not be built-in). *" diff --git a/tests/gpiod-unit.c b/tests/gpiod-test.c similarity index 99% rename from tests/gpiod-unit.c rename to tests/gpiod-test.c index 100e8ca..aae3af0 100644 --- a/tests/gpiod-unit.c +++ b/tests/gpiod-test.c @@ -1,5 +1,5 @@ /* - * Unit testing framework for libgpiod. + * Testing framework for libgpiod. * * Copyright (C) 2017 Bartosz Golaszewski * @@ -8,7 +8,7 @@ * as published by the Free Software Foundation. */ -#include "gpiod-unit.h" +#include "gpiod-test.h" #include #include @@ -568,7 +568,7 @@ int main(int argc GU_UNUSED, char **argv GU_UNUSED) atexit(module_cleanup); - msg("libgpiod unit-test suite"); + msg("libgpiod test suite"); msg("%u tests registered", globals.num_tests); check_kernel(); diff --git a/tests/gpiod-unit.h b/tests/gpiod-test.h similarity index 97% rename from tests/gpiod-unit.h rename to tests/gpiod-test.h index a1883e0..3b45522 100644 --- a/tests/gpiod-unit.h +++ b/tests/gpiod-test.h @@ -1,5 +1,5 @@ /* - * Unit testing framework for libgpiod. + * Testing framework for libgpiod. * * Copyright (C) 2017 Bartosz Golaszewski * @@ -8,8 +8,8 @@ * as published by the Free Software Foundation. */ -#ifndef __GPIOD_UNIT_H__ -#define __GPIOD_UNIT_H__ +#ifndef __GPIOD_TEST_H__ +#define __GPIOD_TEST_H__ #include #include @@ -134,4 +134,4 @@ void gu_free_chip_iter_noclose(struct gpiod_chip_iter **iter); #define GU_ASSERT_NOTEQ(a1, a2) GU_ASSERT(a1 != a2) #define GU_ASSERT_STR_EQ(s1, s2) GU_ASSERT(strcmp(s1, s2) == 0) -#endif /* __GPIOD_UNIT_H__ */ +#endif /* __GPIOD_TEST_H__ */ diff --git a/tests/tests-chip.c b/tests/tests-chip.c index d94eaa8..7b0d955 100644 --- a/tests/tests-chip.c +++ b/tests/tests-chip.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation. */ -#include "gpiod-unit.h" +#include "gpiod-test.h" #include #include diff --git a/tests/tests-event.c b/tests/tests-event.c index 74d2f41..5dc9dfe 100644 --- a/tests/tests-event.c +++ b/tests/tests-event.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation. */ -#include "gpiod-unit.h" +#include "gpiod-test.h" static void event_rising_edge_good(void) { diff --git a/tests/tests-iter.c b/tests/tests-iter.c index 00d63ba..368472a 100644 --- a/tests/tests-iter.c +++ b/tests/tests-iter.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation. */ -#include "gpiod-unit.h" +#include "gpiod-test.h" static void chip_iter(void) { diff --git a/tests/tests-line.c b/tests/tests-line.c index 4f430f4..7264869 100644 --- a/tests/tests-line.c +++ b/tests/tests-line.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation. */ -#include "gpiod-unit.h" +#include "gpiod-test.h" static void line_request_output(void) { diff --git a/tests/tests-misc.c b/tests/tests-misc.c index 72e7f4d..c318d15 100644 --- a/tests/tests-misc.c +++ b/tests/tests-misc.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation. */ -#include "gpiod-unit.h" +#include "gpiod-test.h" #include diff --git a/tests/tests-simple-api.c b/tests/tests-simple-api.c index e8d8727..3ce271a 100644 --- a/tests/tests-simple-api.c +++ b/tests/tests-simple-api.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation. */ -#include "gpiod-unit.h" +#include "gpiod-test.h" static void simple_set_get_value(void) { -- 2.30.2