Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lacasseio/sample-publish-unit-tests
Demonstrate how to publish native unit tests
https://github.com/lacasseio/sample-publish-unit-tests
Last synced: about 1 month ago
JSON representation
Demonstrate how to publish native unit tests
- Host: GitHub
- URL: https://github.com/lacasseio/sample-publish-unit-tests
- Owner: lacasseio
- Created: 2024-05-18T05:06:04.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-18T05:50:17.000Z (7 months ago)
- Last Synced: 2024-10-12T11:32:49.901Z (2 months ago)
- Language: Java
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Publish Unit Tests Sample
## Consume unit tests via project dependencies
Note the dependency will have to use the `com.example.testsuite.name=test` attribute.
```
$ ./gradlew verify -PdependencyType=project
> Task :test-aggregator:verify
./app/build/exe/test/macos/appTest
./lib/build/exe/test/libTestBUILD SUCCESSFUL
```## Consume unit tests via binary dependencies
First, we need to publish the unit test.
```
$ ./gradlew publishTestPublicationToMavenRepository publishTestMacosPublicationToMavenRepository
[...]BUILD SUCCESSFUL
```Then, we can consume the binary.
Note that because we publish the unit test as a distinct coordinate, we don't need to use the `com.example.testsuite.name` attribute.```
$ ./gradlew verify -PdependencyType=binary
> Task :test-aggregator:verify
~/.gradle/caches/modules-2/files-2.1/com.example.samples/libTest/1.2/3c6031a8f092ea73b276aaecd097d5cdd310e62b/libTest
~/.gradle/caches/modules-2/files-2.1/com.example.samples/appTest_macos_x86-64/1.2/e17b194d5ac1d00ad20615197804657d989475bf/appTestBUILD SUCCESSFUL
```## Limitation
- Because there is no way of knowing what will be the build type of the test component, some synchronization will be required against [this sample](https://github.com/lacasseio/sample-cpp-unit-test-uses-release-variant).