JetBrains / lincheck

Framework for testing concurrent data structures
Mozilla Public License 2.0
574 stars 33 forks source link

How to run a single linearizability test? #106

Closed you-n-g closed 3 years ago

you-n-g commented 3 years ago

Thanks for your previous kind reply, I've successfully run ./gradlew build

Now I want to run the test ConcurrentLinkedQueueTest.

I've tried the following commands. However, all of them failed

./gradlew test  --tests org.jetbrains.kotlinx.lincheck.test.verifier.linearizability.ConcurrentLinkedQueueTest -i
./gradlew test  -Dtest.single=org.jetbrains.kotlinx.lincheck.test.verifier.linearizability.ConcurrentLinkedQueueTest
gradle test --tests org.jetbrains.kotlinx.lincheck.test.verifier.linearizability.ConcurrentLinkedQueueTest -i
gradle test --tests ConcurrentLinkedQueueTest -i

cd build/classes/kotlin/jvm/test/
java -cp .  org.jetbrains.kotlinx.lincheck.test.verifier.linearizability.ConcurrentLinkedQueueTest
java -cp .:$PROJ_PATH/kotlinx-lincheck/build/libs/lincheck-jvm-2.14.1.jar  org.jetbrains.kotlinx.lincheck.test.verifier.linearizability.ConcurrentLinkedQueueTest

Could you give me any hint that how to run a single test? Thanks

you-n-g commented 3 years ago

And then, I installed kotlinc and tried following command. ConcurrentQueueTest.kt's content is same as https://github.com/Kotlin/kotlinx-lincheck#test-example

kotlinc -cp ../build/libs/lincheck-jvm-2.14.1.jar  ConcurrentQueueTest.kt

However, it doesn't work.

ndkoval commented 3 years ago

Please use the jvmTest task for this purpose, e.g.

./gradlew jvmTest --tests HashMapTest
you-n-g commented 3 years ago

@ndkoval Thanks so much for your reply.

you-n-g commented 3 years ago

@ndkoval I follow your guidance and run the examples successfully. May I ask how to get output like this example? https://github.com/Kotlin/kotlinx-lincheck#example

Thanks!

alefedor commented 3 years ago

@you-n-g Our internal tests are to test lincheck, not the data structures, so expected failures are just suppressed. If you run lincheck via

LinChecker.check(HashMapLinearizabilityTest.class);

as in the example, you'll get the output

you-n-g commented 3 years ago

@alefedor Thanks so much!