Skip to content

Commit 844bb20

Browse files
author
svorenova
committed
Pulling out a utility function to a separate file
1 parent 3585f73 commit 844bb20

File tree

4 files changed

+43
-9
lines changed

4 files changed

+43
-9
lines changed

unit/java_bytecode/java_bytecode_parser/java_bytecode_parse_lambda_method_table.cpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,11 @@
1818

1919
#include <java_bytecode/java_bytecode_parse_tree.h>
2020
#include <java_bytecode/java_types.h>
21+
#include <testing-utils/run_test_with_compilers.h>
2122

2223
typedef java_bytecode_parse_treet::classt::lambda_method_handlet
2324
lambda_method_handlet;
2425

25-
void run_test_with_compilers(
26-
const std::function<void(std::string)> &test_with_compiler)
27-
{
28-
test_with_compiler("openjdk_8");
29-
test_with_compiler("eclipse");
30-
test_with_compiler("oracle_8");
31-
test_with_compiler("oracle_9");
32-
}
33-
3426
SCENARIO(
3527
"lambda_method_handle_map with static lambdas",
3628
"[core][java_bytecode][java_bytecode_parse_lambda_method_handle]")

unit/testing-utils/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ SRC = \
44
load_java_class.cpp \
55
require_expr.cpp \
66
require_goto_statements.cpp \
7+
require_parse_tree.cpp \
8+
require_symbol.cpp \
79
require_type.cpp \
10+
run_test_with_compilers.cpp \
811
# Empty last line (please keep above list sorted!)
912

1013
INCLUDES = -I .. -I . -I ../../src
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*******************************************************************\
2+
3+
Module: Unit test utilities
4+
5+
Author: Diffblue Ltd.
6+
7+
\*******************************************************************/
8+
9+
#include "run_test_with_compilers.h"
10+
11+
void run_test_with_compilers(
12+
const std::function<void(const std::string &)> &test_with_compiler)
13+
{
14+
test_with_compiler(std::string("openjdk_8"));
15+
test_with_compiler(std::string("eclipse"));
16+
test_with_compiler(std::string("oracle_8"));
17+
test_with_compiler(std::string("oracle_9"));
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*******************************************************************\
2+
3+
Module: Unit test utilities
4+
5+
Author: Diffblue Ltd.
6+
7+
\*******************************************************************/
8+
9+
/// \file
10+
/// Utility for running a test with different compilers.
11+
12+
#ifndef CPROVER_TESTING_UTILS_RUN_TEST_WITH_COMPILERS_H
13+
#define CPROVER_TESTING_UTILS_RUN_TEST_WITH_COMPILERS_H
14+
15+
#include <functional>
16+
#include <string>
17+
18+
void run_test_with_compilers(
19+
const std::function<void(const std::string &)> &test_with_compiler);
20+
21+
#endif // CPROVER_TESTING_UTILS_RUN_TEST_WITH_COMPILERS_H

0 commit comments

Comments
 (0)