-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from xtofalex/error_testing
error testing
- Loading branch information
Showing
16 changed files
with
260 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "gtest/gtest.h" | ||
|
||
#include <filesystem> | ||
#include <fstream> | ||
|
||
#include "VerilogConstructor.h" | ||
|
||
using namespace naja::verilog; | ||
|
||
#include "VerilogConstructorTest.h" | ||
|
||
#ifndef NAJA_VERILOG_BENCHMARKS | ||
#define NAJA_VERILOG_BENCHMARKS "Undefined" | ||
#endif | ||
|
||
TEST(NajaVerilogTestMultipleFiles, test) { | ||
VerilogConstructorTest constructor; | ||
std::filesystem::path multipleFilesPath( | ||
std::filesystem::path(NAJA_VERILOG_BENCHMARKS) | ||
/ std::filesystem::path("benchmarks") | ||
/ std::filesystem::path("multifiles")); | ||
VerilogConstructor::Paths paths; | ||
paths.push_back(multipleFilesPath / std::filesystem::path("mod0.v")); | ||
paths.push_back(multipleFilesPath / std::filesystem::path("mod1.v")); | ||
paths.push_back(multipleFilesPath / std::filesystem::path("top.v")); | ||
constructor.parse(paths); | ||
ASSERT_EQ(3, constructor.modules_.size()); | ||
EXPECT_EQ("mod0", constructor.modules_[0]->name_); | ||
EXPECT_EQ("mod1", constructor.modules_[1]->name_); | ||
EXPECT_EQ("top", constructor.modules_[2]->name_); | ||
ASSERT_EQ(2, constructor.modules_[0]->ports_.size()); | ||
ASSERT_EQ(2, constructor.modules_[1]->ports_.size()); | ||
ASSERT_EQ(2, constructor.modules_[2]->ports_.size()); | ||
|
||
constructor.setFirstPass(false); | ||
constructor.parse(paths); | ||
|
||
|
||
EXPECT_TRUE(constructor.modules_[0]->instances_.empty()); | ||
EXPECT_TRUE(constructor.modules_[1]->instances_.empty()); | ||
ASSERT_EQ(2, constructor.modules_[2]->instances_.size()); | ||
auto ins0 = constructor.modules_[2]->instances_[0]; | ||
EXPECT_EQ("ins0", ins0.name_); | ||
EXPECT_EQ("mod0", ins0.model_); | ||
auto ins1 = constructor.modules_[2]->instances_[1]; | ||
EXPECT_EQ("ins1", ins1.name_); | ||
EXPECT_EQ("mod1", ins1.model_); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
Unterminated comment | ||
*/ | ||
|
||
module test(); | ||
endmodule | ||
|
||
/* | ||
This is not terminated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
Unterminated pragma | ||
*/ | ||
|
||
(* src = "/home/source/test.v" | ||
module test(); | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
Syntax error | ||
*/ | ||
|
||
module test(); | ||
//Missing ";" | ||
model ins | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module mod0(input i, output o); | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module mod1(input a, output b); | ||
endmodule |
Oops, something went wrong.