JPS, -Xcommon-sources: write tests

Original commit: c8351c3da0
This commit is contained in:
Sergey Rostov
2018-09-10 15:14:45 +03:00
parent ac5fbd4080
commit 4cc52c1dff
12 changed files with 107 additions and 0 deletions
@@ -0,0 +1,7 @@
c [sourceSetHolder]
pJvm [compilationAndSourceSetHolder, jvm]
pJvm -> c [include]
pJs [compilationAndSourceSetHolder, js]
pJs -> c [include]
@@ -0,0 +1,5 @@
use @Optional in JS
remove @Optional from JS
use @Optional in JVM
remove @Optional from JVM
add another @Optional in Common module
@@ -0,0 +1,62 @@
================ Step #1 use @Optional in JS =================
Building c
Building pJs
Compiling files:
pJs/src/c.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Declaration annotated with '@OptionalExpectation' can only be used in common module sources
================ Step #2 remove @Optional from JS =================
Building c
Building pJs
Exit code: NOTHING_DONE
------------------------------------------
Building pJvm
Exit code: NOTHING_DONE
------------------------------------------
================ Step #3 use @Optional in JVM =================
Building c
Building pJs
Exit code: NOTHING_DONE
------------------------------------------
Building pJvm
Compiling files:
pJvm/src/c.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Declaration annotated with '@OptionalExpectation' can only be used in common module sources
================ Step #4 remove @Optional from JVM =================
Building c
Building pJs
Exit code: NOTHING_DONE
------------------------------------------
Building pJvm
Exit code: NOTHING_DONE
------------------------------------------
================ Step #5 add another @Optional in Common module =================
Building c
Building pJs
Compiling files:
c/src/b.kt
End of files
Exit code: OK
------------------------------------------
Building pJvm
Compiling files:
c/src/b.kt
End of files
Exit code: OK
------------------------------------------
@@ -0,0 +1,7 @@
@file:Suppress("EXPERIMENTAL_API_USAGE_ERROR")
@OptionalExpectation
expect annotation class Optional(val value: String)
@Optional("Foo")
class Foo
@@ -0,0 +1,3 @@
// Should be an error: Declaration annotated with '@OptionalExpectation' can only be used in common module sources
@Optional("BarJs")
class BarJs
@@ -0,0 +1,3 @@
// Should be an error: Declaration annotated with '@OptionalExpectation' can only be used in common module sources
@Optional("BarJvm")
class BarJvm