Moved all the test infrasturcture files into a subdirectory of test/ called lib/.

This commit is contained in:
Pietro Gagliardi 2019-05-04 16:53:54 -04:00
parent 57abc83fe3
commit 00411a4d07
13 changed files with 56 additions and 48 deletions

View File

@ -1,8 +1,8 @@
// 10 april 2019
#include <inttypes.h>
#include <string.h>
#include "lib/thread.h"
#include "test.h"
#include "thread.h"
// TODO fix up the formatting of testing.c so we can use newlines on the got/want stuff

51
test/lib/meson.build Normal file
View File

@ -0,0 +1,51 @@
# 23 march 2019
libui_test_sources += [
'lib/testing.c',
'lib/timer.c',
]
if libui_OS == 'windows'
libui_test_sources += [
'lib/thread_windows.c',
'lib/timer_windows.c',
]
else
libui_test_sources += [
'lib/thread_darwinunix.c',
'lib/timer_darwinunix.c'
]
endif
libui_test_deps += [
dependency('threads',
required: true),
]
if libui_OS == 'windows'
libui_test_manifest = 'test.manifest'
if libui_mode == 'static'
libui_test_manifest = 'test.static.manifest'
endif
libui_test_sources += [
windows.compile_resources('resources.rc',
args: libui_manifest_args,
depend_files: [libui_test_manifest]),
]
if libui_mode != 'static'
libui_test_deps += [
meson.get_compiler('c').find_library('kernel32',
required: true),
meson.get_compiler('c').find_library('user32',
required: true),
]
endif
elif libui_OS == 'darwin'
# do nothing
else
libui_test_deps += [
# satisfy old versions of glibc
# TODO is this really needed?
meson.get_compiler('c').find_library('rt',
required: false),
]
endif

View File

@ -3,54 +3,11 @@
libui_test_sources = [
'initmain.c',
'main.c',
'testing.c',
'timer.c',
]
if libui_OS == 'windows'
libui_test_sources += [
'thread_windows.c',
'timer_windows.c',
]
else
libui_test_sources += [
'thread_darwinunix.c',
'timer_darwinunix.c'
]
endif
libui_test_deps = []
libui_test_deps = [
dependency('threads',
required: true),
]
if libui_OS == 'windows'
libui_test_manifest = 'test.manifest'
if libui_mode == 'static'
libui_test_manifest = 'test.static.manifest'
endif
libui_test_sources += [
windows.compile_resources('resources.rc',
args: libui_manifest_args,
depend_files: [libui_test_manifest]),
]
if libui_mode != 'static'
libui_test_deps += [
meson.get_compiler('c').find_library('kernel32',
required: true),
meson.get_compiler('c').find_library('user32',
required: true),
]
endif
elif libui_OS == 'darwin'
# do nothing
else
libui_test_deps += [
# satisfy old versions of glibc
# TODO is this really needed?
meson.get_compiler('c').find_library('rt',
required: false),
]
endif
subdir('lib')
# TODO once we upgrade to 0.49.0, add pie: true
# TODO once we upgrade to 0.50.0, add protocol: 'exitcode'

View File

@ -1,7 +1,7 @@
// 28 april 2019
#include "../ui.h"
#include "testing.h"
#include "timer.h"
#include "lib/testing.h"
#include "lib/timer.h"
// main.c
extern void timeoutMain(void *data);