]> git.mdlowis.com Git - projs/atf.git/commitdiff
added macro to ignore a test
authorMichael D. Lowis <mike@mdlowis.com>
Sat, 18 Feb 2017 01:37:36 +0000 (20:37 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Sat, 18 Feb 2017 01:37:36 +0000 (20:37 -0500)
atf.h
tests.c

diff --git a/atf.h b/atf.h
index 8c8437b11c15e70a1a1db8940ac74d750850fb6c..b6b5fbbc4a976448cc9b99e460dbf44e1f41d243 100755 (executable)
--- a/atf.h
+++ b/atf.h
@@ -1,5 +1,5 @@
 /**
-    A minimalistic unit testing framework for C.
+    Aardvark Test Framework - A minimalistic unit testing framework for C.
 
     Copyright 2014 Michael D. Lowis
     
@@ -30,6 +30,9 @@ bool atf_test_assert(bool success, char* expr_str, char* file, int line);
 void atf_test_fail(char* expr, char* file, int line);
 int atf_print_results(void);
 
+#define IGNORE(msg) \
+    printf("%s:%d:%s:IGNORE:\n\t%s\n", __FILE__, __LINE__, Curr_Test, msg); break
+
 #define CHECK(expr) \
     if(atf_test_assert((expr), #expr, __FILE__, __LINE__)) break
 
diff --git a/tests.c b/tests.c
index 807e8e0e362add51f7522dcdc106176523222930..ce0efab4a465654e3a6799ef740bb5e1eedeb33d 100644 (file)
--- a/tests.c
+++ b/tests.c
@@ -2,11 +2,16 @@
 #include <atf.h>
 
 TEST_SUITE(Local_Suite) {
-    TEST(Passing_Test) {
+    TEST(Ignored Test) {
+        IGNORE("This test is ignored");
+        CHECK(false); // Will not run
+    }
+    
+    TEST(Passing Test) {
         CHECK(true);
     }
 
-    TEST(Failing_Test) {
+    TEST(Failing Test) {
         CHECK(false);
     }
 }