mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Run the simple tests.
This commit is contained in:
41
Makefile
41
Makefile
@@ -1,21 +1,4 @@
|
|||||||
# Normal settings.
|
# Special Windows settings.
|
||||||
|
|
||||||
OBJDIR = .obj
|
|
||||||
LUA = lua
|
|
||||||
CC = gcc
|
|
||||||
CXX = g++
|
|
||||||
AR = ar
|
|
||||||
PKG_CONFIG = pkg-config
|
|
||||||
WX_CONFIG = wx-config
|
|
||||||
PROTOC = protoc
|
|
||||||
CFLAGS = -g
|
|
||||||
CXXFLAGS = -std=c++2a \
|
|
||||||
-Wno-deprecated-enum-float-conversion \
|
|
||||||
-Wno-deprecated-enum-enum-conversion
|
|
||||||
LDFLAGS =
|
|
||||||
PLATFORM = UNIX
|
|
||||||
|
|
||||||
# Apply special Windows settings.
|
|
||||||
|
|
||||||
ifeq ($(OS), Windows_NT)
|
ifeq ($(OS), Windows_NT)
|
||||||
MINGWBIN = /mingw32/bin
|
MINGWBIN = /mingw32/bin
|
||||||
@@ -26,7 +9,26 @@ ifeq ($(OS), Windows_NT)
|
|||||||
PLATFORM = WINDOWS
|
PLATFORM = WINDOWS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: $(OBJDIR)/build.ninja
|
# Normal settings.
|
||||||
|
|
||||||
|
OBJDIR ?= .obj
|
||||||
|
LUA ?= lua
|
||||||
|
CC ?= gcc
|
||||||
|
CXX ?= g++
|
||||||
|
AR ?= ar
|
||||||
|
PKG_CONFIG ?= pkg-config
|
||||||
|
WX_CONFIG ?= wx-config
|
||||||
|
PROTOC ?= protoc
|
||||||
|
CFLAGS ?= -g -Os
|
||||||
|
CXXFLAGS ?= -std=c++2a \
|
||||||
|
-Wno-deprecated-enum-float-conversion \
|
||||||
|
-Wno-deprecated-enum-enum-conversion
|
||||||
|
LDFLAGS ?=
|
||||||
|
PLATFORM ?= UNIX
|
||||||
|
TESTS ?= yes
|
||||||
|
|
||||||
|
all:: $(OBJDIR)/build.ninja compile_commands.json
|
||||||
|
@ninja -f $< -t compdb > compile_commands.json
|
||||||
@ninja -f $<
|
@ninja -f $<
|
||||||
|
|
||||||
$(OBJDIR)/build.ninja: Makefile $(shell find . -name '*.lua')
|
$(OBJDIR)/build.ninja: Makefile $(shell find . -name '*.lua')
|
||||||
@@ -43,6 +45,7 @@ $(OBJDIR)/build.ninja: Makefile $(shell find . -name '*.lua')
|
|||||||
PKG_CONFIG="$(PKG_CONFIG)" \
|
PKG_CONFIG="$(PKG_CONFIG)" \
|
||||||
PLATFORM="$(PLATFORM)" \
|
PLATFORM="$(PLATFORM)" \
|
||||||
PROTOC="$(PROTOC)" \
|
PROTOC="$(PROTOC)" \
|
||||||
|
TESTS="$(TESTS)" \
|
||||||
WX_CONFIG="$(WX_CONFIG)" \
|
WX_CONFIG="$(WX_CONFIG)" \
|
||||||
> $@
|
> $@
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ vars.ldflags = { "-pthread" }
|
|||||||
|
|
||||||
include "build/protobuf.lua"
|
include "build/protobuf.lua"
|
||||||
include "build/dependency.lua"
|
include "build/dependency.lua"
|
||||||
|
include "build/tests.lua"
|
||||||
|
|
||||||
dependency {
|
dependency {
|
||||||
name = "fmt_dep",
|
name = "fmt_dep",
|
||||||
@@ -182,3 +183,5 @@ installable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include "tests/build.lua"
|
||||||
|
|
||||||
|
|||||||
18
build/tests.lua
Normal file
18
build/tests.lua
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
definerule("test",
|
||||||
|
{
|
||||||
|
srcs = { type="targets", default={} },
|
||||||
|
},
|
||||||
|
function (e)
|
||||||
|
if vars.TESTS == "yes" then
|
||||||
|
normalrule {
|
||||||
|
name = e.name,
|
||||||
|
ins = e.srcs,
|
||||||
|
outleaves = { "log.txt" },
|
||||||
|
commands = {
|
||||||
|
"%{ins} > %{outs}",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
5
dep/snowhouse/build.lua
Normal file
5
dep/snowhouse/build.lua
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
clibrary {
|
||||||
|
name = "snowhouse",
|
||||||
|
dep_cflags = { "-Idep/snowhouse/include" }
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
clibrary {
|
clibrary {
|
||||||
name = "stb",
|
name = "stb",
|
||||||
srcs = { "./stb_image_write.c" },
|
srcs = { "./stb_image_write.c" },
|
||||||
hdrs = { "./stb_image_write.h" }
|
hdrs = { "./stb_image_write.h" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
35
tests/build.lua
Normal file
35
tests/build.lua
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
TESTS = {
|
||||||
|
["agg"] = { "dep/agg+agg", "dep/stb+stb", "~+zlib_dep" },
|
||||||
|
["amiga"] = {},
|
||||||
|
["bitaccumulator"] = {},
|
||||||
|
["bytes"] = {},
|
||||||
|
["compression"] = {},
|
||||||
|
["csvreader"] = {},
|
||||||
|
["flags"] = {},
|
||||||
|
["fluxmapreader"] = {},
|
||||||
|
["fluxpattern"] = {},
|
||||||
|
["fmmfm"] = {},
|
||||||
|
["greaseweazle"] = {},
|
||||||
|
["kryoflux"] = {},
|
||||||
|
["ldbs"] = {},
|
||||||
|
--["proto"] = {},
|
||||||
|
["utils"] = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
for name, deps in pairs(TESTS) do
|
||||||
|
cprogram {
|
||||||
|
name = name.."_bin",
|
||||||
|
srcs = { "./"..name..".cc" },
|
||||||
|
deps = {
|
||||||
|
"~+libfluxengine",
|
||||||
|
"dep/snowhouse+snowhouse",
|
||||||
|
deps
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
name = name.."_test",
|
||||||
|
srcs = { "+"..name.."_bin" }
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
Reference in New Issue
Block a user