summaryrefslogtreecommitdiffstats
blob: 38769190b8afa224536be6457cb3676d359b77fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os

Import("env")

if env["TEST"] :
	if env["SCONS_STAGE"] == "flags" :
		env["UNITTEST_SOURCES"] = []
		env["UNITTEST_OBJECTS"] = []
	if env["SCONS_STAGE"] == "test" :
		myenv = env.Clone()
		myenv.MergeFlags(env.get("CHECKER_FLAGS",""))
		myenv.MergeFlags(env.get("SLIMBER_FLAGS",""))
		myenv.MergeFlags(env.get("SWIFT_CONTROLLERS_FLAGS",""))
		myenv.MergeFlags(env.get("SWIFTOOLS_FLAGS",""))
		myenv.MergeFlags(env.get("SWIFTEN_FLAGS",""))
		myenv.MergeFlags(env.get("CPPUNIT_FLAGS",""))
		myenv.MergeFlags(env.get("LIBIDN_FLAGS", ""))
		myenv.MergeFlags(env.get("BOOST_FLAGS", ""))
		myenv.MergeFlags(env.get("SQLITE_FLAGS", ""))
		myenv.MergeFlags(env.get("LIBXML_FLAGS", ""))
		myenv.MergeFlags(env.get("EXPAT_FLAGS", ""))
		myenv.MergeFlags(env.get("ZLIB_FLAGS", ""))
		myenv.MergeFlags(env.get("OPENSSL_FLAGS", ""))
		myenv.MergeFlags(env["PLATFORM_FLAGS"])
		if env.get("HAVE_LIBXML") :
			myenv.Append(CPPDEFINES = ["HAVE_LIBXML"])
		if env.get("HAVE_EXPAT") :
			myenv.Append(CPPDEFINES = ["HAVE_EXPAT"])
		if env["TEST_CREATE_LIBRARIES"] :
			myenv.StaticLibrary("Swift_UnitTests", env["UNITTEST_SOURCES"] + env["UNITTEST_OBJECTS"])
		else :
			checker = myenv.Program("checker", env["UNITTEST_SOURCES"] + env["UNITTEST_OBJECTS"])
			for i in ["HOME", "USERPROFILE", "APPDATA"]:
				if os.environ.get(i, "") :
					myenv["ENV"][i] = os.environ[i]
			myenv.Test(checker, is_checker = True)