Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transitioned to USDOT fork of asn1c repository #26

Merged
merged 8 commits into from
Jun 3, 2024
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "pugixml"]
path = pugixml
url = https://github.com/zeux/pugixml.git
[submodule "asn1c"]
path = asn1c
url = https://github.com/mouse07410/asn1c
[submodule "usdot-asn1c"]
path = usdot-asn1c
url = https://github.com/usdot-fhwa-stol/usdot-asn1c
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ADD ./pugixml /asn1_codec/pugixml
RUN cd /asn1_codec/pugixml && mkdir -p build && cd build && cmake .. && make && make install

# Build and install asn1c submodule
ADD ./asn1c /asn1_codec/asn1c
ADD ./usdot-asn1c /asn1_codec/asn1c
RUN cd asn1c && test -f configure || autoreconf -iv && ./configure && make && make install

# Make generated files available to the build & compile example
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ADD ./pugixml /asn1_codec/pugixml
RUN cd /asn1_codec/pugixml && mkdir -p build && cd build && cmake .. && make && make install

# Build and install asn1c submodule
ADD ./asn1c /asn1_codec/asn1c
ADD ./usdot-asn1c /asn1_codec/asn1c
RUN cd asn1c && test -f configure || autoreconf -iv && ./configure && make && make install

# Make generated files available to the build & compile example
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.standalone
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ADD ./pugixml /asn1_codec/pugixml
RUN cd /asn1_codec/pugixml && mkdir -p build && cd build && cmake .. && make && make install

# Build and install asn1c submodule
ADD ./asn1c /asn1_codec/asn1c
ADD ./usdot-asn1c /asn1_codec/asn1c
RUN cd asn1c && test -f configure || autoreconf -iv && ./configure && make && make install

# Make generated files available to the build & compile example
Expand Down
12 changes: 12 additions & 0 deletions asn1c_combined/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ This script expects the necessary files to have already been generated by the `g
## Generating the C Code
The necessary files can be generated using the `generate-files.sh` script. This script will reference the necessary ASN.1 files from the `j2735-asn-files` directory from the specified year and generate the C code in the `generated-files` directory.

### Installing asn1c
The `generate-files.sh` script requires the `asn1c` compiler to be installed. The `asn1c` compiler can be installed in WSL using the following commands:

```bash
cd ./usdot-asn1c
aclocal
test -f configure || autoreconf -iv
./configure
make
sudo make install
```

### J2735 ASN Files
The 'j2735-asn-files' subdirectory should contain the ASN.1 files for the J2735 standard. These are organized by year.

Expand Down
Binary file modified asn1c_combined/generated-files/2016.tar.gz
Binary file not shown.
Binary file modified asn1c_combined/generated-files/2020.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions build_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ initializeSubmodules(){
buildAsn1c(){
# build asn1c
echo "${GREEN}Building asn1c${NC}"
cd ./asn1c
cd ./usdot-asn1c
git reset --hard
git pull origin master
git pull origin vlm_master
aclocal
test -f ./configure || autoreconf -iv
./configure
Expand Down
21 changes: 18 additions & 3 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,32 @@ There are currently two ways to test the capabilities of the ACM.
- [Standalone Operation / Testing](#standalone-testing)

## Unit Testing
### Testing On Local Machine
The following command can be run to build & run the unit tests:

```bash
$ ./build_local.sh
```

Unit tests are built when the ACM is compiled during installation. Those tests can be run using the following command:

### Testing Using Docker
Start by building the Docker image:

```bash
$ ./acm_tests
$ docker build -t acm .
```

Then run the Docker container:

```bash
$ docker run -it --name acm acm
```

If using Docker, exec into the container and run the tests:
Exec into the container and run the tests:

```bash
$ docker exec -it acm /bin/bash
$ cd /build
$ ./acm_tests
```

Expand Down
8 changes: 4 additions & 4 deletions src/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const char *ONE609_BSM_HEX = "038081B1001480AD562FA8400039E8E717090F9665FE1BACC3
const char *ASD_ONE609_HEX = "44400000000084782786283B90A7148D2B0A89C49F8A85A7763BF8423C13C2107E1C0C6F7E2C0C6F16A070103620029015AAC5F50800073D1CE2E121F2CCBFC375986FFFFFFFFE0007775FBF43F4200FFFF000000000004042983820082FFFFFFFD049C20147FFFFFFFD128420408FFFFFFFD2454204D480287FFD2BAC2084680BAFFFD4EAC2064580B33FFD5BF42072380D6BFFD6FCC2079681407FFDA424206778115BFFDB34C205D0811CBFFDBC5C2057B8110BFFDBE142001780337FFEFE643FFFF800BBFFF8AB43FFFFFFFFFFFFBA3420080FFFFFFFFC345FFFC00000";

/**
* After switching to using `mouse07410/asn1c` (a fork of `vlm/asn1c`), this unit test is failing.
* This unit test is currently failing with the fork of asn1c that we're using (currently `usdot-fhwa-stol/usdot-asn1c`).
* Since encoding BSMs is not a desired feature of the ACM, this test case has been commented out.
*/
// TEST_CASE("Encode BSM", "[encoding]" ) { // TODO: fix test case failing
Expand Down Expand Up @@ -74,7 +74,7 @@ TEST_CASE("Encode ASD", "[encoding]" ) {
}

/**
* After switching to using `mouse07410/asn1c` (a fork of `vlm/asn1c`), this unit test is failing.
* This unit test is currently failing with the fork of asn1c that we're using (currently `usdot-fhwa-stol/usdot-asn1c`).
* Since encoding BSMs is not a desired feature of the ACM, this test case has been commented out.
*/
// TEST_CASE("Encode ASD_BSM", "[encoding]" ) { // TODO: fix test case failing
Expand Down Expand Up @@ -132,7 +132,7 @@ TEST_CASE("Encode ASD_1609", "[encoding]" ) {
}

/**
* After switching to using `mouse07410/asn1c` (a fork of `vlm/asn1c`), this unit test is failing.
* This unit test is currently failing with the fork of asn1c that we're using (currently `usdot-fhwa-stol/usdot-asn1c`).
* Since encoding BSMs is not a desired feature of the ACM, this test case has been commented out.
*/
// TEST_CASE("Encode 1609_BSM", "[encoding]") { // TODO: fix test case failing
Expand All @@ -154,7 +154,7 @@ TEST_CASE("Encode ASD_1609", "[encoding]" ) {
// }

/**
* After switching to using `mouse07410/asn1c` (a fork of `vlm/asn1c`), this unit test is failing.
* This unit test is currently failing with the fork of asn1c that we're using (currently `usdot-fhwa-stol/usdot-asn1c`).
* Since encoding BSMs is not a desired feature of the ACM, this test case has been commented out.
*/
// TEST_CASE("Encode ASD_1609_BSM", "[encoding]") { // TODO: fix test case failing
Expand Down
Loading