mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-10 23:22:33 +02:00
Removed unused files, fixed tests compilation. (refs #1826)
This commit is contained in:
+3
-3
@@ -7,15 +7,15 @@ SUBDIRS = src doc
|
||||
|
||||
DOLLAR = $
|
||||
|
||||
build_tests.commands = ./unit_tests.sh make build_tests
|
||||
build_tests.commands = cd src/unit_tests; make build_tests; cd -
|
||||
build_tests.depends = all
|
||||
|
||||
run_tests.commands = ./unit_tests.sh make run_tests
|
||||
run_tests.commands = cd src/unit_tests; make run_tests; cd -
|
||||
run_tests.depends = all
|
||||
|
||||
tests.depends = run_tests
|
||||
|
||||
clean_tests.commands = /usr/bin/env python testclean.py
|
||||
clean_tests.commands = cd src/unit_tests; make clean_tests; cd -
|
||||
|
||||
QMAKE_EXTRA_TARGETS += build_tests run_tests clean_tests tests
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
*.a
|
||||
/*Test
|
||||
generatedScriptTestsLinux
|
||||
generatedScriptTestsSecuwall
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
DOLLAR = $
|
||||
|
||||
build_tests.commands = echo "Building tests..."; \
|
||||
./unit_tests.sh make build_tests
|
||||
|
||||
run_tests.commands = echo "Running tests..."; \
|
||||
./unit_tests.sh make run_tests
|
||||
|
||||
clean_tests.commands = echo "Cleaning tests..."; \
|
||||
./unit_tests.sh make clean_tests
|
||||
|
||||
QMAKE_EXTRA_TARGETS += run_tests clean_tests build_tests
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
commands=$@
|
||||
|
||||
for directory in `find . -maxdepth 1 -type d -regex '\./[A-Za-z0-9\-\_]*'`
|
||||
do
|
||||
cd $directory
|
||||
[ ! -e Makefile ] && qmake -spec $QMAKESPEC
|
||||
$commands || exit 1;
|
||||
cd -
|
||||
done
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
*.a
|
||||
/*Test
|
||||
generatedScriptTestsIpfilter
|
||||
generatedScriptTestsIpfw
|
||||
generatedScriptTestsPF
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
DOLLAR = $
|
||||
|
||||
build_tests.commands = echo "Building tests..."; \
|
||||
./unit_tests.sh make build_tests
|
||||
|
||||
run_tests.commands = echo "Running tests..."; \
|
||||
./unit_tests.sh make run_tests
|
||||
|
||||
clean_tests.commands = echo "Cleaning tests..."; \
|
||||
./unit_tests.sh make clean_tests
|
||||
|
||||
QMAKE_EXTRA_TARGETS += run_tests clean_tests build_tests
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
commands=$@
|
||||
|
||||
for directory in `find . -maxdepth 1 -type d -regex '\./[A-Za-z0-9\-\_]*'`
|
||||
do
|
||||
cd $directory
|
||||
[ ! -e Makefile ] && qmake -spec $QMAKESPEC
|
||||
$commands || exit 1;
|
||||
cd -
|
||||
done
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "ImporterTest.h"
|
||||
|
||||
#include "../../config.h"
|
||||
#include "config.h"
|
||||
#include "global.h"
|
||||
|
||||
#include <fstream>
|
||||
@@ -36,10 +36,10 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "../../Importer.h"
|
||||
#include "../../IOSImporter.h"
|
||||
#include "../../IPTImporter.h"
|
||||
#include "../../FWBTree.h"
|
||||
#include "Importer.h"
|
||||
#include "IOSImporter.h"
|
||||
#include "IPTImporter.h"
|
||||
#include "FWBTree.h"
|
||||
|
||||
#include "fwbuilder/Policy.h"
|
||||
#include "fwbuilder/Rule.h"
|
||||
|
||||
@@ -25,9 +25,8 @@
|
||||
|
||||
#include "parseCommandLineTest.h"
|
||||
|
||||
#include "../../../../config.h"
|
||||
//#include "../../global.h"
|
||||
#include "../../utils.h"
|
||||
#include "config.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qfile.h>
|
||||
|
||||
@@ -12,7 +12,8 @@ CONFIG -= release
|
||||
CONFIG += debug
|
||||
LIBS += $$LIBS_FWCOMPILER $$LIBS_FWBUILDER $$CPPUNIT_LIBS
|
||||
|
||||
INCLUDEPATH += ../.ui
|
||||
INCLUDEPATH += ../../libgui
|
||||
INCLUDEPATH += ../../libgui/.ui
|
||||
INCLUDEPATH += ../../compiler_lib
|
||||
INCLUDEPATH += ../../iptlib
|
||||
INCLUDEPATH += ../../.. \
|
||||
|
||||
@@ -10,7 +10,7 @@ run_tests.commands = echo "Running tests..."; \
|
||||
./unit_tests.sh make run_tests
|
||||
|
||||
clean_tests.commands = echo "Cleaning tests..."; \
|
||||
./unit_tests.sh make clean_tests
|
||||
./unit_tests.sh make clean
|
||||
|
||||
build_tests.depends = libgui
|
||||
run_tests.depends = libgui
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
from glob import glob
|
||||
|
||||
OBJRE = re.compile("^OBJECTS_DIR\s*=\s*(.*)\n", re.MULTILINE)
|
||||
MOCRE = re.compile("^MOC_DIR\s*=\s*(.*)\n", re.MULTILINE)
|
||||
|
||||
# find all unit tests directories
|
||||
directories = set()
|
||||
for item in os.walk("."):
|
||||
if os.path.basename(item[0]) == "unit_tests":
|
||||
for path in item[1]:
|
||||
fullpath = os.path.join(item[0], path)
|
||||
if path.startswith("."): continue
|
||||
if path.endswith(".app"): continue # skip mac apps
|
||||
if os.path.isdir(fullpath):
|
||||
directories.add(fullpath)
|
||||
|
||||
# this one does not contain unit test dirs, but is unit test by itself
|
||||
directories.add(os.path.join('.','src','compiler_lib','unit_tests'))
|
||||
|
||||
for directory in directories:
|
||||
profiles = glob(directory+"/*.pro")
|
||||
if not profiles:
|
||||
print directory
|
||||
print "No pro file found in specified directory. Skipping."
|
||||
continue
|
||||
|
||||
profile = open(profiles[0]).read()
|
||||
objdirs = OBJRE.findall(profile)
|
||||
objdir = directory
|
||||
if not objdirs:
|
||||
print "There is no OBJECTS_DIR variable set in pro file, using project directory."
|
||||
else:
|
||||
objdir = objdirs[0]
|
||||
if objdir.startswith('.'):
|
||||
objdir = os.path.join(directory, objdir)
|
||||
|
||||
mocdirs = MOCRE.findall(profile)
|
||||
mocdir = directory
|
||||
if not mocdirs:
|
||||
print "There is no MOC_DIR variable set in pro file, using project directory."
|
||||
else:
|
||||
mocdir = mocdirs[0]
|
||||
if mocdir.startswith('.'):
|
||||
mocdir = os.path.join(directory, mocdir)
|
||||
|
||||
print "Cleaning files in directories:", objdir, mocdir
|
||||
files = glob(directory+"/*.cpp")
|
||||
for file in files:
|
||||
directory = os.path.dirname(file)
|
||||
basename = os.path.basename(file)
|
||||
noext = '.'.join(basename.split('.')[:-1])
|
||||
obj = os.path.join(objdir, noext+".o")
|
||||
moc = os.path.join(mocdir, "moc_"+basename)
|
||||
if os.path.exists(obj):
|
||||
print "deleting", obj
|
||||
os.remove(obj)
|
||||
if os.path.exists(moc):
|
||||
print "deleting", moc
|
||||
os.remove(moc)
|
||||
|
||||
files = glob(directory+"/*.a")
|
||||
for file in files:
|
||||
print "deleting", file
|
||||
os.remove(file)
|
||||
|
||||
print directory, ": done."
|
||||
print "all done."
|
||||
Reference in New Issue
Block a user