mirror of
https://github.com/nasa/trick.git
synced 2024-12-30 09:58:53 +00:00
69 lines
4.3 KiB
Makefile
69 lines
4.3 KiB
Makefile
# To run new unit tests, add new tests to the "test" target
|
||
|
||
TRICK_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../..)
|
||
|
||
# Get JAVAC definition
|
||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||
|
||
JAVAC ?= javac
|
||
JAVAC_FLAGS = -g -Xlint:unchecked -Xlint:deprecation
|
||
# delineate 'javac -version' for version number
|
||
JAVAC_VERSION := $(shell ${JAVAC} -version 2>&1 | perl -ne 'print /(\d+)/')
|
||
|
||
# include java.se.ee for JAXB xml annotations (for trick-tv) in java version 9
|
||
ifeq ($(JAVAC_VERSION),9)
|
||
JAVAC_FLAGS += --add-modules java.se.ee
|
||
endif
|
||
|
||
SRC_DIR = src
|
||
SRC_FILES = $(shell find ${SRC_DIR} -type f -name \*.java)
|
||
BUILD_DIR = build
|
||
DEST_DIR = ${BUILD_DIR}/classes
|
||
LIB_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/lib
|
||
DIST_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/dist
|
||
TEST_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/test
|
||
|
||
empty :=
|
||
space := $(empty) $(empty)
|
||
CLASS_PATH = $(subst $(space),:,$(wildcard ${LIB_DIR}/*.jar):${DIST_DIR}/trick.jar)
|
||
|
||
RESOURCES = $(subst src/,,$(shell find src/trick -name resources))
|
||
RESOURCES += $(subst src/,,$(shell find src/trick -name jaxb.index))
|
||
|
||
all: test
|
||
@echo "[32mJava test successful[0m"
|
||
test: ${TEST_DIR}/test.jar
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_RunTimeTrickApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.common.RunTimeTrickApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_TrickApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.common.TrickApplicationTest
|
||
# java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_LogHeaderReaderTest.xml barrypitman.junitXmlFormatter.Runner trick.common.utils.LogHeaderReaderTest
|
||
# java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_UnitTypeTest.xml barrypitman.junitXmlFormatter.Runner trick.common.utils.UnitTypeTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_TrickDPApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.dataproducts.trickdp.TrickDPApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_TrickQPApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.dataproducts.trickqp.TrickQPApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_DreApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.dre.DreApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_MonteMonitorApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.montemonitor.MonteMonitorApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_MtvApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.mtv.MtvApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_SieApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.sie.SieApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_SimControlApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.simcontrol.SimControlApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_SnifferApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.sniffer.SnifferApplicationTest
|
||
java -cp "${LIB_DIR}/*:${DIST_DIR}/*:${TEST_DIR}/*" -Dorg.schmant.task.junit4.target=${TRICK_HOME}/trick_test/Java_TVApplicationTest.xml barrypitman.junitXmlFormatter.Runner trick.tv.TVApplicationTest
|
||
|
||
${DEST_DIR} ${TEST_DIR}:
|
||
mkdir -p $@
|
||
|
||
${TEST_DIR}/test.jar: compile ${TEST_DIR}
|
||
@echo "[36mCreating jar file...[0m"
|
||
@jar cf ${TEST_DIR}/test.jar -C ${DEST_DIR} .
|
||
|
||
trick_guis:
|
||
@ $(MAKE) -C ..
|
||
|
||
compile: ${DEST_DIR} trick_guis
|
||
@echo "[36mBuilding Trick GUI tests ..[0m"
|
||
@${JAVAC} ${JAVAC_FLAGS} -classpath ${CLASS_PATH} -d ${DEST_DIR} -sourcepath ${SRC_DIR} ${SRC_FILES}
|
||
|
||
clean:
|
||
rm -rf ${BUILD_DIR}
|
||
rm -rf ${TEST_DIR}
|
||
|
||
clean_obj:
|
||
rm -rf ${BUILD_DIR}
|