mirror of https://gitlab.com/cppit/jucipp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.8 KiB
35 lines
1.8 KiB
|
6 years ago
|
#include "meson.hpp"
|
||
|
|
#include "project.hpp"
|
||
|
8 years ago
|
#include <glib.h>
|
||
|
9 years ago
|
|
||
|
|
int main() {
|
||
|
8 years ago
|
auto tests_path = boost::filesystem::canonical(JUCI_TESTS_PATH);
|
||
|
|
auto meson_test_files_path = boost::filesystem::canonical(tests_path / "meson_test_files");
|
||
|
|
|
||
|
9 years ago
|
{
|
||
|
8 years ago
|
Meson meson(meson_test_files_path / "a_subdir");
|
||
|
|
g_assert(meson.project_path == meson_test_files_path);
|
||
|
9 years ago
|
}
|
||
|
8 years ago
|
|
||
|
9 years ago
|
{
|
||
|
|
Meson meson(meson_test_files_path);
|
||
|
8 years ago
|
g_assert(meson.project_path == meson_test_files_path);
|
||
|
|
|
||
|
|
g_assert(meson.get_executable(meson_test_files_path / "build", meson_test_files_path / "main.cpp") == meson_test_files_path / "build" / "hello");
|
||
|
|
g_assert(meson.get_executable(meson_test_files_path / "build", meson_test_files_path / "another_file.cpp") == meson_test_files_path / "build" / "another_executable");
|
||
|
|
g_assert(meson.get_executable(meson_test_files_path / "build", meson_test_files_path / "a_subdir" / "main.cpp") == meson_test_files_path / "build" / "a_subdir" / "hello2");
|
||
|
|
|
||
|
|
g_assert(meson.get_executable(meson_test_files_path / "build", meson_test_files_path / "non_existing_file.cpp") == meson_test_files_path / "build" / "hello");
|
||
|
|
g_assert(meson.get_executable(meson_test_files_path / "build", meson_test_files_path) == meson_test_files_path / "build" / "hello");
|
||
|
|
|
||
|
|
g_assert(meson.get_executable(meson_test_files_path / "build", meson_test_files_path / "a_subdir") == meson_test_files_path / "build" / "a_subdir" / "hello2");
|
||
|
|
g_assert(meson.get_executable(meson_test_files_path / "build", meson_test_files_path / "a_subdir" / "non_existing_file.cpp") == meson_test_files_path / "build" / "a_subdir" / "hello2");
|
||
|
9 years ago
|
}
|
||
|
8 years ago
|
|
||
|
|
auto build = Project::Build::create(meson_test_files_path);
|
||
|
|
g_assert(dynamic_cast<Project::MesonBuild *>(build.get()));
|
||
|
|
|
||
|
|
build = Project::Build::create(meson_test_files_path / "a_subdir");
|
||
|
|
g_assert(dynamic_cast<Project::MesonBuild *>(build.get()));
|
||
|
9 years ago
|
}
|