contrib/objcwrapper: add the check rule with a few tests
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 7 Aug 2015 16:27:39 +0000 (12:27 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 21 Aug 2015 19:05:26 +0000 (15:05 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/objcwrapper/.gitignore
contrib/objcwrapper/Makefile
contrib/objcwrapper/tests/MyClass.h [new file with mode: 0644]

index 50f688f..0d0b14f 100644 (file)
@@ -1,3 +1,5 @@
 src/objc_lexer.nit
 src/objc_parser.nit
 src/objc_test_parser.nit
+tests/MyClass.nit
+objc.ast.dot
index 3cfd30f..eac09b8 100644 (file)
@@ -13,3 +13,27 @@ bin/objcwrapper: $(shell ../../bin/nitls -M src/objcwrapper.nit) src/objc_parser
 
 bin/objc_test_parser: $(shell ../../bin/nitls -M src/objc_test_parser.nit)
        ../../bin/nitc -o bin/objc_test_parser src/objc_test_parser.nit --semi-global
+
+check: bin/objc_test_parser bin/objcwrapper
+       # Test the parser
+       bin/objc_test_parser tests/MyClass.h
+
+       # Test objcwrapper
+       bin/objcwrapper tests/MyClass.h -o tests/MyClass.nit
+       ../../bin/nitpick tests/MyClass.nit
+
+# Test on classes of libgnustep-base-dev
+check-gnustep:
+       gcc -E /usr/include/GNUstep/Foundation/NSArray.h -I /usr/include/GNUstep/ -Wno-deprecated \
+       | ../header_keeper/bin/header_keeper /usr/include/GNUstep/Foundation/NSArray.h \
+       | bin/header_static > tests/NSArray.pre.h
+       bin/objcwrapper tests/NSArray.pre.h
+       ../../bin/nitpick NSArray.nit
+
+# Test on classes of the Apple Foundation framework
+check-apple:
+       gcc -E /System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h \
+       | ../header_keeper/bin/header_keeper /System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h \
+       | bin/header_static > tests/NSArray.pre.h
+       bin/objcwrapper tests/NSArray.pre.h
+       ../../bin/nitpick NSArray.nit
diff --git a/contrib/objcwrapper/tests/MyClass.h b/contrib/objcwrapper/tests/MyClass.h
new file mode 100644 (file)
index 0000000..ccacb22
--- /dev/null
@@ -0,0 +1,12 @@
+@interface MyClass : NSObject
+  <NSCoding, NSCopying, NSMutableCopying, NSFastEnumeration>
+
++ (id) array;
++ (id) arrayWithContentsOfFile: (NSString*)file;
+
+- (id) arrayWithArray: (MyClass*)array;
+
+@property (readonly) NSUInteger count;
+@property NSUInteger head;
+
+@end