From 94538efc0e1e6d24cd1989f457050029e68dba9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 13 Feb 2020 21:33:37 +0100 Subject: [PATCH] [yul-phaser] Add a file for small utilities used in yul-phaser's tests --- test/CMakeLists.txt | 3 +++ test/yulPhaser/Common.cpp | 18 ++++++++++++++++++ test/yulPhaser/Common.h | 29 +++++++++++++++++++++++++++++ test/yulPhaser/CommonTest.cpp | 29 +++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 test/yulPhaser/Common.cpp create mode 100644 test/yulPhaser/Common.h create mode 100644 test/yulPhaser/CommonTest.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7cf466e0b..0f2801694 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -139,6 +139,9 @@ set(libyul_sources detect_stray_source_files("${libyul_sources}" "libyul/") set(yul_phaser_sources + yulPhaser/Common.h + yulPhaser/Common.cpp + yulPhaser/CommonTest.cpp yulPhaser/Chromosome.cpp yulPhaser/Population.cpp yulPhaser/Program.cpp diff --git a/test/yulPhaser/Common.cpp b/test/yulPhaser/Common.cpp new file mode 100644 index 000000000..bdc99a530 --- /dev/null +++ b/test/yulPhaser/Common.cpp @@ -0,0 +1,18 @@ +/* + This file is part of solidity. + + solidity is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + solidity is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with solidity. If not, see . +*/ + +#include diff --git a/test/yulPhaser/Common.h b/test/yulPhaser/Common.h new file mode 100644 index 000000000..8a7bc9afe --- /dev/null +++ b/test/yulPhaser/Common.h @@ -0,0 +1,29 @@ +/* + This file is part of solidity. + + solidity is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + solidity is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with solidity. If not, see . +*/ +/** + * Miscellaneous utilities for use in yul-phaser's test cases. + * + * - Generic code that's only used in these particular tests. + * - Convenience functions and wrappers to make tests more concise. + * - Mocks and dummy objects/functions used in multiple test suites. + * + * Note that the code included here may be not as generic, robust and/or complete as it could be + * since it's not meant for production use. If some utility seems useful enough to be moved to + * the normal code base, you should review its implementation before doing so. + */ + +#pragma once diff --git a/test/yulPhaser/CommonTest.cpp b/test/yulPhaser/CommonTest.cpp new file mode 100644 index 000000000..55ddc4633 --- /dev/null +++ b/test/yulPhaser/CommonTest.cpp @@ -0,0 +1,29 @@ +/* + This file is part of solidity. + + solidity is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + solidity is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with solidity. If not, see . +*/ + +#include + +namespace solidity::phaser::test +{ + +BOOST_AUTO_TEST_SUITE(Phaser) +BOOST_AUTO_TEST_SUITE(CommonTest) + +BOOST_AUTO_TEST_SUITE_END() +BOOST_AUTO_TEST_SUITE_END() + +}