fix unit tests for reorganized codebase
This commit is contained in:
parent
e1c5d0f0f4
commit
a717ed4a38
23
Rakefile.rb
23
Rakefile.rb
@ -12,35 +12,36 @@ base_env = Rscons::Environment.new do |env|
|
||||
env["CCFLAGS"] += ["-Wall", "-O2"]
|
||||
env["CFLAGS"] << "-std=gnu99"
|
||||
env["CXXFLAGS"] << "-std=gnu++11"
|
||||
env.parse_flags!("!sdl2-config --cflags --libs")
|
||||
env.parse_flags!("!freetype-config --cflags --libs")
|
||||
env["LIBS"] += ["dl"]
|
||||
if RUBY_PLATFORM =~ /mingw/
|
||||
env["LIBS"] += ["opengl32"]
|
||||
else
|
||||
env["LIBS"] += ["GL"]
|
||||
end
|
||||
end
|
||||
|
||||
task :default do
|
||||
base_env.clone(clone: :all) do |env|
|
||||
env.parse_flags!("!sdl2-config --cflags --libs")
|
||||
env.parse_flags!("!freetype-config --cflags --libs")
|
||||
env["LIBS"] += ["dl"]
|
||||
if RUBY_PLATFORM =~ /mingw/
|
||||
env["LIBS"] += ["opengl32"]
|
||||
else
|
||||
env["LIBS"] += ["GL"]
|
||||
end
|
||||
env.Program("bin/jes", Dir["src/**/*.{cc,c}"])
|
||||
end
|
||||
end
|
||||
|
||||
task :test => :default do
|
||||
task :test do
|
||||
base_env.clone(clone: :all) do |env|
|
||||
env.build_root = "build/test"
|
||||
env["CPPPATH"] << "src"
|
||||
env["CPPPATH"] << "gtest-#{GTEST_VERSION}/include"
|
||||
env["CPPPATH"] << "gtest-#{GTEST_VERSION}"
|
||||
sources = Dir["gtest-#{GTEST_VERSION}/src/gtest-all.cc",
|
||||
"gtest-#{GTEST_VERSION}/src/gtest_main.cc",
|
||||
"src/**/*.{cc,c}",
|
||||
"test/src/**/*.cc"]
|
||||
env.Program("build/tests", sources)
|
||||
"test/src/**/*.cc"] - ["src/main.cc"]
|
||||
if RUBY_PLATFORM =~ /linux/
|
||||
env["LIBS"] << "pthread"
|
||||
end
|
||||
env.Program("build/tests", sources)
|
||||
end
|
||||
system("./build/tests")
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "jes/FileLoader.h"
|
||||
#include "FileLoader.h"
|
||||
|
||||
using namespace jes;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "jes/Path.h"
|
||||
#include "Path.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace jes;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "jes/Ref.h"
|
||||
#include "Ref.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace jes;
|
||||
|
Loading…
x
Reference in New Issue
Block a user