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