Use the fspp test cases for cryfs
This commit is contained in:
parent
26bdd6ff3a
commit
662c3f8e90
@ -1,5 +1,7 @@
|
|||||||
INCLUDE(messmer/cmake/tools)
|
INCLUDE(messmer/cmake/tools)
|
||||||
|
|
||||||
|
SETUP_GOOGLETEST()
|
||||||
|
|
||||||
# Actually create targets: EXEcutables and libraries.
|
# Actually create targets: EXEcutables and libraries.
|
||||||
ADD_BIICODE_TARGETS()
|
ADD_BIICODE_TARGETS()
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
# Biicode configuration file
|
# Biicode configuration file
|
||||||
|
|
||||||
[requirements]
|
[requirements]
|
||||||
|
google/gtest: 10
|
||||||
messmer/blobstore: 0
|
messmer/blobstore: 0
|
||||||
messmer/blockstore: 1
|
messmer/blockstore: 1
|
||||||
messmer/cmake: 3
|
messmer/cmake: 3
|
||||||
messmer/cpp-utils: 2
|
messmer/cpp-utils: 2
|
||||||
messmer/fspp: 0
|
messmer/fspp: 0
|
||||||
|
messmer/tempfile: 4
|
||||||
|
|
||||||
[parent]
|
[parent]
|
||||||
messmer/cryfs: 0
|
messmer/cryfs: 0
|
||||||
@ -18,6 +20,7 @@
|
|||||||
# Manual adjust file implicit dependencies, add (+), remove (-), or overwrite (=)
|
# Manual adjust file implicit dependencies, add (+), remove (-), or overwrite (=)
|
||||||
# hello.h + hello_imp.cpp hello_imp2.cpp
|
# hello.h + hello_imp.cpp hello_imp2.cpp
|
||||||
# *.h + *.cpp
|
# *.h + *.cpp
|
||||||
|
test/main.cpp + test/*.cpp
|
||||||
|
|
||||||
[mains]
|
[mains]
|
||||||
# Manual adjust of files that define an executable
|
# Manual adjust of files that define an executable
|
||||||
@ -39,3 +42,5 @@
|
|||||||
# when loading from disk such data
|
# when loading from disk such data
|
||||||
# image.cpp + image.jpg # code should write open("user/block/image.jpg")
|
# image.cpp + image.jpg # code should write open("user/block/image.jpg")
|
||||||
|
|
||||||
|
#[tests]
|
||||||
|
# test/*
|
||||||
|
31
test/FileSystemTest.cpp
Normal file
31
test/FileSystemTest.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include <messmer/blockstore/implementations/testfake/FakeBlockStore.h>
|
||||||
|
#include <messmer/fspp/fstest/FsTest.h>
|
||||||
|
#include <messmer/tempfile/src/TempFile.h>
|
||||||
|
|
||||||
|
#include "../src/CryDevice.h"
|
||||||
|
|
||||||
|
using std::unique_ptr;
|
||||||
|
using std::make_unique;
|
||||||
|
|
||||||
|
using fspp::Device;
|
||||||
|
|
||||||
|
using blockstore::testfake::FakeBlockStore;
|
||||||
|
|
||||||
|
using namespace cryfs;
|
||||||
|
|
||||||
|
class CryFsTestFixture: public FileSystemTestFixture {
|
||||||
|
public:
|
||||||
|
CryFsTestFixture()
|
||||||
|
// Don't create config tempfile yet
|
||||||
|
: configFile(false) {}
|
||||||
|
|
||||||
|
unique_ptr<Device> createDevice() override {
|
||||||
|
auto blockStore = make_unique<FakeBlockStore>();
|
||||||
|
auto config = make_unique<CryConfig>(configFile.path());
|
||||||
|
return make_unique<CryDevice>(std::move(config), std::move(blockStore));
|
||||||
|
}
|
||||||
|
|
||||||
|
tempfile::TempFile configFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
INSTANTIATE_TYPED_TEST_CASE_P(CryFS, FileSystemTest, CryFsTestFixture);
|
6
test/main.cpp
Normal file
6
test/main.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "google/gtest/gtest.h"
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
testing::InitGoogleTest(&argc, argv);
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user