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 | |
Jason Huang | 5d9ab1a | 2020-04-15 16:53:49 +0800 | [diff] [blame] | 26 | export OPENOLT_ROOT_DIR=$(shell pwd) |
| 27 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 28 | ## Variables |
| 29 | OPENOLTDEVICE ?= asfvolt16 |
Burak Gurdag | eb4ca2e | 2020-06-15 07:48:26 +0000 | [diff] [blame^] | 30 | OPENOLT_PROTO_VER ?= v3.3.9 |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 31 | GTEST_VER ?= release-1.8.0 |
| 32 | CMOCK_VER ?= 0207b30 |
| 33 | GMOCK_GLOBAL_VER ?= 1.0.2 |
| 34 | GRPC_VER ?= v1.27.1 |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 35 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 36 | DOCKER ?= docker |
| 37 | DOCKER_REGISTRY ?= |
| 38 | DOCKER_REPOSITORY ?= voltha/ |
| 39 | DOCKER_EXTRA_ARGS ?= |
| 40 | DOCKER_TAG ?= 1.0.0 |
| 41 | IMAGENAME = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}openolt-test:${DOCKER_TAG} |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 42 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 43 | DOCKER_BUILD_ARGS ?= \ |
| 44 | ${DOCKER_EXTRA_ARGS} \ |
| 45 | --build-arg OPENOLTDEVICE=${OPENOLTDEVICE} \ |
| 46 | --build-arg OPENOLT_PROTO_VER=${OPENOLT_PROTO_VER} \ |
| 47 | --build-arg GTEST_VER=${GTEST_VER} \ |
| 48 | --build-arg CMOCK_VER=${CMOCK_VER} \ |
| 49 | --build-arg GMOCK_GLOBAL_VER=${GMOCK_GLOBAL_VER} \ |
| 50 | --build-arg GRPC_VER=${GRPC_VER} |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 51 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 52 | test: |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 53 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test test |
| 54 | |
| 55 | clean: |
| 56 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean |
| 57 | |
| 58 | cleanall: |
| 59 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean |
| 60 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C protos distclean |