runtest 1021 B

12345678910111213141516171819202122232425262728293031323334
  1. #! /bin/sh
  2. #
  3. # usage: runtest [<testfile>...]
  4. # without args, runs all *.test files in the current directory
  5. #
  6. MAKE="make MODE=debug"
  7. # Test if we are running on OMNeT++ 5.1 as we did not have the _dbg suffix for debug binaries on 5.1
  8. # (this can be removed if OMNeT++ 5.1 compatibility is no longer needed)
  9. #
  10. OMNETPP_51=$(grep "OMNETPP_VERSION = 5.1" $(opp_configfilepath))
  11. if [ -z $OMNETPP_51 ]; then
  12. DBG_SUFFIX="_dbg"
  13. else
  14. DBG_SUFFIX=""
  15. fi
  16. TESTFILES=$*
  17. if [ "x$TESTFILES" = "x" ]; then TESTFILES='*.test'; fi
  18. if [ ! -d work ]; then mkdir work; fi
  19. rm -rf work/lib
  20. cp -pPR lib work/ # OSX dos not support cp -a
  21. opp_test gen $OPT -v $TESTFILES || exit 1
  22. echo
  23. # include precompiled.h first to all c++ file:
  24. echo CFLAGS += -include inet/common/precompiled.h >work/makefrag
  25. (cd work; opp_makemake -f --deep -lINET$DBG_SUFFIX -L../../../src -P . --no-deep-includes -I./lib -I../../../src; $MAKE) || exit 1
  26. echo
  27. opp_test run -p work$DBG_SUFFIX $OPT -v $TESTFILES || exit 1
  28. echo
  29. echo Results can be found in ./work