Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 1 | #Copyright 2018-present Open Networking Foundation |
| 2 | # |
| 3 | #Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | #you may not use this file except in compliance with the License. |
| 5 | #You may obtain a copy of the License at |
| 6 | # |
| 7 | #http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | #Unless required by applicable law or agreed to in writing, software |
| 10 | #distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | #See the License for the specific language governing permissions and |
| 13 | #limitations under the License. |
| 14 | |
| 15 | ######################################################################## |
| 16 | |
| 17 | # This Makefile provides hook for Jenkins to invoke the test target for |
| 18 | # CI integration. |
| 19 | # The main Makefile for product compilation is available at |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 20 | # agent/Makefile. Please see ./README.md and ./agent/test/README.md for more |
| 21 | # details. |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 22 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 23 | # set default shell options |
| 24 | SHELL = bash -e -o pipefail |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 25 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 26 | ## Variables |
| 27 | OPENOLTDEVICE ?= asfvolt16 |
Burak Gurdag | 2f2618c | 2020-04-23 13:20:30 +0000 | [diff] [blame^] | 28 | OPENOLT_PROTO_VER ?= v3.3.5 |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 29 | GTEST_VER ?= release-1.8.0 |
| 30 | CMOCK_VER ?= 0207b30 |
| 31 | GMOCK_GLOBAL_VER ?= 1.0.2 |
| 32 | GRPC_VER ?= v1.27.1 |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 33 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 34 | DOCKER ?= docker |
| 35 | DOCKER_REGISTRY ?= |
| 36 | DOCKER_REPOSITORY ?= voltha/ |
| 37 | DOCKER_EXTRA_ARGS ?= |
| 38 | DOCKER_TAG ?= 1.0.0 |
| 39 | IMAGENAME = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}openolt-test:${DOCKER_TAG} |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 40 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 41 | DOCKER_BUILD_ARGS ?= \ |
| 42 | ${DOCKER_EXTRA_ARGS} \ |
| 43 | --build-arg OPENOLTDEVICE=${OPENOLTDEVICE} \ |
| 44 | --build-arg OPENOLT_PROTO_VER=${OPENOLT_PROTO_VER} \ |
| 45 | --build-arg GTEST_VER=${GTEST_VER} \ |
| 46 | --build-arg CMOCK_VER=${CMOCK_VER} \ |
| 47 | --build-arg GMOCK_GLOBAL_VER=${GMOCK_GLOBAL_VER} \ |
| 48 | --build-arg GRPC_VER=${GRPC_VER} |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 49 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 50 | test: |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 51 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test test |
| 52 | |
| 53 | clean: |
| 54 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean |
| 55 | |
| 56 | cleanall: |
| 57 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean |
| 58 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C protos distclean |