From 559fea6e38d48309bcb51e589d4929b787ca3f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Plewa?= <lukasz.plewa@intel.com> Date: Tue, 27 Sep 2016 12:49:13 +0200 Subject: [PATCH] test: add include test for all libraries --- src/Makefile | 3 +- src/NVML.sln | 36 +++++++ src/include/libpmem.h | 4 + src/include/libpmemblk.h | 4 + src/include/libpmemlog.h | 13 ++- src/include/libpmemobj/base.h | 3 + src/include/libpmemobj/types.h | 7 +- src/include/libpmempool.h | 4 + src/include/pmemcompat.h | 79 +++++++++++++++ src/test/blk_include/.gitignore | 1 + src/test/blk_include/Makefile | 42 ++++++++ src/test/blk_include/TEST0 | 45 +++++++++ src/test/blk_include/blk_include.c | 45 +++++++++ src/test/blk_include/blk_include.vcxproj | 85 ++++++++++++++++ .../blk_include/blk_include.vcxproj.filters | 14 +++ src/test/libpmempool_include/.gitignore | 1 + src/test/libpmempool_include/Makefile | 42 ++++++++ src/test/libpmempool_include/TEST0 | 45 +++++++++ .../libpmempool_include/libpmempool_include.c | 45 +++++++++ .../libpmempool_include.vcxproj | 85 ++++++++++++++++ .../libpmempool_include.vcxproj.filters | 14 +++ src/test/log_include/.gitignore | 1 + src/test/log_include/Makefile | 42 ++++++++ src/test/log_include/log_include.c | 45 +++++++++ src/test/log_include/log_include.vcxproj | 85 ++++++++++++++++ .../log_include/log_include.vcxproj.filters | 14 +++ src/test/obj_include/.gitignore | 3 +- src/test/obj_include/Makefile | 48 ++------- .../obj_include/obj_atomic_base_include.c | 37 +++++++ src/test/obj_include/obj_atomic_include.c | 37 +++++++ src/test/obj_include/obj_base_include.c | 43 ++++++++ src/test/obj_include/obj_include.vcxproj | 99 +++++++++++++++++++ .../obj_include/obj_include.vcxproj.filters | 49 +++++++++ .../obj_include/obj_iterator_base_include.c | 37 +++++++ src/test/obj_include/obj_iterator_include.c | 37 +++++++ .../obj_lists_atomic_base_include.c | 37 +++++++ .../obj_include/obj_lists_atomic_include.c | 37 +++++++ src/test/obj_include/obj_pool_base_include.c | 37 +++++++ src/test/obj_include/obj_pool_include.c | 37 +++++++ src/test/obj_include/obj_thread_include.c | 37 +++++++ src/test/obj_include/obj_tx_base_include.c | 37 +++++++ .../{obj_inc.c => obj_tx_include.c} | 12 +-- src/test/obj_include/obj_types_include.c | 37 +++++++ src/test/pmem_include/.gitignore | 1 + src/test/pmem_include/Makefile | 41 ++++++++ src/test/pmem_include/TEST0 | 45 +++++++++ src/test/pmem_include/pmem_include.c | 46 +++++++++ src/test/pmem_include/pmem_include.vcxproj | 85 ++++++++++++++++ .../pmem_include/pmem_include.vcxproj.filters | 14 +++ src/test/unittest/unittest.h | 14 +-- src/windows/include/platform.h | 1 - utils/CSTYLE.ps1 | 2 +- 52 files changed, 1650 insertions(+), 64 deletions(-) create mode 100644 src/include/pmemcompat.h create mode 100644 src/test/blk_include/.gitignore create mode 100644 src/test/blk_include/Makefile create mode 100755 src/test/blk_include/TEST0 create mode 100644 src/test/blk_include/blk_include.c create mode 100644 src/test/blk_include/blk_include.vcxproj create mode 100644 src/test/blk_include/blk_include.vcxproj.filters create mode 100644 src/test/libpmempool_include/.gitignore create mode 100644 src/test/libpmempool_include/Makefile create mode 100755 src/test/libpmempool_include/TEST0 create mode 100644 src/test/libpmempool_include/libpmempool_include.c create mode 100644 src/test/libpmempool_include/libpmempool_include.vcxproj create mode 100644 src/test/libpmempool_include/libpmempool_include.vcxproj.filters create mode 100644 src/test/log_include/.gitignore create mode 100644 src/test/log_include/Makefile create mode 100644 src/test/log_include/log_include.c create mode 100644 src/test/log_include/log_include.vcxproj create mode 100644 src/test/log_include/log_include.vcxproj.filters create mode 100644 src/test/obj_include/obj_atomic_base_include.c create mode 100644 src/test/obj_include/obj_atomic_include.c create mode 100644 src/test/obj_include/obj_base_include.c create mode 100644 src/test/obj_include/obj_include.vcxproj create mode 100644 src/test/obj_include/obj_include.vcxproj.filters create mode 100644 src/test/obj_include/obj_iterator_base_include.c create mode 100644 src/test/obj_include/obj_iterator_include.c create mode 100644 src/test/obj_include/obj_lists_atomic_base_include.c create mode 100644 src/test/obj_include/obj_lists_atomic_include.c create mode 100644 src/test/obj_include/obj_pool_base_include.c create mode 100644 src/test/obj_include/obj_pool_include.c create mode 100644 src/test/obj_include/obj_thread_include.c create mode 100644 src/test/obj_include/obj_tx_base_include.c rename src/test/obj_include/{obj_inc.c => obj_tx_include.c} (94%) create mode 100644 src/test/obj_include/obj_types_include.c create mode 100644 src/test/pmem_include/.gitignore create mode 100644 src/test/pmem_include/Makefile create mode 100755 src/test/pmem_include/TEST0 create mode 100644 src/test/pmem_include/pmem_include.c create mode 100644 src/test/pmem_include/pmem_include.vcxproj create mode 100644 src/test/pmem_include/pmem_include.vcxproj.filters diff --git a/src/Makefile b/src/Makefile index 5af350875..3dd53a7b9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -163,8 +163,9 @@ uninstall: # [!q] to skip windows/include/sys/queue.h +# include/lib*.h - skip include/pmemcompat.h cstyle: - $(STYLE_CHECK) check include/*.h + $(STYLE_CHECK) check include/lib*.h $(STYLE_CHECK) check include/libpmemobj/*.h $(STYLE_CHECK) check include/libpmemobj++/*.hpp $(STYLE_CHECK) check include/libpmemobj++/detail/*.hpp diff --git a/src/NVML.sln b/src/NVML.sln index e308c8803..b0aec0681 100644 --- a/src/NVML.sln +++ b/src/NVML.sln @@ -17,6 +17,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_heap_interrupt", "test\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_parse_size", "test\util_parse_size\util_parse_size.vcxproj", "{08B62E36-63D2-4FF1-A605-4BBABAEE73FB}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_include", "test\log_include\log_include.vcxproj", "{0A049EAD-652F-4E20-8026-90FD99AEE77A}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmemlog", "libpmemlog\libpmemlog.vcxproj", "{0B1818EB-BDC8-4865-964F-DB8BF05CFD86}" ProjectSection(ProjectDependencies) = postProject {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45} @@ -75,6 +77,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_recovery", "test\obj_re EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_toid", "test\obj_toid\obj_toid.vcxproj", "{296F3C5D-3951-423E-8E2F-FD4A37958C72}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_include", "test\blk_include\blk_include.vcxproj", "{29D9376B-DC36-4940-83F1-A7CBE38A2103}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_include", "test\pmem_include\pmem_include.vcxproj", "{2B7772E6-9DAA-4F38-B0BC-7B2399366325}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_locks", "test\obj_locks\obj_locks.vcxproj", "{2DE6B085-3C19-49B1-894A-AD9376000E09}" ProjectSection(ProjectDependencies) = postProject {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} @@ -117,6 +123,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmemalloc", "test\tools\pme {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_include", "test\libpmempool_include\libpmempool_include.vcxproj", "{4E334022-7A71-4197-9E15-878F7EFC877E}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_walker", "test\log_walker\log_walker.vcxproj", "{4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_poolset_parse", "test\util_poolset_parse\util_poolset_parse.vcxproj", "{50FD1E47-2131-48D2-9435-5CB28DF6B15A}" @@ -285,6 +293,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "include", "include", "{9A84 windows\include\sys\mount.h = windows\include\sys\mount.h windows\include\sys\param.h = windows\include\sys\param.h windows\include\platform.h = windows\include\platform.h + include\pmemcompat.h = include\pmemcompat.h windows\include\pthread.h = windows\include\pthread.h windows\include\sys\queue.h = windows\include\sys\queue.h windows\include\sys\statvfs.h = windows\include\sys\statvfs.h @@ -335,6 +344,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_cpp_transaction", "test {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_include", "test\obj_include\obj_include.vcxproj", "{AB15A115-E429-4123-BEBF-206FBA4CF615}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checksum", "test\checksum\checksum.vcxproj", "{AF0B7480-EBE3-486B-B0C8-134910BC9324}" ProjectSection(ProjectDependencies) = postProject {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} @@ -477,6 +488,10 @@ Global {08B62E36-63D2-4FF1-A605-4BBABAEE73FB}.Debug|x64.Build.0 = Debug|x64 {08B62E36-63D2-4FF1-A605-4BBABAEE73FB}.Release|x64.ActiveCfg = Release|x64 {08B62E36-63D2-4FF1-A605-4BBABAEE73FB}.Release|x64.Build.0 = Release|x64 + {0A049EAD-652F-4E20-8026-90FD99AEE77A}.Debug|x64.ActiveCfg = Debug|x64 + {0A049EAD-652F-4E20-8026-90FD99AEE77A}.Debug|x64.Build.0 = Debug|x64 + {0A049EAD-652F-4E20-8026-90FD99AEE77A}.Release|x64.ActiveCfg = Release|x64 + {0A049EAD-652F-4E20-8026-90FD99AEE77A}.Release|x64.Build.0 = Release|x64 {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}.Debug|x64.ActiveCfg = Debug|x64 {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}.Debug|x64.Build.0 = Debug|x64 {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}.Release|x64.ActiveCfg = Release|x64 @@ -525,6 +540,14 @@ Global {296F3C5D-3951-423E-8E2F-FD4A37958C72}.Debug|x64.Build.0 = Debug|x64 {296F3C5D-3951-423E-8E2F-FD4A37958C72}.Release|x64.ActiveCfg = Release|x64 {296F3C5D-3951-423E-8E2F-FD4A37958C72}.Release|x64.Build.0 = Release|x64 + {29D9376B-DC36-4940-83F1-A7CBE38A2103}.Debug|x64.ActiveCfg = Debug|x64 + {29D9376B-DC36-4940-83F1-A7CBE38A2103}.Debug|x64.Build.0 = Debug|x64 + {29D9376B-DC36-4940-83F1-A7CBE38A2103}.Release|x64.ActiveCfg = Release|x64 + {29D9376B-DC36-4940-83F1-A7CBE38A2103}.Release|x64.Build.0 = Release|x64 + {2B7772E6-9DAA-4F38-B0BC-7B2399366325}.Debug|x64.ActiveCfg = Debug|x64 + {2B7772E6-9DAA-4F38-B0BC-7B2399366325}.Debug|x64.Build.0 = Debug|x64 + {2B7772E6-9DAA-4F38-B0BC-7B2399366325}.Release|x64.ActiveCfg = Release|x64 + {2B7772E6-9DAA-4F38-B0BC-7B2399366325}.Release|x64.Build.0 = Release|x64 {2DE6B085-3C19-49B1-894A-AD9376000E09}.Debug|x64.ActiveCfg = Debug|x64 {2DE6B085-3C19-49B1-894A-AD9376000E09}.Debug|x64.Build.0 = Debug|x64 {2DE6B085-3C19-49B1-894A-AD9376000E09}.Release|x64.ActiveCfg = Release|x64 @@ -573,6 +596,10 @@ Global {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF}.Debug|x64.Build.0 = Debug|x64 {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF}.Release|x64.ActiveCfg = Release|x64 {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF}.Release|x64.Build.0 = Release|x64 + {4E334022-7A71-4197-9E15-878F7EFC877E}.Debug|x64.ActiveCfg = Debug|x64 + {4E334022-7A71-4197-9E15-878F7EFC877E}.Debug|x64.Build.0 = Debug|x64 + {4E334022-7A71-4197-9E15-878F7EFC877E}.Release|x64.ActiveCfg = Release|x64 + {4E334022-7A71-4197-9E15-878F7EFC877E}.Release|x64.Build.0 = Release|x64 {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}.Debug|x64.ActiveCfg = Debug|x64 {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}.Debug|x64.Build.0 = Debug|x64 {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}.Release|x64.ActiveCfg = Release|x64 @@ -756,6 +783,10 @@ Global {A5DF0746-5496-4C29-9CCD-5FA76604BF8B}.Debug|x64.Build.0 = Debug|x64 {A5DF0746-5496-4C29-9CCD-5FA76604BF8B}.Release|x64.ActiveCfg = Release|x64 {A5DF0746-5496-4C29-9CCD-5FA76604BF8B}.Release|x64.Build.0 = Release|x64 + {AB15A115-E429-4123-BEBF-206FBA4CF615}.Debug|x64.ActiveCfg = Debug|x64 + {AB15A115-E429-4123-BEBF-206FBA4CF615}.Debug|x64.Build.0 = Debug|x64 + {AB15A115-E429-4123-BEBF-206FBA4CF615}.Release|x64.ActiveCfg = Release|x64 + {AB15A115-E429-4123-BEBF-206FBA4CF615}.Release|x64.Build.0 = Release|x64 {AF0B7480-EBE3-486B-B0C8-134910BC9324}.Debug|x64.ActiveCfg = Debug|x64 {AF0B7480-EBE3-486B-B0C8-134910BC9324}.Debug|x64.Build.0 = Debug|x64 {AF0B7480-EBE3-486B-B0C8-134910BC9324}.Release|x64.ActiveCfg = Release|x64 @@ -865,6 +896,7 @@ Global {0703E813-9CC8-4DEA-AA33-42B099CD172D} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {07A153D9-DF17-4DE8-A3C2-EBF171B961AE} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {08B62E36-63D2-4FF1-A605-4BBABAEE73FB} = {746BA101-5C93-42A5-AC7A-64DCEB186572} + {0A049EAD-652F-4E20-8026-90FD99AEE77A} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {0B1818EB-BDC8-4865-964F-DB8BF05CFD86} = {853D45D8-980C-4991-B62A-DAC6FD245402} {0CDCEB97-3270-4939-A290-EA2D3BE34B0C} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {0DC1B184-C814-448F-8B5F-CFFA6F05156C} = {746BA101-5C93-42A5-AC7A-64DCEB186572} @@ -877,6 +909,8 @@ Global {1F2E1C51-2B14-4047-BE6D-52E00FC3C780} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {2498FCDA-E2CC-43EF-9A35-8CD63F253171} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {296F3C5D-3951-423E-8E2F-FD4A37958C72} = {746BA101-5C93-42A5-AC7A-64DCEB186572} + {29D9376B-DC36-4940-83F1-A7CBE38A2103} = {746BA101-5C93-42A5-AC7A-64DCEB186572} + {2B7772E6-9DAA-4F38-B0BC-7B2399366325} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {2DE6B085-3C19-49B1-894A-AD9376000E09} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {2EFFC590-BF5E-46A2-AF04-E67E1D571D2E} = {F09A0864-9221-47AD-872F-D4538104D747} {3B23831B-E5DE-4A62-9D0B-27D0D9F293F4} = {746BA101-5C93-42A5-AC7A-64DCEB186572} @@ -889,6 +923,7 @@ Global {4A3CDA9F-55C2-455E-8E82-1FAAAA2245C5} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {4C429783-0B01-449F-A36F-C2019233890B} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF} = {F09A0864-9221-47AD-872F-D4538104D747} + {4E334022-7A71-4197-9E15-878F7EFC877E} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {50FD1E47-2131-48D2-9435-5CB28DF6B15A} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {5580D11C-FDA6-4CF2-A0E8-1C2D3FBC11F1} = {746BA101-5C93-42A5-AC7A-64DCEB186572} @@ -939,6 +974,7 @@ Global {A38EFCDB-53D6-4474-97F3-0DDC6CE70D76} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {A5794EFF-8232-4E2B-B52C-908823048F54} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {A5DF0746-5496-4C29-9CCD-5FA76604BF8B} = {746BA101-5C93-42A5-AC7A-64DCEB186572} + {AB15A115-E429-4123-BEBF-206FBA4CF615} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {AF0B7480-EBE3-486B-B0C8-134910BC9324} = {746BA101-5C93-42A5-AC7A-64DCEB186572} {B35BFA09-DE68-483B-AB61-8790E8F060A8} = {F09A0864-9221-47AD-872F-D4538104D747} {B36F115C-8139-4C35-A3E7-E6BF9F3DA793} = {746BA101-5C93-42A5-AC7A-64DCEB186572} diff --git a/src/include/libpmem.h b/src/include/libpmem.h index 3b6076f41..437ab4b6f 100644 --- a/src/include/libpmem.h +++ b/src/include/libpmem.h @@ -43,6 +43,10 @@ #ifndef LIBPMEM_H #define LIBPMEM_H 1 +#ifdef _WIN32 +#include <pmemcompat.h> +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/src/include/libpmemblk.h b/src/include/libpmemblk.h index 9f738769d..566f09b77 100644 --- a/src/include/libpmemblk.h +++ b/src/include/libpmemblk.h @@ -43,6 +43,10 @@ #ifndef LIBPMEMBLK_H #define LIBPMEMBLK_H 1 +#ifdef _WIN32 +#include <pmemcompat.h> +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/src/include/libpmemlog.h b/src/include/libpmemlog.h index fa3c0486d..ba3e03902 100644 --- a/src/include/libpmemlog.h +++ b/src/include/libpmemlog.h @@ -43,12 +43,23 @@ #ifndef LIBPMEMLOG_H #define LIBPMEMLOG_H 1 +#ifdef _WIN32 +#include <pmemcompat.h> +#endif + #ifdef __cplusplus extern "C" { #endif - #include <sys/types.h> + +#ifndef _WIN32 #include <sys/uio.h> +#else +struct iovec { + void *iov_base; + size_t iov_len; +}; +#endif /* * opaque type, internal to libpmemlog diff --git a/src/include/libpmemobj/base.h b/src/include/libpmemobj/base.h index 6f968c731..ce893b769 100644 --- a/src/include/libpmemobj/base.h +++ b/src/include/libpmemobj/base.h @@ -43,6 +43,9 @@ #include <stddef.h> #include <stdint.h> +#ifdef _WIN32 +#include <pmemcompat.h> +#endif #ifdef __cplusplus extern "C" { diff --git a/src/include/libpmemobj/types.h b/src/include/libpmemobj/types.h index 9cc3597b5..4d00a3e86 100644 --- a/src/include/libpmemobj/types.h +++ b/src/include/libpmemobj/types.h @@ -200,8 +200,11 @@ TOID_DECLARE_ROOT(t); /* * XXX - On Windows, these macros do not behave exactly the same as on Linux. */ -#define DIRECT_RW(o) ((__typeof__((o)._type))pmemobj_direct((o).oid)) -#define DIRECT_RO(o) ((const __typeof__((o)._type))pmemobj_direct((o).oid)) +#define DIRECT_RW(o) \ + (reinterpret_cast < __typeof__((o)._type) > (pmemobj_direct((o).oid))) +#define DIRECT_RO(o) \ + (reinterpret_cast < const __typeof__((o)._type) > \ + (pmemobj_direct((o).oid))) #endif /* (defined(_MSC_VER) || defined(__cplusplus)) */ diff --git a/src/include/libpmempool.h b/src/include/libpmempool.h index 230412aa4..7396038e4 100644 --- a/src/include/libpmempool.h +++ b/src/include/libpmempool.h @@ -39,6 +39,10 @@ #ifndef LIBPMEMPOOL_H #define LIBPMEMPOOL_H 1 +#ifdef _WIN32 +#include <pmemcompat.h> +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/src/include/pmemcompat.h b/src/include/pmemcompat.h new file mode 100644 index 000000000..863f5a920 --- /dev/null +++ b/src/include/pmemcompat.h @@ -0,0 +1,79 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * pmemcompat.h -- compatibility layer for libpmem* libraries + */ + +#ifndef PMEMCOMPAT_H +#define PMEMCOMPAT_H +#include <windows.h> + +typedef int mode_t; +/* + * XXX: this code will not work on windows if our library is included in + * an extern block. + */ +#if defined(__cplusplus) && defined(_MSC_VER) +#include <type_traits> +/* + * These templates are used to remove a type reference(T&) which, in some + * cases, is returned by decltype + */ +namespace nvml { + +namespace detail { + +template<typename T> +struct get_type { + using type = T; +}; + +template<typename T> +struct get_type<T*> { + using type = T*; +}; + +template<typename T> +struct get_type<T&> { + using type = T; +}; + +} /* namespace detail */ + +} /* namespace nvml */ + +#define __typeof__(p) nvml::detail::get_type<decltype(p)>::type + +#endif + +#endif diff --git a/src/test/blk_include/.gitignore b/src/test/blk_include/.gitignore new file mode 100644 index 000000000..bf3c5f690 --- /dev/null +++ b/src/test/blk_include/.gitignore @@ -0,0 +1 @@ +blk_include diff --git a/src/test/blk_include/Makefile b/src/test/blk_include/Makefile new file mode 100644 index 000000000..2b340c169 --- /dev/null +++ b/src/test/blk_include/Makefile @@ -0,0 +1,42 @@ +# +# Copyright 2016, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# src/test/blk_include/Makefile -- compilation test for libpmemblk +# +TARGET = blk_include +OBJS = blk_include.o + +LIBPMEM=y +LIBPMEMBLK=y + +include ../Makefile.inc diff --git a/src/test/blk_include/TEST0 b/src/test/blk_include/TEST0 new file mode 100755 index 000000000..c05bd1761 --- /dev/null +++ b/src/test/blk_include/TEST0 @@ -0,0 +1,45 @@ +#!/bin/bash -e +# +# Copyright 2016, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# src/test/blk_include/TEST0 - if it compiles it's perfect +# +export UNITTEST_NAME=blk_include/TEST0 +export UNITTEST_NUM=0 + +# standard unit test setup +. ../unittest/unittest.sh + +setup + +pass diff --git a/src/test/blk_include/blk_include.c b/src/test/blk_include/blk_include.c new file mode 100644 index 000000000..c31a4620b --- /dev/null +++ b/src/test/blk_include/blk_include.c @@ -0,0 +1,45 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * blk_include.c -- include test for libpmemblk + * + * this is only a compilation test - do not run this program + */ + +#include <libpmemblk.h> + +int +main() +{ + return 0; +} diff --git a/src/test/blk_include/blk_include.vcxproj b/src/test/blk_include/blk_include.vcxproj new file mode 100644 index 000000000..bccd4fe77 --- /dev/null +++ b/src/test/blk_include/blk_include.vcxproj @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{29D9376B-DC36-4940-83F1-A7CBE38A2103}</ProjectGuid> + <RootNamespace>blk_include</RootNamespace> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck> + </SDLCheck> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck> + </SDLCheck> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectReference Include="..\..\libpmemblk\libpmemblk.vcxproj"> + <Project>{f7c6c6b6-4142-4c82-8699-4a9d8183181b}</Project> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <ClCompile Include="blk_include.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/src/test/blk_include/blk_include.vcxproj.filters b/src/test/blk_include/blk_include.vcxproj.filters new file mode 100644 index 000000000..7f416bffe --- /dev/null +++ b/src/test/blk_include/blk_include.vcxproj.filters @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="blk_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/src/test/libpmempool_include/.gitignore b/src/test/libpmempool_include/.gitignore new file mode 100644 index 000000000..c1ef8f756 --- /dev/null +++ b/src/test/libpmempool_include/.gitignore @@ -0,0 +1 @@ +libpmempool_include diff --git a/src/test/libpmempool_include/Makefile b/src/test/libpmempool_include/Makefile new file mode 100644 index 000000000..53a2c1fae --- /dev/null +++ b/src/test/libpmempool_include/Makefile @@ -0,0 +1,42 @@ +# +# Copyright 2016, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# src/test/libpmempool_include/Makefile -- compilation test for libpmemblk +# +TARGET = libpmempool_include +OBJS = libpmempool_include.o + +LIBPMEM=y +LIBPMEMPOOL=y + +include ../Makefile.inc diff --git a/src/test/libpmempool_include/TEST0 b/src/test/libpmempool_include/TEST0 new file mode 100755 index 000000000..c062dff78 --- /dev/null +++ b/src/test/libpmempool_include/TEST0 @@ -0,0 +1,45 @@ +#!/bin/bash -e +# +# Copyright 2016, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# src/test/libpmempool_include/TEST0 - if it compiles it's perfect +# +export UNITTEST_NAME=libpmempool_include/TEST0 +export UNITTEST_NUM=0 + +# standard unit test setup +. ../unittest/unittest.sh + +setup + +pass diff --git a/src/test/libpmempool_include/libpmempool_include.c b/src/test/libpmempool_include/libpmempool_include.c new file mode 100644 index 000000000..23dbe99f4 --- /dev/null +++ b/src/test/libpmempool_include/libpmempool_include.c @@ -0,0 +1,45 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * libpmempool_include.c -- include test for libpmempool + * + * this is only a compilation test - do not run this program + */ + +#include <libpmempool.h> + +int +main() +{ + return 0; +} diff --git a/src/test/libpmempool_include/libpmempool_include.vcxproj b/src/test/libpmempool_include/libpmempool_include.vcxproj new file mode 100644 index 000000000..b8554c4c2 --- /dev/null +++ b/src/test/libpmempool_include/libpmempool_include.vcxproj @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{4E334022-7A71-4197-9E15-878F7EFC877E}</ProjectGuid> + <RootNamespace>libpmempool_include</RootNamespace> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck> + </SDLCheck> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck> + </SDLCheck> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectReference Include="..\..\libpmempool\libpmempool.vcxproj"> + <Project>{cf9a0883-6334-44c7-ac29-349468c78e27}</Project> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <ClCompile Include="libpmempool_include.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/src/test/libpmempool_include/libpmempool_include.vcxproj.filters b/src/test/libpmempool_include/libpmempool_include.vcxproj.filters new file mode 100644 index 000000000..38a0b6770 --- /dev/null +++ b/src/test/libpmempool_include/libpmempool_include.vcxproj.filters @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="libpmempool_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/src/test/log_include/.gitignore b/src/test/log_include/.gitignore new file mode 100644 index 000000000..27c4c3096 --- /dev/null +++ b/src/test/log_include/.gitignore @@ -0,0 +1 @@ +log_include diff --git a/src/test/log_include/Makefile b/src/test/log_include/Makefile new file mode 100644 index 000000000..66ecab917 --- /dev/null +++ b/src/test/log_include/Makefile @@ -0,0 +1,42 @@ +# +# Copyright 2016, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# src/test/log_include/Makefile -- compilation test for libpmemlog +# +TARGET = log_include +OBJS = log_include.o + +LIBPMEM=y +LIBPMEMLOG=y + +include ../Makefile.inc diff --git a/src/test/log_include/log_include.c b/src/test/log_include/log_include.c new file mode 100644 index 000000000..b1637ca1f --- /dev/null +++ b/src/test/log_include/log_include.c @@ -0,0 +1,45 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * log_include.c -- include test for libpmemlog + * + * this is only a compilation test - do not run this program + */ + +#include <libpmemlog.h> + +int +main() +{ + return 0; +} diff --git a/src/test/log_include/log_include.vcxproj b/src/test/log_include/log_include.vcxproj new file mode 100644 index 000000000..a8d1d2ad8 --- /dev/null +++ b/src/test/log_include/log_include.vcxproj @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{0A049EAD-652F-4E20-8026-90FD99AEE77A}</ProjectGuid> + <RootNamespace>log_include</RootNamespace> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck> + </SDLCheck> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck> + </SDLCheck> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectReference Include="..\..\libpmemlog\libpmemlog.vcxproj"> + <Project>{0b1818eb-bdc8-4865-964f-db8bf05cfd86}</Project> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <ClCompile Include="log_include.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/src/test/log_include/log_include.vcxproj.filters b/src/test/log_include/log_include.vcxproj.filters new file mode 100644 index 000000000..d06474aaf --- /dev/null +++ b/src/test/log_include/log_include.vcxproj.filters @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="log_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/src/test/obj_include/.gitignore b/src/test/obj_include/.gitignore index a7efaff4d..2a83330ca 100644 --- a/src/test/obj_include/.gitignore +++ b/src/test/obj_include/.gitignore @@ -1,2 +1 @@ -obj_inc -*.tmpo +obj_include diff --git a/src/test/obj_include/Makefile b/src/test/obj_include/Makefile index 044dbc929..4454af0fb 100644 --- a/src/test/obj_include/Makefile +++ b/src/test/obj_include/Makefile @@ -33,51 +33,15 @@ # # src/test/obj_include/Makefile -- build include tests # -TARGET = obj_inc -OBJS = obj_inc.o\ - obj_inc_atomic_base.tmpo obj_inc_atomic.tmpo\ - obj_inc_base.tmpo\ - obj_inc_iter_base.tmpo obj_inc_iter.tmpo\ - obj_inc_lists_atomic_base.tmpo obj_inc_lists_atomic.tmpo\ - obj_inc_pool_base.tmpo obj_inc_pool.tmpo\ - obj_inc_thread.tmpo\ - obj_inc_tx_base.tmpo obj_inc_tx.tmpo\ - obj_inc_types.tmpo +TARGET = obj_include +OBJS = obj_atomic_base_include.o obj_atomic_include.o \ + obj_base_include.o obj_iterator_base_include.o obj_iterator_include.o \ + obj_lists_atomic_base_include.o obj_lists_atomic_include.o \ + obj_pool_base_include.o obj_pool_include.o obj_thread_include.o \ + obj_tx_base_include.o obj_tx_include.o obj_types_include.o LIBPMEM=y LIBPMEMOBJ=y include ../Makefile.inc -%.tmpo: obj_inc.c Makefile - @mkdir -p .deps - $(CC) -MD -c $(CFLAGS) $(INCS) $< -o $@ - $(create-deps) - -clean-tmpo: - rm -f *.tmpo - -clean: clean-tmpo - -obj_inc.o: CFLAGS+=-DBUILD_MAIN - -obj_inc_atomic_base.tmpo: CFLAGS+=-include libpmemobj/atomic_base.h -obj_inc_atomic.tmpo: CFLAGS+=-include libpmemobj/atomic.h - -obj_inc_base.tmpo: CFLAGS+=-include libpmemobj/base.h - -obj_inc_iter_base.tmpo: CFLAGS+=-include libpmemobj/iterator_base.h -obj_inc_iter.tmpo: CFLAGS+=-include libpmemobj/iterator.h - -obj_inc_lists_atomic_base.tmpo: CFLAGS+=-include libpmemobj/lists_atomic_base.h -obj_inc_lists_atomic.tmpo: CFLAGS+=-include libpmemobj/lists_atomic.h - -obj_inc_pool_base.tmpo: CFLAGS+=-include libpmemobj/pool_base.h -obj_inc_pool.tmpo: CFLAGS+=-include libpmemobj/pool.h - -obj_inc_thread.tmpo: CFLAGS+=-include libpmemobj/thread.h - -obj_inc_tx_base.tmpo: CFLAGS+=-include libpmemobj/tx_base.h -obj_inc_tx.tmpo: CFLAGS+=-include libpmemobj/tx.h - -obj_inc_types.tmpo: CFLAGS+=-include libpmemobj/types.h diff --git a/src/test/obj_include/obj_atomic_base_include.c b/src/test/obj_include/obj_atomic_base_include.c new file mode 100644 index 000000000..ddf523495 --- /dev/null +++ b/src/test/obj_include/obj_atomic_base_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_atomic_base_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/atomic_base.h> diff --git a/src/test/obj_include/obj_atomic_include.c b/src/test/obj_include/obj_atomic_include.c new file mode 100644 index 000000000..1de3fb86a --- /dev/null +++ b/src/test/obj_include/obj_atomic_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_atomic_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/atomic.h> diff --git a/src/test/obj_include/obj_base_include.c b/src/test/obj_include/obj_base_include.c new file mode 100644 index 000000000..46c5a48d6 --- /dev/null +++ b/src/test/obj_include/obj_base_include.c @@ -0,0 +1,43 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_base_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/base.h> + +int +main() +{ + return 0; +} diff --git a/src/test/obj_include/obj_include.vcxproj b/src/test/obj_include/obj_include.vcxproj new file mode 100644 index 000000000..1cd9e0fb0 --- /dev/null +++ b/src/test/obj_include/obj_include.vcxproj @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{AB15A115-E429-4123-BEBF-206FBA4CF615}</ProjectGuid> + <RootNamespace>obj_include</RootNamespace> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck> + </SDLCheck> + <CompileAs>CompileAsCpp</CompileAs> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck> + </SDLCheck> + <CompileAs>CompileAsCpp</CompileAs> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectReference Include="..\..\libpmemobj\libpmemobj.vcxproj"> + <Project>{f7c6c6b6-4142-4c82-8699-4a9d8183181b}</Project> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <ClCompile Include="obj_atomic_base_include.c" /> + <ClCompile Include="obj_atomic_include.c" /> + <ClCompile Include="obj_base_include.c" /> + <ClCompile Include="obj_iterator_base_include.c" /> + <ClCompile Include="obj_iterator_include.c" /> + <ClCompile Include="obj_lists_atomic_base_include.c" /> + <ClCompile Include="obj_lists_atomic_include.c" /> + <ClCompile Include="obj_pool_base_include.c" /> + <ClCompile Include="obj_pool_include.c" /> + <ClCompile Include="obj_thread_include.c" /> + <ClCompile Include="obj_tx_base_include.c" /> + <ClCompile Include="obj_tx_include.c" /> + <ClCompile Include="obj_types_include.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/src/test/obj_include/obj_include.vcxproj.filters b/src/test/obj_include/obj_include.vcxproj.filters new file mode 100644 index 000000000..c043e5997 --- /dev/null +++ b/src/test/obj_include/obj_include.vcxproj.filters @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4a1447c8-630b-4665-98c5-87ccd215b237}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="obj_atomic_base_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_atomic_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_base_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_iterator_base_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_iterator_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_lists_atomic_base_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_lists_atomic_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_pool_base_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_pool_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_thread_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_tx_base_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_tx_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="obj_types_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/src/test/obj_include/obj_iterator_base_include.c b/src/test/obj_include/obj_iterator_base_include.c new file mode 100644 index 000000000..0aa9ab20a --- /dev/null +++ b/src/test/obj_include/obj_iterator_base_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_iterator_base_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/iterator_base.h> diff --git a/src/test/obj_include/obj_iterator_include.c b/src/test/obj_include/obj_iterator_include.c new file mode 100644 index 000000000..d3f9a6bc0 --- /dev/null +++ b/src/test/obj_include/obj_iterator_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_iterator_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/iterator.h> diff --git a/src/test/obj_include/obj_lists_atomic_base_include.c b/src/test/obj_include/obj_lists_atomic_base_include.c new file mode 100644 index 000000000..1a2831bc4 --- /dev/null +++ b/src/test/obj_include/obj_lists_atomic_base_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_lists_atomic_base_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/lists_atomic_base.h> diff --git a/src/test/obj_include/obj_lists_atomic_include.c b/src/test/obj_include/obj_lists_atomic_include.c new file mode 100644 index 000000000..04918471e --- /dev/null +++ b/src/test/obj_include/obj_lists_atomic_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_lists_atomic_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/lists_atomic.h> diff --git a/src/test/obj_include/obj_pool_base_include.c b/src/test/obj_include/obj_pool_base_include.c new file mode 100644 index 000000000..33fa5e0eb --- /dev/null +++ b/src/test/obj_include/obj_pool_base_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_pool_base_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/pool_base.h> diff --git a/src/test/obj_include/obj_pool_include.c b/src/test/obj_include/obj_pool_include.c new file mode 100644 index 000000000..78d9dae0a --- /dev/null +++ b/src/test/obj_include/obj_pool_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_pool_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/pool.h> diff --git a/src/test/obj_include/obj_thread_include.c b/src/test/obj_include/obj_thread_include.c new file mode 100644 index 000000000..83b1119c5 --- /dev/null +++ b/src/test/obj_include/obj_thread_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_thread_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/thread.h> diff --git a/src/test/obj_include/obj_tx_base_include.c b/src/test/obj_include/obj_tx_base_include.c new file mode 100644 index 000000000..ae173872e --- /dev/null +++ b/src/test/obj_include/obj_tx_base_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_tx_base_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/tx_base.h> diff --git a/src/test/obj_include/obj_inc.c b/src/test/obj_include/obj_tx_include.c similarity index 94% rename from src/test/obj_include/obj_inc.c rename to src/test/obj_include/obj_tx_include.c index bbc096974..db6fd6be1 100644 --- a/src/test/obj_include/obj_inc.c +++ b/src/test/obj_include/obj_tx_include.c @@ -30,10 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef BUILD_MAIN -int -main() -{ - return 0; -} -#endif +/* + * obj_tx_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/tx.h> diff --git a/src/test/obj_include/obj_types_include.c b/src/test/obj_include/obj_types_include.c new file mode 100644 index 000000000..5f87ebe31 --- /dev/null +++ b/src/test/obj_include/obj_types_include.c @@ -0,0 +1,37 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * obj_types_include.c -- include test for libpmemobj + */ + +#include <libpmemobj/types.h> diff --git a/src/test/pmem_include/.gitignore b/src/test/pmem_include/.gitignore new file mode 100644 index 000000000..e2e48ab38 --- /dev/null +++ b/src/test/pmem_include/.gitignore @@ -0,0 +1 @@ +pmem_include diff --git a/src/test/pmem_include/Makefile b/src/test/pmem_include/Makefile new file mode 100644 index 000000000..c362d29d8 --- /dev/null +++ b/src/test/pmem_include/Makefile @@ -0,0 +1,41 @@ +# +# Copyright 2016, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# src/test/pmem_include/Makefile -- compilation test for libpmem +# +TARGET = pmem_include +OBJS = pmem_include.o + +LIBPMEM=y + +include ../Makefile.inc diff --git a/src/test/pmem_include/TEST0 b/src/test/pmem_include/TEST0 new file mode 100755 index 000000000..3f11d9efb --- /dev/null +++ b/src/test/pmem_include/TEST0 @@ -0,0 +1,45 @@ +#!/bin/bash -e +# +# Copyright 2016, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# src/test/pmem_include/TEST0 - if it compiles it's perfect +# +export UNITTEST_NAME=obj_include/TEST0 +export UNITTEST_NUM=0 + +# standard unit test setup +. ../unittest/unittest.sh + +setup + +pass diff --git a/src/test/pmem_include/pmem_include.c b/src/test/pmem_include/pmem_include.c new file mode 100644 index 000000000..f9ce1cfa7 --- /dev/null +++ b/src/test/pmem_include/pmem_include.c @@ -0,0 +1,46 @@ +/* + * Copyright 2016, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * pmem_include.c -- include test for libpmem + * + * this is only a compilation test - do not run this program + */ + +#include <libpmem.h> + + +int +main() +{ + return 0; +} diff --git a/src/test/pmem_include/pmem_include.vcxproj b/src/test/pmem_include/pmem_include.vcxproj new file mode 100644 index 000000000..703475581 --- /dev/null +++ b/src/test/pmem_include/pmem_include.vcxproj @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{2B7772E6-9DAA-4F38-B0BC-7B2399366325}</ProjectGuid> + <RootNamespace>pmem_include</RootNamespace> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IncludePath>$(SolutionDir)\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck> + </SDLCheck> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck> + </SDLCheck> + <TreatWarningAsError>true</TreatWarningAsError> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="pmem_include.c" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\libpmem\libpmem.vcxproj"> + <Project>{9e9e3d25-2139-4a5d-9200-18148ddead45}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/src/test/pmem_include/pmem_include.vcxproj.filters b/src/test/pmem_include/pmem_include.vcxproj.filters new file mode 100644 index 000000000..212758da0 --- /dev/null +++ b/src/test/pmem_include/pmem_include.vcxproj.filters @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="pmem_include.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/src/test/unittest/unittest.h b/src/test/unittest/unittest.h index 8f81fb936..266cb285c 100644 --- a/src/test/unittest/unittest.h +++ b/src/test/unittest/unittest.h @@ -84,6 +84,13 @@ #ifndef _UNITTEST_H #define _UNITTEST_H 1 +#include <libpmem.h> +#include <libpmemblk.h> +#include <libpmemlog.h> +#include <libpmemobj.h> +#include <libpmempool.h> +#include <libvmem.h> + #ifdef __cplusplus extern "C" { #endif @@ -109,13 +116,6 @@ extern "C" { #include <dirent.h> #include <pthread.h> -#include <libpmem.h> -#include <libpmemblk.h> -#include <libpmemlog.h> -#include <libpmemobj.h> -#include <libpmempool.h> -#include <libvmem.h> - int ut_get_uuid_str(char *); #define UT_MAX_ERR_MSG 128 #define UT_POOL_HDR_UUID_STR_LEN 37 /* uuid string length */ diff --git a/src/windows/include/platform.h b/src/windows/include/platform.h index c73728031..835d5eb85 100644 --- a/src/windows/include/platform.h +++ b/src/windows/include/platform.h @@ -73,7 +73,6 @@ typedef long _off_t; /* NOTE: _off_t must be defined as 'long'! */ #define PATH_MAX MAX_PATH #define __thread __declspec(thread) #define __func__ __FUNCTION__ -#define __typeof__ decltype /* * The inline keyword is available only in VC++. diff --git a/utils/CSTYLE.ps1 b/utils/CSTYLE.ps1 index 2a4ea64d5..be3fd7da8 100644 --- a/utils/CSTYLE.ps1 +++ b/utils/CSTYLE.ps1 @@ -43,7 +43,7 @@ $checkdir = $rootdir $include = @( "*.c", "*.h" ) # exclude external files not following NVML coding style -$exclude = @( "queue.h", "getopt.h", "getopt.c") +$exclude = @( "queue.h", "getopt.h", "getopt.c", "pmemcompat.h") If ( Get-Command -Name perl -ErrorAction SilentlyContinue ) { Get-ChildItem -Path $checkdir -Recurse -Include $include -Exclude $exclude | ` -- GitLab