From 004bcb9d2ad2f521efd53575d11b5f6e001e4af7 Mon Sep 17 00:00:00 2001 From: Sambhav Jain Date: Mon, 16 Oct 2023 16:53:01 -0700 Subject: [PATCH] Add test_suites for downstream integrations (#8) This allows integrating TCP tests into Cruise monorepo. Also merge `test/AotCompile/BUILD` into `test/BUILD`. --- test/AotCompile/BUILD | 22 ---------------------- test/BUILD | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 22 deletions(-) delete mode 100644 test/AotCompile/BUILD diff --git a/test/AotCompile/BUILD b/test/AotCompile/BUILD deleted file mode 100644 index ab82fe96..00000000 --- a/test/AotCompile/BUILD +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# Also available under a BSD-style license. See LICENSE. - -load("@//tools/aot:aot_compile.bzl", "aot_compile") -load("@rules_cc//cc:defs.bzl", "cc_test") - -aot_compile( - name = "basic_tcp_ops", - tcp_source = "basic_tcp_ops.mlir", -) - -cc_test( - name = "test_aot_compiled_basic_tcp_ops", - srcs = ["test_aot_compiled_basic_tcp_ops.cpp"], - deps = [ - ":aot_compiled_basic_tcp_ops", - "//tools/aot:abi", - "@googletest//:gtest_main", - ], -) diff --git a/test/BUILD b/test/BUILD index e97dc074..b606ab96 100644 --- a/test/BUILD +++ b/test/BUILD @@ -5,6 +5,8 @@ load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("@llvm-project//llvm:lit_test.bzl", "lit_test") +load("//tools/aot:aot_compile.bzl", "aot_compile") +load("@rules_cc//cc:defs.bzl", "cc_test") expand_template( name = "lit_site_cfg_py", @@ -40,6 +42,7 @@ filegroup( "//:tcp-opt", "//test:lit_data", ], + tags = ["lit_tests"], ) for src in glob([ "Conversion/**/*.mlir", @@ -47,3 +50,37 @@ filegroup( "Pipeline/**/*.mlir", ]) ] + +aot_compile( + name = "basic_tcp_ops", + tcp_source = "AotCompile/basic_tcp_ops.mlir", +) + +cc_test( + name = "AotCompile/test_aot_compiled_basic_tcp_ops", + srcs = ["AotCompile/test_aot_compiled_basic_tcp_ops.cpp"], + tags = ["aot_tests"], + deps = [ + ":aot_compiled_basic_tcp_ops", + "//tools/aot:abi", + "@googletest//:gtest_main", + ], +) + +test_suite( + name = "lit_tests", + tags = ["lit_tests"], +) + +test_suite( + name = "aot_tests", + tags = ["aot_tests"], +) + +test_suite( + name = "all_tests", + tests = [ + "//test:aot_tests", + "//test:lit_tests", + ], +)