]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.deploy: add unit test to ensure Cocoa binding works in deployed apps
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 7 Sep 2009 22:59:34 +0000 (17:59 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 7 Sep 2009 22:59:34 +0000 (17:59 -0500)
basis/tools/deploy/deploy-tests.factor
basis/tools/deploy/test/14/14.factor [new file with mode: 0644]
basis/tools/deploy/test/14/authors.txt [new file with mode: 0644]
basis/tools/deploy/test/14/deploy.factor [new file with mode: 0644]

index 9cf21d1716b1e9a4084c36c0c6a4402362d1d05f..0f08e793055a9ee2988d733b8748e111d6bcbeb6 100644 (file)
@@ -101,4 +101,8 @@ M: quit-responder call-responder*
 \r
 os windows? os macosx? or [\r
     [ ] [ "tools.deploy.test.8" shake-and-bake run-temp-image ] unit-test\r
+] when\r
+\r
+os macsx? [\r
+    [ ] [ "tools.deploy.test.14" shake-and-bake run-temp-image ] unit-test\r
 ] when
\ No newline at end of file
diff --git a/basis/tools/deploy/test/14/14.factor b/basis/tools/deploy/test/14/14.factor
new file mode 100644 (file)
index 0000000..502377f
--- /dev/null
@@ -0,0 +1,26 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors classes.struct cocoa cocoa.classes
+cocoa.subclassing core-graphics.types kernel math ;
+IN: tools.deploy.test.14
+
+CLASS: {
+    { +superclass+ "NSObject" }
+    { +name+ "Foo" }
+} {
+    "foo:"
+    "float"
+    { "id" "SEL" "NSRect" }
+    [
+        [ origin>> [ x>> ] [ y>> ] bi + ]
+        [ size>> [ w>> ] [ h>> ] bi + ]
+        bi +
+    ]
+} ;
+
+: main ( -- )
+    Foo -> alloc -> init
+    S{ CGRect f S{ CGPoint f 1.0 2.0 } S{ CGSize f 3.0 4.0 } } -> foo:
+    10.0 assert= ;
+
+MAIN: main
diff --git a/basis/tools/deploy/test/14/authors.txt b/basis/tools/deploy/test/14/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/tools/deploy/test/14/deploy.factor b/basis/tools/deploy/test/14/deploy.factor
new file mode 100644 (file)
index 0000000..b5bf4d6
--- /dev/null
@@ -0,0 +1,14 @@
+USING: tools.deploy.config ;
+H{
+    { deploy-math? t }
+    { deploy-io 2 }
+    { deploy-c-types? f }
+    { deploy-reflection 1 }
+    { deploy-word-defs? f }
+    { "stop-after-last-window?" t }
+    { deploy-word-props? f }
+    { deploy-threads? t }
+    { deploy-ui? f }
+    { deploy-unicode? f }
+    { deploy-name "tools.deploy.test.14" }
+}