[PATCH 4 of 5 c-hglib 🐮 ] Add placeholder tests for level1 and level2

Giovanni Gherdovich g.gherdovich at gmail.com
Thu Nov 6 18:28:27 CST 2014


# HG changeset patch
# User Giovanni Gherdovich <g.gherdovich at gmail.com>
# Date 1413013784 -7200
#      Sat Oct 11 09:49:44 2014 +0200
# Node ID 97c608fdb4d69a143d2f52650b04f3aa0f0054ec
# Parent  e91f96655a7b855725b2f1c72b973b5bfbf07150
Add placeholder tests for level1 and level2

This commit shows how to split the set of tests
over several file.

The names "level 0", "level 1" and "level 2" refers to
"raw level", "command level" and "object" level" described at

http://www.selenic.com/pipermail/mercurial-devel/2013-June/051651.html

diff -r e91f96655a7b -r 97c608fdb4d6 Makefile
--- a/Makefile	Sat Oct 11 09:47:30 2014 +0200
+++ b/Makefile	Sat Oct 11 09:49:44 2014 +0200
@@ -18,7 +18,9 @@
 
 TESTS_DIR_PATH = ./tests
 TEST_TARGET = $(TESTS_DIR_PATH)/test_runner
-TEST_FILES = $(TESTS_DIR_PATH)/tests_level0.c
+TEST_FILES = $(TESTS_DIR_PATH)/tests_level0.c \
+	     $(TESTS_DIR_PATH)/tests_level1.c \
+	     $(TESTS_DIR_PATH)/tests_level2.c
 
 # Build Target
 ##############
diff -r e91f96655a7b -r 97c608fdb4d6 tests/test_runner.c
--- a/tests/test_runner.c	Sat Oct 11 09:47:30 2014 +0200
+++ b/tests/test_runner.c	Sat Oct 11 09:49:44 2014 +0200
@@ -1,12 +1,16 @@
 #include "greatest.h"
 
 extern SUITE(hg_level0_tests);
+extern SUITE(hg_level1_tests);
+extern SUITE(hg_level2_tests);
 
 GREATEST_MAIN_DEFS();
 
 int main(int argc, char **argv) {
 	GREATEST_MAIN_BEGIN();
 	RUN_SUITE(hg_level0_tests);
+	RUN_SUITE(hg_level1_tests);
+	RUN_SUITE(hg_level2_tests);
 	GREATEST_MAIN_END();
 }
 
diff -r e91f96655a7b -r 97c608fdb4d6 tests/tests_level1.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/tests_level1.c	Sat Oct 11 09:49:44 2014 +0200
@@ -0,0 +1,11 @@
+#include "greatest.h"
+
+SUITE(hg_level2_tests);
+
+TEST hg_some_level1_thing() {
+	PASSm("Nothing here yet.");
+}
+
+SUITE(hg_level1_tests) {
+	RUN_TEST(hg_some_level1_thing);
+}
diff -r e91f96655a7b -r 97c608fdb4d6 tests/tests_level2.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/tests_level2.c	Sat Oct 11 09:49:44 2014 +0200
@@ -0,0 +1,11 @@
+#include "greatest.h"
+
+SUITE(hg_level2_tests);
+
+TEST hg_some_level2_thing() {
+	PASSm("Nothing here yet.");
+}
+
+SUITE(hg_level2_tests) {
+	RUN_TEST(hg_some_level2_thing);
+}


More information about the Mercurial-devel mailing list